fix(web): stabilize stack builder URL state - #1129
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
3e08804 to
a2c28d5
Compare
WalkthroughThe stack builder now applies compatibility-adjusted stacks to commands and technology displays. URL state sanitization and setters use memoized callbacks. Compatibility tests cover Nuxt, Expo, oRPC, retained selections, removal fallbacks, and combined frontend output. The web app updates its ChangesStack builder behavior
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 5e0debbd-6092-4f65-8389-23bca475e739
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (5)
apps/web/package.jsonapps/web/src/app/(home)/new/_components/stack-builder/index.tsxapps/web/src/app/(home)/new/_components/stack-builder/use-stack-builder.tsapps/web/src/lib/stack-url-state.client.tsapps/web/test/stack-builder-compatibility.test.ts
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3e08804e8f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
🧹 Nitpick comments (1)
apps/web/src/app/(home)/new/_components/stack-builder/use-stack-builder.ts (1)
157-160: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winStabilize the compatibility analysis used by this memoized command.
analyzeStackCompatibility(stack)creates newadjustedStackandchangesobjects on every render. When compatibility changes exist, unrelated state updates rerun this memo and the compatibility effect. Memoize the analysis bystack.Suggested change
- const compatibilityAnalysis = analyzeStackCompatibility(stack); + const compatibilityAnalysis = useMemo( + () => analyzeStackCompatibility(stack), + [stack], + );
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 85e9c38a-2522-4a7f-a9ac-e983560ba868
📒 Files selected for processing (2)
apps/web/src/app/(home)/new/_components/stack-builder/use-stack-builder.tsapps/web/test/stack-builder-compatibility.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- apps/web/test/stack-builder-compatibility.test.ts
Summary
nuqsfrom 2.9.2 to 2.9.4 for the upstream concurrent-rebase fixesuseQueryStatesfunctional updater so rapid selections merge against current URL stateRoot cause
The stack builder wrapper evaluated functional updates against a render-captured stack instead of passing them through to
useQueryStates. When a selection triggered a compatibility adjustment, concurrent URL updates could overwrite a following selection. The unstable sanitized state also retriggered the command synchronization effect until React reportedMaximum update depth exceeded. The sidebar rendered the temporary invalid state and its compatibility log before the canonical URL state landed, causing the visible flicker.Impact
Nuxt and Expo can be selected together again. Frontend and other compatibility-driven selections no longer flicker, lose subsequent clicks, or trigger a React update loop.
Verification
bun build:webbun test apps/web/test/stack-builder-compatibility.test.ts apps/web/test/stack-compatibility-invariant.test.ts(26 passing)oxlintandgit diff --checkSummary by CodeRabbit
New Features
Bug Fixes
Tests