Skip to content

Replace Actions/ActionManager with unified ControlManager + custom ac…#17

Merged
willwade merged 9 commits into
mainfrom
feature-control-manager-v2
Jun 17, 2026
Merged

Replace Actions/ActionManager with unified ControlManager + custom ac…#17
willwade merged 9 commits into
mainfrom
feature-control-manager-v2

Conversation

@willwade

Copy link
Copy Markdown

Summary

Issue / RFC: #
Replaces the old typed event system (Actions.h / ActionManager.h with 14 hardcoded Event<> channels) with a single, generic, extensible action framework. Both alphabet symbol nodes and control nodes now use the same ControlAction base class and ActionRegistry. Frontends can register arbitrary custom actions via dasher_register_action() — anything from API calls to opening apps — without touching C++.

Type of change

  • [x ] Bug fix
  • New feature
  • Cross-platform / parity change
  • Refactor / tooling / docs

Cross-platform impact

A core goal of Dasher v6 is feature parity across frontends. Help reviewers
see the blast radius:

  • This changes a capability that users see on other platforms.
    This adds the control mode (editing commands: delete, move, speak, copy) to all frontends via the C API. Previously this was platform-specific C++ code. The custom action API enables all frontends to extend Dasher with arbitrary actions.
  • This introduces a new UX or hardware interaction.

Definition of Done

  • CI is green (build + tests + lint + format, as applicable)
  • Tests added for new behaviour
  • [] Feature matrix updated if this affects a cross-platform capability
  • Docs / changelog updated if the change is user-facing

willwade added 9 commits June 17, 2026 11:54
…tion API

- Delete Actions.h, Actions.cpp, ActionManager.h (typed event system)
- Add ControlManager.h/.cpp: generic ActionRegistry + ControlAction base,
  all built-in actions (stop/pause/move/delete/speak/copy), CContNode tree,
  pugixml-based control.xml parser
- Add Data/control/control.xml + control.dtd (from Dasher v5)
- Add dasher_register_action() C API for frontend-registered custom actions
  with name+attributes callback, wired via GetPendingCustomActions() hook
- Add BP_CONTROL_MODE / BP_SLOW_CONTROL_BOX parameters
- Wire ControlManager into NodeCreationManager (CreateControlBox, AddExtras)
- Update AlphabetManager, AlphIO, AlphInfo to use ControlAction
- Add model rebuild on BP_CONTROL_MODE toggle in HandleParameterChange
- Add docs/CUSTOM_ACTIONS.md developer guide
- Add tests/test_control_actions.cpp (ActionRegistry unit + C API integration)
- Register test in CMakeLists.txt
Parameter notification order is non-deterministic (unordered_map in
Event::Broadcast). When DasherInterfaceBase fires before NCManager,
AddExtras() uses the old CControlManager to graft nodes, then NCManager
deletes the manager+templates, leaving dangling pointers in the new tree.

Fix: DasherInterfaceBase now explicitly calls NCManager::CreateControlBox()
before SetOffset(). NCManager no longer subscribes to BP_CONTROL_MODE.
CContNode::getLabelColor/getOutlineColor returned ColorPalette::noColor
({0,0,0,0} = fully transparent), making all control node labels invisible.
Now uses palette defaultLabelColor/defaultOutlineColor.
ScanFiles treated relative filenames as direct paths, finding corrupted
user-adapted training files in the CWD instead of searching the data
directory. This caused the PPM model to train on garbage data, making
all letter boxes uniform size.

- ScanFiles: only treat absolute paths as direct file references
- WriteUserDataFile: prepend s_dataDirectory to relative filenames
CommandScreen::Polyline was silently dropping the iWidth parameter.
Added opcode 6 (set line width) before line segments so the renderer
can draw polylines at the correct width.
Polyline now emits opcode 6 before line segments. Updated test bounds
from <=5 to <=6 and added case 6 to coordinates_in_bounds switch.
@willwade willwade merged commit 26403f7 into main Jun 17, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant