Command Log Widget
Overview
The Command Log Widget is a minimal dock widget that displays the list of CommandDescriptor entries recorded by the shared CommandRecorder during the current session. It provides visibility into what commands have been executed and allows exporting the recorded trace as JSON.
This is intentionally minimal — NOT the full Phase 4 Action Journal. No persistence, timestamps, filtering, or provenance. Just enough to see what happened and export it.
Source Location
src/WhiskerToolbox/CommandLog_Widget/
├── CMakeLists.txt
├── Core/CommandLogStateData.hpp # Serializable state data (minimal)
├── Core/CommandLogState.hpp/.cpp # EditorState subclass
├── UI/CommandLogWidget.hpp/.cpp # The widget (QListWidget + buttons)
└── CommandLogWidgetRegistration.hpp/.cpp # EditorRegistry integration
Features
- Command List: Displays each executed command’s name, description, and a compact summary of its parameters.
- Copy as JSON: Calls
recorder->toSequence("recorded_session"), serializes viarfl::json::write(), and copies to the system clipboard. The resulting JSON is a validCommandSequenceDescriptorthat can be pasted into a Catch2 golden trace test. - Clear: Resets the recorder and clears the displayed list.
- Auto-refresh: A 500ms poll timer incrementally appends new entries without rebuilding the entire list.
Access
Open via Modules → Command Log in the menu bar.
Architecture
The widget follows the standard EditorState registration pattern:
CommandLogStateis a minimalEditorStatesubclass with no meaningful persistent configuration beyond instance identity.CommandLogWidgettakes a non-owningCommandRecorder*(fromMainWindow) and polls it for new entries.- Registration uses
Zone::Right, single-instance, no properties panel.
Relationship to Action Journal
This widget implements the Command Log UI for session command recording. Integration testing (golden traces, DataManagerSnapshot replay) is tracked in #288.
Future Action Journal work will replace this minimal widget with a persistent, timestamped, filterable log.
See Also
- CommandRecorder — the recorder class that captures executed
CommandDescriptorentries - Sequence Execution —
executeSequence()and its recording hook