You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(mobile): unbreak main after the speed batch (review test, page budget) - #39094
Main is red three ways after the mobile speed batch landed: one test renders a hook without the query client it now needs, the page code is about 9.5 KB over its 9.5 MiB size fence, and the page is now split into one more file than its file-count fence allows. This wraps the test like its neighbour, raises the size fence to 9.75 MiB, and re-measures the file-count fence.
Files
Added
Deleted
Net
Test
2
$\color{#1a7f37}{\Huge{\mathbf{+}}}$2
$\color{#cf222e}{\Huge{\mathbf{−}}}$2
0
Prod
1
$\color{#1a7f37}{\Huge{\mathbf{+}}}$14
$\color{#cf222e}{\Huge{\mathbf{−}}}$14
0
What Changed
config/scripts/build/mobile-web-app/verify-mobile-web-app-bundle.mjs: MOBILE_WEB_APP_BUNDLE_MAX_TOTAL_BYTES 9.5 → 9.75 MiB. Still under the phone's 10 MiB per-asset contract the fence exists to stay inside.
mobile/src/session/use-mobile-diff-review-controller.test.ts: the "keeps an unsaved note across reopen and edits" case now renders StageProbe through queries.wrap(...), like the stage case above it.
config/scripts/build/mobile-web-app/verify-mobile-web-app-bundle.mjs: MOBILE_WEB_APP_BUNDLE_SCRIPT_SWEEP re-measured by building each sorted route prefix (routes.slice(0, n), locale catalogs excluded), the way test(mobile): the web app's script fence is re-derived from a measured sweep (OTA phase C, C7.8) #22152 measured it. The full tree goes from 118 to 123 chunks; the other rows move by 0 to 3. The margin stays at 4, so the chunk ceiling is 127 and the asset ceiling is 208 for 17 routes, 70 images and 10 catalogs, well inside the shell's 256.
src/main/runtime/rpc/terminal-subscribe-output-credit.test.ts: import TERMINAL_METHODS from ./methods/terminal/terminal after the terminal RPC module move. Same one-line fix as community PR fix(test): follow the terminal RPC module move #39097 by its author; included here so main goes green in one merge.
Why
#38917 added the test and #38988 made useMobileSourceControlSettings call useQueryClient(). Each was green alone; together the test throws "No QueryClient set" (Mobile Checks on main since 489a6a66a). Separately, the batch merges together put the page code at 9,971,239 bytes against the 9,961,472 fence, so every PR fails "mobile web app bundle" (main's own workflow doesn't run that check). Kelvin chose to raise the fence now and win the headroom back in a follow-up trim (TanStack is the likely largest addition).
The same batch also moved the chunk count. Against a build at the commit that last set the sweep, the full tree went from 119 to 123 chunks, and the old table plus its margin allowed 122. So the job failed with "204 assets, over the Phase C budget of 203". New chunks: TanStack (@tanstack/query-core + react-query, 33 KB) is its own chunk now, plus small split-outs for host-query-errors, app-version, a bottom-drawer piece, a shell-bridge module and a worktree-catalog group. The markdown-it and highlight.js chunks merged into one with KaTeX's parsers. The fence comment asks for a fresh sweep when the tree changes rather than a bigger margin, so the table is re-measured and the margin is left alone.
Linked Issue
None. Fixes red main.
Visual Proof
N/A, test-only.
Testing
cd mobile && vitest run src/session/use-mobile-diff-review-controller.test.ts: 5/5 pass (the case failed with "No QueryClient set" before). pnpm build:mobile-web passes on this head: 123 chunks, 204 of 208 assets, 9,971,239 of 10,223,616 bytes excluding the font. pnpm check:changed passes.
Risk
None for users; test-only. The budget raise allows ~250 KB more page code before the fence trips again; a follow-up PR will measure what grew and trim. Back out by reverting.
AI Disclosure
Review
Self-reviewed. Test fix matches the existing pattern in the same file; budget value chosen by Kelvin.
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Notes
Found while landing the mobile speed batch.
Checklist
This PR is small and focused
I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
I stated the risk: what could break, for whom, and how to back it out
Before/after screenshots or videos attached for UI changes, or N/A with reason
Self-reviewed for correctness, security, and performance
Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)
No actionable comments were generated in the recent review.
Walkthrough
The unsaved-note persistence test now mounts StageProbe through queries.wrap when creating the renderer. The mobile web app bundle verification limit increases from 9.5 MiB to 9.75 MiB. Recorded script counts increase for all listed route prefixes and continue to feed the existing route-script spread and maximum-chunk calculation. The terminal output credit test imports TERMINAL_METHODS from ./methods/terminal/terminal instead of ./methods/terminal.
Merge Risk: Minimal · up to 8ab77
The bundle has more headroom and the test setups are updated. No actionable merge-blocking risk is identified.
Pre-merge checks: 5
Check name
Status
Explanation
Title check
The title identifies the mobile test and bundle budget fixes.
Description check
The description is mostly complete. It explains the changes, reasons, tests, and rollback. It should identify the tested platforms and risk level, and clarify that the budget increase can affect perfo…
Docstring Coverage
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Description check
Explanation
The description is mostly complete. It explains the changes, reasons, tests, and rollback. It should identify the tested platforms and risk level, and clarify that the budget increase can affect performance safeguards. An outside contributor must link an issue.
Full details: Docstring Coverage
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 3 files.
Finishing Touches
Generate docstrings
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
AmoabaKelvin
changed the title
test(mobile): give the review note test a query client
fix(mobile): unbreak main after the speed batch (review test, page budget)
Nov 6, 2026
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
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.
ELI5
Main is red three ways after the mobile speed batch landed: one test renders a hook without the query client it now needs, the page code is about 9.5 KB over its 9.5 MiB size fence, and the page is now split into one more file than its file-count fence allows. This wraps the test like its neighbour, raises the size fence to 9.75 MiB, and re-measures the file-count fence.
What Changed
config/scripts/build/mobile-web-app/verify-mobile-web-app-bundle.mjs:MOBILE_WEB_APP_BUNDLE_MAX_TOTAL_BYTES9.5 → 9.75 MiB. Still under the phone's 10 MiB per-asset contract the fence exists to stay inside.mobile/src/session/use-mobile-diff-review-controller.test.ts: the "keeps an unsaved note across reopen and edits" case now rendersStageProbethroughqueries.wrap(...), like the stage case above it.config/scripts/build/mobile-web-app/verify-mobile-web-app-bundle.mjs:MOBILE_WEB_APP_BUNDLE_SCRIPT_SWEEPre-measured by building each sorted route prefix (routes.slice(0, n), locale catalogs excluded), the way test(mobile): the web app's script fence is re-derived from a measured sweep (OTA phase C, C7.8) #22152 measured it. The full tree goes from 118 to 123 chunks; the other rows move by 0 to 3. The margin stays at 4, so the chunk ceiling is 127 and the asset ceiling is 208 for 17 routes, 70 images and 10 catalogs, well inside the shell's 256.src/main/runtime/rpc/terminal-subscribe-output-credit.test.ts: importTERMINAL_METHODSfrom./methods/terminal/terminalafter the terminal RPC module move. Same one-line fix as community PR fix(test): follow the terminal RPC module move #39097 by its author; included here so main goes green in one merge.Why
#38917 added the test and #38988 made
useMobileSourceControlSettingscalluseQueryClient(). Each was green alone; together the test throws "No QueryClient set" (Mobile Checks on main since489a6a66a). Separately, the batch merges together put the page code at 9,971,239 bytes against the 9,961,472 fence, so every PR fails "mobile web app bundle" (main's own workflow doesn't run that check). Kelvin chose to raise the fence now and win the headroom back in a follow-up trim (TanStack is the likely largest addition).The same batch also moved the chunk count. Against a build at the commit that last set the sweep, the full tree went from 119 to 123 chunks, and the old table plus its margin allowed 122. So the job failed with "204 assets, over the Phase C budget of 203". New chunks: TanStack (
@tanstack/query-core+react-query, 33 KB) is its own chunk now, plus small split-outs forhost-query-errors,app-version, a bottom-drawer piece, a shell-bridge module and a worktree-catalog group. The markdown-it and highlight.js chunks merged into one with KaTeX's parsers. The fence comment asks for a fresh sweep when the tree changes rather than a bigger margin, so the table is re-measured and the margin is left alone.Linked Issue
None. Fixes red main.
Visual Proof
N/A, test-only.
Testing
cd mobile && vitest run src/session/use-mobile-diff-review-controller.test.ts: 5/5 pass (the case failed with "No QueryClient set" before).pnpm build:mobile-webpasses on this head: 123 chunks, 204 of 208 assets, 9,971,239 of 10,223,616 bytes excluding the font.pnpm check:changedpasses.Risk
None for users; test-only. The budget raise allows ~250 KB more page code before the fence trips again; a follow-up PR will measure what grew and trim. Back out by reverting.
AI Disclosure
Review
Self-reviewed. Test fix matches the existing pattern in the same file; budget value chosen by Kelvin.
Agent skill upstream boundary
Notes
Found while landing the mobile speed batch.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)