-
Notifications
You must be signed in to change notification settings - Fork 57
Open
Labels
Description
User story
As a user viewing a historical snapshot, I can quickly return to the latest version to resume editing.
Details
Display button to switch from snapshot view back to latest version. Currently implemented at edit.ex:154-164.
Current behavior:
- Only visible when viewing snapshot (
snapshot_version_tag != "latest"
) - Primary theme button with text "Switch to latest version"
- Triggers
switch-version
event withtype: "commit"
- Positioned with right margin (mr-4) before action controls
Implementation notes
- Event handler at
handle_event("switch-version", %{"type" => "commit"}, socket)
line 1709 - Calls
commit_latest_version/1
function (line 2726) which:- Loads workflow's latest snapshot by
lock_version
- Updates workflow, snapshot, and params assigns
- Removes query params:
method
,w-chat
,j-chat
- Redirects to latest version URL
- Loads workflow's latest snapshot by
- Button ID follows pattern:
version-switcher-button-#{workflow.id}
- Depends on Workflow Editor Header: Core layout and breadcrumb container #3624
Release notes
N/A - Internal refactor maintaining existing functionality
User acceptance criteria
- Button appears only when viewing snapshots
- Button hidden when viewing latest version
- Clicking button loads latest workflow version
- URL updates to remove version parameter
- Selected entities remain selected if still present in latest version
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
New Issues