Fix double resolve() in route-for utilities#3206
Merged
laurakwhit merged 3 commits intocodefreeze-03.02.26from Mar 2, 2026
Merged
Fix double resolve() in route-for utilities#3206laurakwhit merged 3 commits intocodefreeze-03.02.26from
laurakwhit merged 3 commits intocodefreeze-03.02.26from
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Alex-Tideman
approved these changes
Mar 2, 2026
3 tasks
Alex-Tideman
added a commit
that referenced
this pull request
Mar 9, 2026
* Fix double resolve() in route-for utilities (#3206) * Remove double resolve from routeFor fns * Add gotoResolved to fix eslint error and keep type safety * Turn off svelte/no-navigation-without-resolve rule * Omc gitignore (#3207) * Add .omc to gitignore * Remove full .omc directory * Add initial timestamp values into hour/minute/second inputs (#3212) * Fix timestamp filter inputs not pre-filling with previous values Parse the existing filter ISO value back into date/time components when reopening a datetime filter chip. Also initialize the "add new filter" datetime inputs from persisted stores. * Extract datetime filter parsing into utility with unit tests Move getInitialStart/getInitialEnd into a shared utility file and add 12 unit tests covering single datetime, BETWEEN ranges, timezone conversion, and edge cases. * Make timezone and initial datetime values reactive with $derived * Refactor to use consolidated start/end objects and account for timezone changes --------- Co-authored-by: Laura Whitaker <laura.whitaker@temporal.io> --------- Co-authored-by: Laura Whitaker <laura.whitaker@temporal.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description & motivation 💭
PR #3125 (ESLint v9 upgrade) added
resolve()calls to many routeFor* functions. Functions that compose other routeFor* functions ended up callingresolve()multiple times resulting in the base path being prepended multiple times. For example,routeForWorkflows()calledresolve(routeForNamespace(...))which double-resolved to/{base_path)/{base_path)/namespaces/default/workflows.This PR fixes this by:
resolve()again.AddinggotoResolved()utility that creates a type-safe wrapper aroundgoto()that accepts onlyResolvedRoutevalues, centralizing the eslint-disable forsvelte/no-navigation-without-resolvein one place.Adding brandedResolvedRoutetype to replace SvelteKit'sResolvedPathname(which is juststring) with a branded type that TypeScript enforces at compile time, preventing raw strings from being passed where a resolved route is expected ingotoResolved().exactly once. An additional test automatically fails if a new routeFor* function is added without a corresponding test case.
Screenshots (if applicable) 📸
Design Considerations 🎨
Testing 🧪
How was this tested 👻
Steps for others to test: 🚶🏽♂️🚶🏽♀️
pnpm test src/lib/utilities/route-for-base-path.test.tsRun the following ⬇️
Then go to http://localhost:5252/custom-path/namespaces/default and navigate to different links (e.g.
/workflows)./custom-pathdoes not appear twice in the URL and links work as expectedChecklists
Draft Checklist
Merge Checklist
Issue(s) closed
Related Slack thread.
Docs
Any docs updates needed?