Skip to content

Make Timeline/Event History and sort order preferences sticky#3252

Closed
rossnelson wants to merge 1 commit intomainfrom
feat/dt-3709-sticky-view-preferences
Closed

Make Timeline/Event History and sort order preferences sticky#3252
rossnelson wants to merge 1 commit intomainfrom
feat/dt-3709-sticky-view-preferences

Conversation

@rossnelson
Copy link
Copy Markdown
Collaborator

Summary

  • Persist user's Timeline vs Event History tab preference in localStorage via preferredWorkflowTab persistStore
  • When navigating to a new workflow, redirect to the user's preferred tab instead of always defaulting to Timeline
  • Fall back to stored sort preference (asc/desc) when no ?sort= URL param is present, instead of always defaulting to descending
  • URL params still take precedence over stored preferences

Changes

File Change
src/lib/stores/event-view.ts Add preferredWorkflowTab persistStore
src/routes/.../[run]/+page.ts Read stored tab for redirect
src/lib/layouts/workflow-header.svelte $effect persists tab on navigation
src/lib/utilities/event-filter-params.ts Sort falls back to stored preference

Test plan

  • pnpm check — 0 errors
  • pnpm lint — 0 new errors
  • pnpm test -- --run — 1671 tests passed
  • Manual: click History tab → navigate to different workflow → lands on History
  • Manual: click Timeline tab → navigate to different workflow → lands on Timeline
  • Manual: set Ascending sort → navigate to different workflow → sort is Ascending
  • Manual: direct URL with ?sort=ascending overrides stored preference

Closes DT-3709

Persist user preferences for workflow view tab and sort order in
localStorage so they carry across workflow navigations.

- Add preferredWorkflowTab persistStore (timeline/history)
- Read stored tab preference in [run]/+page.ts redirect
- Persist tab choice via $effect in workflow-header
- Fall back to stored sort preference when no ?sort= URL param

DT-3709
@rossnelson rossnelson requested review from a team and Alex-Tideman as code owners March 25, 2026 17:15
@temporal-cicd
Copy link
Copy Markdown
Contributor

temporal-cicd bot commented Mar 25, 2026

Warnings
⚠️

📊 Strict Mode: 9 errors in 1 file (0.8% of 1080 total)

src/lib/layouts/workflow-header.svelte (9)
  • L147:37: Argument of type 'WorkflowExecution | null' is not assignable to parameter of type 'WorkflowExecution'.
  • L148:45: Argument of type 'WorkflowExecution | null' is not assignable to parameter of type 'WorkflowExecution'.
  • L153:13: Type 'WorkflowExecution | null' is not assignable to type 'WorkflowExecution'.
  • L179:9: Type 'WorkflowExecution | null' is not assignable to type 'WorkflowExecution'.
  • L187:20: Type 'WorkflowExecution | null' is not assignable to type 'WorkflowExecution'.
  • L244:12: Type 'string | undefined' is not assignable to type 'string'.
  • L279:11: 'workflow' is possibly 'null'.
  • L321:12: 'workflow' is possibly 'null'.
  • L321:12: 'workflow.searchAttributes' is possibly 'undefined'.

Generated by 🚫 dangerJS against 8cd68af

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
holocene Ready Ready Preview, Comment Mar 25, 2026 5:19pm

Request Review

@Alex-Tideman
Copy link
Copy Markdown
Collaborator

Alex-Tideman commented Mar 25, 2026

I think we're going to need to go back to the drawing board on this one.

This doesn't address:

  • click History tab → navigate to different workflow → lands on History

Most links were switched to routeForTimeline so clicking on any of those links won't respect the preference. We need to wrap routeForTimeline and routeForEventHistory with routeForWorkflowTabPreference that checks the tab preference then picks the appropriate route. Or link to /runId and let that layout.ts hand redirect.

We should use the existing eventFilterSort persistStore instead of getPersistedSort. This also currently doesn't let you change your sort order because updateEventFilterParams uses descending as the default sort (no query param, but then gets overridden by getPersistedSort which as ascending

if (filters.sort !== undefined) {
parameters.push({
parameter: 'sort',
value: filters.sort === 'descending' ? undefined : filters.sort,
});
}

@rossnelson
Copy link
Copy Markdown
Collaborator Author

I think we're going to need to go back to the drawing board on this one.

This doesn't address:

  • click History tab → navigate to different workflow → lands on History

Most links were switched to routeForTimeline so clicking on any of those links won't respect the preference. We need to wrap routeForTimeline and routeForEventHistory with routeForWorkflowTabPreference that checks the tab preference then picks the appropriate route. Or link to /runId and let that layout.ts hand redirect.

We should use the existing eventFilterSort persistStore instead of getPersistedSort. This also currently doesn't let you change your sort order because updateEventFilterParams uses descending as the default sort (no query param, but then gets overridden by getPersistedSort which as ascending

if (filters.sort !== undefined) { parameters.push({ parameter: 'sort', value: filters.sort === 'descending' ? undefined : filters.sort, }); }

All good. I just had Claude throw this together. It should have been in draft. I haven’t reviewed it yet. 🫠

@rossnelson rossnelson marked this pull request as draft March 25, 2026 18:18
@laurakwhit
Copy link
Copy Markdown
Collaborator

Closing in favor of #3260.

@laurakwhit laurakwhit closed this Apr 3, 2026
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.

3 participants