Feature/history panel - #339
Open
ThomasMalletCodra wants to merge 123 commits into
Open
Conversation
Assisted-by: Claude Opus 4.7
Migrated from history panel legacy branch
…get and HTML rendering
…el and related components
…ages and replay actions
(cherry picked from commit 6807861)
…s and add new history panel entries
Split the history feature into dedicated modules, refresh the GUI wiring and widgets, and update the related tests and translations.
# Conflicts: # datalab/locale/fr/LC_MESSAGES/datalab.po # doc/locale/fr/LC_MESSAGES/release_notes/release_1.03.po # doc/release_notes/release_1.03.md
Follow-up to a review noting that ruff/pylint had not been run on the History panel refactor after it was split into submodules. Cross-module access to underscore-prefixed members triggered W0212, plus a batch of other lint warnings that were addressed without disabling any checks.
Creation actions (new signal/image) were recorded in the history but, unlike process actions, could not be edited, recomputed or reverted. Editing a creation left downstream steps inconsistent. This makes creations first-class history actions: their parameters can be re-edited, the result is recomputed in place (keeping the UUID and downstream references), and the chain cascades correctly. * [NEW] : Allow editing creation (new_object) parameters via dialog and recompute in place, preserving the output UUID so downstream actions stay linked * [NEW] : Resolve target panel for UI creation actions so they replay and cascade like compute actions * [CHG] : add_ui_entry now returns the created HistoryAction, enabling creation output_uuids to be registered for downstream resolution * [CHG] : Restore/undo without saving now covers creation actions for both single action and full session * [FIX] : Snapshot creation parameters on edit for proper export/import and revert
…ompute Edit-mode replay opened parameter dialogs per selected action, each editing its own downstream chain. Overlapping chains caused repeated prompts and inconsistent state. Recompute also stopped at the edited action instead of cascading to the full downstream. * [FIX] : Process selected actions once via edit_mode_replay_actions, with deduplication, session-order sorting and a re-entrance guard, instead of calling edit_mode_replay per action * [FIX] : Replay only the selected actions; on param change, recompute in place then cascade fully downstream from the most upstream edited action * [CHG] : Cancel restores parameter snapshots for already-edited actions
After loading a workspace from an HDF5 file, creating a new history session raised a TypeError and the active session title was no longer displayed in bold. Session numbers deserialized from HDF5 are NumPy scalars, so comparing them to the active session number produced a numpy.bool that Qt's QFont.setBold() rejects, aborting the highlight refresh. * [FIX] : Coerce the session number to a plain Python int when deserializing a history session from HDF5 * [FIX] : Cast the active-session comparison to bool in the history tree highlight refresh, so sessions loaded from older files remain safe
When objects consumed by a recorded processing chain were deleted, the Replay, Step-by-step and double-click commands were vetoed with a bare error dialog (or a silent no-op), leaving the user stuck with a broken history. A resolution dialog now explains that deleted objects broke the chain and offers to repair it or cancel. * [NEW] : Replace the compatibility veto with a dialog offering "Repair and continue" (prune broken actions and their downstream descendants, then replay the remaining valid actions) or Cancel (history left untouched; the dialog reappears until repaired) * [NEW] : Unattended mode follows the accept_dialogs setting, keeping the previous conservative default (cancel) * [NEW] : Regression tests for the repair and cancel paths on a genuinely broken signal chain
* [DOC] : Document the Delete key, the broken-chain resolution dialog, duplication independence semantics and replay behavior with recorded deletions in the History panel feature page * [DOC] : Add user-focused release notes entries for the History panel fixes and new features
* [CHG] : Translate the new broken-chain resolution dialog and the destructive-action skip warnings; resolve fuzzy entries introduced by the translation scan
…panel # Conflicts: # datalab/locale/fr/LC_MESSAGES/datalab.po # doc/locale/fr/LC_MESSAGES/features/common/historypanel.po # doc/locale/fr/LC_MESSAGES/features/validation/status.po # doc/locale/fr/LC_MESSAGES/intro/installation.po # doc/locale/fr/LC_MESSAGES/intro/tutorials/blobs.po # doc/locale/fr/LC_MESSAGES/intro/tutorials/laser_beam.po # doc/locale/fr/LC_MESSAGES/requirements.po
Actions flagged as outdated (is_stale) after a failed or interrupted cascade recompute, a reconnection, or pending parameter edits were tracked internally but not shown to the user: refresh_action_item was resetting the row background to the default brush, leaving no visual feedback when a processing chain was left desynchronized. The history tree now tints stale action rows with an amber highlight (alpha-based, dark/light theme friendly) and adds an explanatory tooltip, without clobbering the workspace-compatibility rendering. Styling is centralized in HistoryTree.apply_stale_style and applied consistently on item build, refresh and compatibility updates.
…nd replay recompute_cascade and replay_actions pump the event loop (processEvents) while iterating over session actions, so a user click on Delete, Replay, Duplicate, etc. could mutate the action lists being processed and corrupt the run. History panel commands triggered from the UI (toolbar actions, context menu, double-click, Delete key in the tree) are now silently ignored while the recompute/replay engine is busy (new HistoryExecutionState.is_busy guard), and the toolbar actions are visually disabled for the duration of engine runs (is_engine_busy: cascade or edit-replay in progress), with guaranteed re-enabling through try/finally epilogues. Internal engine calls and programmatic/test entry points are unaffected.
…e history load Loading a .dlhist file or an HDF5 workspace whose history contained a single undecodable ROI payload (renamed ROI class, untrusted module, corrupted data) raised an error that made the entire history load fail. ROI decode failures are now degraded locally: the affected action loads with empty parameters, is flagged as broken (new transient decode_failed attribute, propagated by copies and duplications) and is reported through the existing incompatible-action UX (disabled row, broken-chain repair, remove-incompatible). The flag is enforced at the execution boundary so a broken action can never be recomputed or replayed with altered semantics (e.g. a broken ROI mutation silently deleting ROIs): cascade, reconnection, replay and restore paths all skip it with a warning. A corrupted edit snapshot is discarded instead of shadowing valid parameters. The trusted-module security check on ROI decoding is unchanged.
WorkspaceState.save built the informative shape list with a direct obj.data.shape access, raising AttributeError when a selected object had no data array and aborting the user's operation at recording time. The shape capture is now defensive, consistent with get_object_metadata, and stores an empty placeholder instead.
…kspace changes The full-tree compatibility refresh (O(actions x objects), including ROI signature hashing) was connected directly to the object added/removed/modified signals of both data panels, so batch file loads and intermediate objects created during cascade recomputes triggered one full refresh per object, freezing the UI on large workspaces with long histories. Signal-driven refreshes are now coalesced per event-loop turn (pending flag + zero-delay timer, mirroring the existing session prompt debounce), with a liveness guard for shutdown. Explicit refresh calls in engine epilogues remain synchronous, and the reconnect/prune ordering on object removal is unchanged.
…ility fixes The documentation stated that the Signals and Images panels each had their own active history session, which does not match the actual behavior: a single active recording session is shared by both panels, with sessions related to panels only through the actions they contain. Also documents the new behaviors introduced by the stability fixes: amber marking of outdated steps, unavailability of History commands while a replay or recompute is running, and degraded loading of undecodable history entries. Adds the corresponding user-focused entries to the 1.3.0 release notes.
dappham-CODRA
force-pushed
the
feature/history-panel
branch
3 times, most recently
from
August 13, 2026 19:44
78dedc8 to
1e41274
Compare
Adds translations for the new outdated-step tooltip and the undecodable-entry replay warning, and fixes fuzzy entries introduced by the translation scan.
Replaces argument-less pass-through lambdas by direct bound-method references in the guarded toolbar wiring, and scopes a pylint disable on recompute_action_in_place for the additional early return added by the decode-failure guard.
…ature/history-panel
- Enhanced the French translation for the laser beam tutorial, improving clarity and accuracy in descriptions of measuring techniques and tools used in DataLab. - Revised the release notes for version 1.03, adding details about new features such as history panel sessions, special values processing, and improved user feedback mechanisms. - Included updates on bug fixes related to history panel functionality, ensuring a smoother user experience and better handling of edge cases.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.