-
Notifications
You must be signed in to change notification settings - Fork 395
fix: improve template URL loading UX and prevent re-triggering #6593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Move template URL loading logic from GraphView.onGraphReady to useWorkflowPersistence.restorePreviousWorkflow. This ensures templates load immediately after the saved workflow, eliminating the janky UX where the previous graph loads, lags, then gets replaced by the template. Workflow preservation: - Saved workflow loads first and opens as a background tab - Template then loads and becomes the active tab - Both tabs remain open - user can switch back to previous work - localStorage updates to template (active workflow) but old tab persists Benefits: - Clean loading UX - no flashing between workflows - Preserves user work - old workflow stays as open tab - Earlier in lifecycle - loads during GraphCanvas mount, not after ready - Matches existing template dialog behavior Changes: - Restore localStorage workflow first (background tab) - Then load template (active tab) if query param present - Remove template loading from GraphView onGraphReady handler - Tests pass (12/12)
After loading template from URL query params, remove them from the URL to prevent the template from loading again on page refresh. Changes: - Remove template and source params from URL after successful load - Remove params even on error to prevent retry loops - Use router.replace to update URL without navigation - Add 3 tests for URL cleanup behavior (15/15 tests passing)
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 11/05/2025, 07:49:14 AM UTC 🔗 Links🎉 Your Storybook is ready for review! |
🎭 Playwright Test Results❌ Some tests failed ⏰ Completed at: 11/05/2025, 08:24:01 AM UTC 📈 Summary
📊 Test Reports by Browser
🎉 Click on the links above to view detailed test results for each browser configuration. |
Bundle Size ReportSummary
Category Glance Per-category breakdownApp Entry Points — 3.31 MB (baseline 3.31 MB) • ⚪ 0 BMain entry bundles and manifests
Status: 3 added / 3 removed Graph Workspace — 729 kB (baseline 729 kB) • 🔴 +608 BGraph editor runtime, canvas, workflow orchestration
Status: 1 added / 1 removed Views & Navigation — 8.18 kB (baseline 8.18 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 1 added / 1 removed Panels & Settings — 293 kB (baseline 293 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 6 added / 6 removed UI Components — 12.6 kB (baseline 12.6 kB) • ⚪ 0 BReusable component library chunks
Status: 1 added / 1 removed Data & Services — 10.4 kB (baseline 10.4 kB) • ⚪ 0 BStores, services, APIs, and repositories
Status: 1 added / 1 removed Utilities & Hooks — 1.07 kB (baseline 1.07 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Vendor & Third-Party — 5.32 MB (baseline 5.32 MB) • ⚪ 0 BExternal libraries and shared vendor chunks
Other — 2.55 MB (baseline 2.55 MB) • ⚪ 0 BBundles that do not match a named category
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels wrong because the logic doesn't seem to belong in a function named restorePreviousWorkflow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about loadWorkflowFromSource?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. I'll refactor into a workflowSources array and change the loader/initializer to be more generic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can just remove this or majorly refactor it.
Fixes the janky UX when loading templates via URL query parameters by moving the loading logic earlier in the app lifecycle (from GraphView.onGraphReady to useWorkflowPersistence.restorePreviousWorkflow). The saved workflow now loads first as a background tab, then the template loads as the active tab, eliminating the visual flash where the saved workflow briefly appears before being replaced. After loading, the template and source query parameters are removed from the URL using router.replace to prevent the template from re-loading on page refresh. This preserves user work by keeping both workflows open in separate tabs and matches the existing behavior when clicking templates from the dialog. All 15 tests pass including 3 new tests for URL cleanup.
┆Issue is synchronized with this Notion page by Unito