Skip to content

Add info dialog explaining track digitization workflow - #42

Merged
veillette merged 4 commits into
mainfrom
claude/add-info-button-modal-aJPBv
Feb 23, 2026
Merged

Add info dialog explaining track digitization workflow#42
veillette merged 4 commits into
mainfrom
claude/add-info-button-modal-aJPBv

Conversation

@veillette

Copy link
Copy Markdown
Collaborator

Summary

This PR adds an interactive info dialog that guides users through the track digitization workflow in TrackLab. The dialog is accessible via a new info button (?) in the lower-left corner of the screen and displays six steps explaining how to use the application.

Key Changes

  • New InfoDialogNode component (src/screen-name/view/InfoDialogNode.ts): A modal dialog displaying step-by-step instructions for digitizing tracks. Features include:

    • Title with close button
    • Six numbered steps with bold titles and descriptive body text
    • Horizontal separator between header and content
    • Responsive layout with proper spacing and text wrapping
    • Hidden by default, toggled via visibility property
  • Updated SimScreenView: Integrated the info dialog and info button into the main screen:

    • Added info button positioned in lower-left corner, mirroring the reset button layout
    • Positioned info dialog centered horizontally above the info button
    • Button toggles dialog visibility on click
  • Extended StringManager: Added getInfoDialog() method to provide localized string properties for all dialog content

  • Localization: Added complete English and French translations for all six workflow steps in strings_en.json and strings_fr.json

Implementation Details

  • The info button uses a flat appearance strategy with a "?" character and matches the dark button styling
  • Dialog content uses a VBox layout with proper spacing constants for visual hierarchy
  • Text uses different font sizes and colors (muted text for descriptions) to distinguish step titles from body content
  • The dialog respects the layout bounds and maintains proper margins from the info button

https://claude.ai/code/session_019asowJWZYPgvgsefumiFmG

Adds a '?' button in the lower-left corner (mirroring the reset button
margin) that toggles a floating InfoDialogNode explaining the six main
steps of the digitizing workflow: load video, set up coordinate system,
calibrate scale, add a track, digitize frame by frame, and auto-track.

- InfoDialogNode.ts: new Panel-based modal with title, separator,
  step-by-step instructions, and a CloseButton
- SimScreenView.ts: wires the info button + dialog; positions both in
  the visibleBoundsProperty link so they track the actual visible area
- StringManager.ts: adds getInfoDialog() accessor
- strings_en.json / strings_fr.json: adds infoDialog string group
  (title + 6 step title/body pairs) in both languages

https://claude.ai/code/session_019asowJWZYPgvgsefumiFmG
Replace the hand-rolled '?' RectangularPushButton with the standard
InfoButton (RoundPushButton with circle-i icon) from scenerystack/scenery-phet,
and replace the custom Panel-based InfoDialogNode with a proper Dialog
subclass from scenerystack/sun.

Key changes:
- InfoDialogNode now extends Dialog; title passed as option, built-in
  CloseButton replaces the manual one, Panel/Rectangle/separator removed
- SimScreenView: imports InfoButton instead of ButtonNode/RectangularPushButton;
  listener calls infoDialogNode.show() — Dialog uses phet.joist.sim's popup
  layer so no addChild or manual positioning needed
- Removed now-unused imports: Text, PhetFont, ButtonNode, RectangularPushButton,
  TrackLabColors, BUTTON_X_MARGIN, BUTTON_Y_MARGIN from SimScreenView

https://claude.ai/code/session_019asowJWZYPgvgsefumiFmG
…oButton

Dialog is not exported from any scenerystack barrel (sun, sim, joist) in
v3.0.0, so the previous commit's Dialog subclass caused a TS2305 error.

Revert InfoDialogNode to its working Panel+Node approach (CloseButton,
manual header layout, visibility toggle). Keep InfoButton from
scenerystack/scenery-phet, which IS publicly exported and replaces the
hand-rolled RectangularPushButton with the standard ⓘ icon button.

Also restore the infoDialogNode positioning inside visibleBoundsProperty.link
and the this.addChild(infoDialogNode) call, both required by the Node-based
visibility approach.

https://claude.ai/code/session_019asowJWZYPgvgsefumiFmG
Auto-formatted by Biome after first npm install in this environment.
All changes are whitespace/line-length only — no logic changes.

https://claude.ai/code/session_019asowJWZYPgvgsefumiFmG
@veillette
veillette merged commit f94db64 into main Feb 23, 2026
1 check passed
@veillette
veillette deleted the claude/add-info-button-modal-aJPBv branch February 23, 2026 16:08
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.

2 participants