Repository navigation
Conversation
Four mobile route files carried byte-identical copies of firstRouteParam, and app shortcuts kept a looser variant whose caller trimmed and rejected blank ids itself. Move the parser to lib/routeParams and import it everywhere. Every caller returns the same result as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This consolidates mobile route-parameter parsing while preserving existing screen and shortcut behavior. The refactor introduces no product-default changes or new operational exposure. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Note Written by Merged current main into this branch without rebasing. Resolved the ThreadRouteScreen conflict by preserving main's inspector cleanup and the shared route-param parser. The diff remains seven files, 19 additions and 28 deletions. Blacksmith verification passed: Native device interaction remains unverified. This is a behavior-preserving parser refactor with no visual changes. |
Main changed the imports in use-thread-selection and the fallback layout in ThreadRouteScreen. Both keep main's code and drop only their private firstRouteParam copy in favor of the shared helper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Note 🤖 Opus 5.5 replying on behalf of Victor. Merged current main into this branch to clear the conflict: merge commit 59c39a7, no rebase. Main had changed the imports in Main still had all five private copies, and no new copy has appeared since. The 18-input comparison ran again against main's current copies and |
|
Note 🤖 Opus 5.5 replying on behalf of Victor. Closing this: it is not a bug fix, and this repository now takes only bug fixes from outside contributors. The branch stays on my fork if it is useful. |
Problem
Four mobile files each kept their own identical copy of
firstRouteParam: thread, files, terminal and thread selection. App shortcuts kept a looser variant whose caller trimmed and rejected blank ids itself. Small parsers copied like this tend to drift apart, and the shortcut variant already had.Change
firstRouteParamnow lives once inapps/mobile/src/lib/routeParams.ts, and all five files import it. It is the existing body unchanged: it takes the first value, treats a blank one as missing and returns a present one untrimmed.Every caller gets the same result as before:
activeThreadRefstill trims the result and rejects empty ids. A blank id is now rejected inside the helper rather than by the caller. Anullparam, which the old variant passed through, now throws inside the helper.activeThreadRef's existingtry/catchreturnsnullfor it, the same as for the other malformed values it already handles.useOpenPullRequesthas a similar inline parser, but it is left alone. It returnsundefinedand toleratesnullduring render without atry/catch, so switching it over could change behavior. The other inline first-value helpers in mobile let blank values through, so they are not copies of this one.Scope and approval
Maintenance only, with no product behavior or route changes, so it needs no prior issue or discussion. Maintainers: please confirm you want the shared helper in
apps/mobile/src/lib. It is mobile-only because thestring | string[]param shape comes from mobile navigation.No screen changes, because every call site returns the same value as before.
Verification
vp test run src/features/shortcuts/appShortcuts.test.ts src/dependency-graph.test.tsinapps/mobile: 2 files, 10 tests passed. TheactiveThreadRefmalformed-params table gained anullrow. A new case checks that a valid scalar or array param still gives the trimmed first value.vp run check:changed 1d626d02d9: format, lint, knip, typecheck (2 packages), tests and React Compiler all passed.null, empty, whitespace, padded strings, empty and blank arrays, multi-value arrays and non-string values. It checked results at both the route-screen level and theactiveThreadReflevel, and found 0 differences.Not checked: a run on an iOS or Android device, since no screen changes.
Prior PRs
None found for this change. A search for
firstRouteParamacross open and closed PRs returned nothing. Open PRs that touch these files do not change the parser lines.Generated with Claude Opus 5.5 and GPT-6.1 Sol in T3 Code Nightly