Skip to content

feat: interactive tutorial mode for new users - #28

Merged
striderZA merged 2 commits into
masterfrom
archon/task-archon-fix-github-issue-1785351708095
Aug 8, 2026
Merged

feat: interactive tutorial mode for new users#28
striderZA merged 2 commits into
masterfrom
archon/task-archon-fix-github-issue-1785351708095

Conversation

@striderZA

Copy link
Copy Markdown
Owner

Summary

Adds an interactive, data-driven tutorial mode that guides new users through adding, connecting, configuring, and probing a component, launched from Help > Tutorial or a one-time first-run prompt.

Related issue

Closes #17

Type of change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Build / CI

Test plan

  • cmake -B build -G Ninja && cmake --build build — clean build, no warnings
  • ctest --test-dir build --output-on-failure -E "Benchmark" — 73/73 passed
  • Manual verification steps:
    • DISPLAY=:0 ./build/bin/test_ui — 27/27 UI tests passed (22 pre-existing + 5 new)
    • 8s live run of build/bin/tiny-rf-simulator with the marker file removed — first-run prompt appears once, no crash, marker correctly withheld until dismissed/completed

Checklist

  • My code follows the existing code style (see .clang-format)
  • I ran clang-format -i on changed files (clang-format-18 --dry-run --Werror clean on all 11 changed/added C++ files)
  • I added or updated tests where appropriate (tests/test_tutorial_state.cpp, 5 new UI tests in test_engine/ui_tests.cpp)
  • Existing tests still pass

What's new

  • New tutorial/ module (sibling to help//layout/): TutorialCatalog (6-step data-driven catalog), TutorialState (pure navigation state machine + cross-platform exe-relative marker-file persistence), TutorialWidget (highlight border via GetForegroundDrawList() + floating guide window with Back/Next/Skip/Exit).
  • Help > Tutorial menu item launches the walkthrough on demand; a one-time first-run modal offers it on first launch (no marker file present).
  • Each step highlights its target panel (Component Library, Node Editor, Properties, Spectrum Analyzer) with a bright outline; the welcome step has no target.
  • Starting the tutorial reuses the existing unsaved-changes guard (PendingAction::Tutorial), so an in-progress project is never silently discarded — same flow as New/Open/Exit.
  • Completion persists cross-platform via an exe-relative marker file (mirrors LayoutManager's exe-dir detection), since the existing SessionState is Windows-only and would never persist on Linux/macOS.

Notable implementation decisions (see implementation.md for full rationale)

  • First-run modal uses the codebase's actual OpenPopup/BeginPopupModal bool-flag pattern (matching m_show_save_layout_dialog precedent).
  • Skip jumps to the last step (stays active) rather than duplicating Exit's behavior, delivering three genuinely distinct actions as the issue requested.
  • Unit tests (test_tutorial_state.cpp) are a standalone Catch2 executable rather than appended to TEST_SOURCES, because the MinGW-w64 CI toolchain silently drops TEST_CASEs registered beyond the ~217 already linked into tests.exe.
  • startTutorial() forces the four target panels visible (m_show_node_editor/m_show_properties/m_show_spectrum/m_show_library) so every step actually has something to highlight, even on a default launch where the Component Library panel starts hidden.

Known follow-ups (out of scope for this PR)

  • scripts/format.sh's DIRS list and the CI format job don't yet cover help/, layout/, or the new tutorial/ — new sources were verified clean manually but aren't gated by the automated check.
  • help_widget.cpp's pre-existing "Zoom: mouse wheel" bullet describes a gesture with no backing implementation in the codebase (confirmed via grep); left unchanged as it predates this PR and zoom is out of scope.

New users only had a static "How to Use" reference panel — nothing that
actively pointed at a panel and walked them through a real end-to-end
workflow, and no notion of a first launch.

Adds a `tutorial/` module (sibling to `help/`/`layout/`) providing a
data-driven 6-step guided walkthrough that outlines the panel each step
talks about and offers Back/Next/Skip/Exit at every point.

Changes:
- Add tutorial module: TutorialStep catalog, TutorialState (pure navigation
  + persistence), TutorialWidget (foreground-drawlist highlight + guide window)
- Persist completion in an exe-relative .tutorial_completed marker, mirroring
  LayoutManager, so first-run works on Linux/macOS as well as Windows
  (SessionState is a Windows-only no-op)
- Wire Help > Tutorial and a one-time first-run modal into RfSimulatorApp
- Route tutorial start through the existing unsaved-changes guard via
  PendingAction::Tutorial, so the user's project is never silently discarded
- Point users at the tutorial from the help panel
- Add tests/test_tutorial_state.cpp (68 assertions) as a standalone binary,
  matching test_component_authoring's MinGW TEST_CASE-limit workaround
- Add 5 ImGui Test Engine UI tests covering menu launch, the dirty-project
  guard, step navigation, completion persistence, and the first-run prompt
- DOX: add tutorial/AGENTS.md, update root, app/, and tests/ docs

Fixes #17
Resolve 3 additive conflicts (tutorial module vs. plugin extension
system, both landed independently):
- app/CMakeLists.txt: keep both new app/src/*.cpp sources (extension
  manifest/manager, external tool runner, pfb view manager, project
  serializer) and simulator::tutorial link; use master's
  RFSIM_APP_VERSION (PROJECT_VERSION is clobbered by FetchContent).
- app/include/app.h: keep both new test accessors and both new
  method declarations (requestTutorial/startTutorial + rewireInputs).
- tests/CMakeLists.txt: keep test_tutorial_state alongside master's
  new standalone test executables.
@striderZA
striderZA marked this pull request as ready for review August 8, 2026 14:27
@striderZA
striderZA merged commit bb7cefc into master Aug 8, 2026
2 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.

Interactive tutorial mode for new users

1 participant