Skip to content

Frontend/new session#73

Merged
MaddieWright merged 9 commits intomainfrom
frontend/new-session
Mar 11, 2026
Merged

Frontend/new session#73
MaddieWright merged 9 commits intomainfrom
frontend/new-session

Conversation

@MaddieWright
Copy link
Collaborator

@MaddieWright MaddieWright commented Mar 11, 2026

New session

What?

Added a "New" button to the settings bar that allows users to start a fresh session, with a warning dialog when there are unsaved changes and a success toast when new session is started.


How?

  • Added a New button with a + icon in the settings bar, placed between the session info Menubar and the progress slider.

Clicking "New" either immediately clears the pipeline or shows a warning dialog first, depending on whether the current session has unsaved changes:

  • Unsaved changes (isDirty = true): shows a confirmation dialog warning the user that unsaved changes will be lost
  • No unsaved changes: immediately clears the pipeline without prompting
  • isDirty is tracked by listening to canvas-changed and reactflow-edges-changed custom window events (fired when
  • nodes/edges are added or modified). It resets to false after a successful save or when the user starts a fresh session.

Confirming "New" stops the data stream, resets the timer, clears all nodes and edges via the pipeline-reset event, and sets activeSessionId to null.

Also replaced MenubarTrigger with plain button elements for the "Tutorials" item (and initially "New") to prevent Radix UI's open/closed state from leaving a persistent hover highlight after click.


Testing

  • Confirmed clicking "New" with no changes immediately clears the pipeline (no dialog shown)
  • Confirmed clicking "New" after adding nodes shows the warning dialog
  • Confirmed clicking "Cancel" in the dialog leaves the pipeline intact
  • Confirmed clicking "Confirm" clears all nodes/edges and resets the timer and stream
  • Confirmed isDirty resets after saving, so clicking "New" immediately after a save does not prompt the warning
  • Confirmed "New" button is disabled while a save/load operation is in progress
  • Confirmed no persistent hover highlight on the Tutorials button after fix

@MaddieWright MaddieWright merged commit 2283eb1 into main Mar 11, 2026
1 check failed
@MaddieWright MaddieWright deleted the frontend/new-session branch March 11, 2026 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant