Skip to content

fix(mobile): unbreak main after the speed batch (review test, page budget) - #39094

Merged
AmoabaKelvin merged 4 commits into
mainfrom
fix-diff-review-test-query-client
Nov 6, 2026
Merged

AmoabaKelvin merged 4 commits into
mainfrom
fix-diff-review-test-query-client

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

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.

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)

@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

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: Passed 5

Check name Status Explanation
Title check Passed The title identifies the mobile test and bundle budget fixes.
Description check Passed 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 Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed 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.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3eab0fc1-e9f9-4dc7-9b99-101cf7e28a2f
Commits

Reviewing files that changed from the base of the PR and between 2bf39ac and 8ab77fb.

Files selected for processing: 1

  • src/main/runtime/rpc/terminal-subscribe-output-credit.test.ts

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
AmoabaKelvin force-pushed the fix-diff-review-test-query-client branch from c66ad41 to e4d577e Compare November 6, 2026 17:15
@AmoabaKelvin 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
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.

1 participant