Skip to content

chore(mobile): enable noUncheckedIndexedAccess and noImplicitOverride - #11538

Merged
juliusmarminge merged 1 commit into
mainfrom
fix/mobile-tsconfig-strictness
Sep 13, 2026
Merged

chore(mobile): enable noUncheckedIndexedAccess and noImplicitOverride#11538
juliusmarminge merged 1 commit into
mainfrom
fix/mobile-tsconfig-strictness

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Sep 13, 2026

Copy link
Copy Markdown
Member

Follow-up to #11537. apps/mobile/tsconfig.json extends Expo's base config rather than the repo's tsconfig.base.json, so it never had noUncheckedIndexedAccess. That is what let projectsForEnvironment[0] ?? null type as non-null in NewTaskFlowProvider and pass a null project into resolveProjectSettings without a compile error — the crash on every launch of build 56.

This turns on noUncheckedIndexedAccess and noImplicitOverride for mobile and fixes the 87 sites they flag:

  • MobileThemeVariable is now the closed key set that createMobileThemeVariables writes (verified: identical to the 75 keys in generated-uniwind-default-theme-variables.json and every --color-* read in src//modules/), so theme["--color-x"] is string and a misspelled key is a compile error rather than undefined at runtime.
  • TerminalTheme.palette is a 16-tuple, matching the 16 ANSI entries both built-in themes define.
  • BUILT_IN_THEMES[0] fallbacks use the exported T3_CHAT_THEME.
  • The remaining sites are regex capture groups, list fallbacks, a heading-size lookup, and test fixtures.

exactOptionalPropertyTypes is deliberately left off: it flags ~300 sites, almost all React Native style/prop objects, and does not bear on this class of bug. noImplicitOverride had zero fallout.

Verification

tsc --noEmit -p apps/mobile/tsconfig.json: 87 errors with the flags on main, 0 here. vp test run on the touched test files (mobileTheme, reviewModel, nativeReviewDiffAdapter, terminalTheme, wideMarkdownBlocks): 46 passing. node scripts/generate-uniwind-themes.mts produces byte-identical generated CSS/JSON. No behavior change intended.

Claude Fable 5 via Claude Code.


Devin Review

Summary by CodeRabbit

  • Bug Fixes

    • Improved reliability when displaying markdown headings, nested lists, review differences, and theme colors in edge cases.
    • Unknown terminal or mobile theme selections now use the T3 Chat theme as a consistent fallback.
    • Prevented potential errors when theme values or indexed content are unavailable.
  • Refactor

    • Improved theme color handling and validation for more consistent appearance across light and dark modes.
  • Tests

    • Updated theme and review coverage to reflect the new fallback behavior.

apps/mobile extends Expo's tsconfig, not the repo base, so it never had the
repo's index-access strictness. That gap let `projects[0] ?? null` type as
non-null and hid the null project that crashed every launch of build 56.

Turn the two flags on and fix the 87 sites they flag. Most were theme
lookups: MobileThemeVariable is now the closed key set that
createMobileThemeVariables writes, and the terminal palette is a 16-tuple,
so indexed reads stay string without per-site assertions. The rest are
regex captures, list fallbacks, and test fixtures.

exactOptionalPropertyTypes is left off: it flags ~300 sites, mostly React
Native prop objects, and does not bear on this class of bug.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@cursor

cursor Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). 📱 Native Change Changes the native fingerprint; merging blocks production OTAs until a new store build ships. labels Sep 13, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 9fa5922

Macroscope's review found this PR approvable — This PR primarily enables stricter TypeScript checks and updates affected indexed accesses, with tests and build-script adjustments alongside it. The reviewed runtime edits preserve existing behavior, including the explicitly named theme fallback matching the prior default.

You can add or adjust custom eligibility rules. Learn more.

@github-actions

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 13.6 KiB 13.6 KiB +60 B (+0.4%) 15.1 KiB
Codex Thread snapshot wire 7.0 KiB 7.0 KiB −4 B (−0.1%) 7.3 KiB
Codex Live turn WebSocket wire 6.5 KiB 6.6 KiB +64 B (+1.0%) 7.8 KiB
Codex Live turn WebSocket decoded 57.0 KiB 57.1 KiB +88 B (+0.2%) 66.4 KiB
Codex Live turn messages 8 10 +2 (+25.0%) 21
Claude Total thread wire 13.6 KiB 13.6 KiB −35 B (−0.3%) 15.1 KiB
Claude Thread snapshot wire 7.1 KiB 7.1 KiB +1 B (+0.0%) 7.3 KiB
Claude Live turn WebSocket wire 6.6 KiB 6.5 KiB −36 B (−0.5%) 7.8 KiB
Claude Live turn WebSocket decoded 57.9 KiB 57.8 KiB −44 B (−0.1%) 66.4 KiB
Claude Live turn messages 10 9 −1 (−10.0%) 21

Baseline: db6e053 · PR result: 9fa5922 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 113.9 KiB
  • Claude decoded thread snapshot: 114.6 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: c37ee951-c3b2-4eb9-ba63-be6cf1e05acc

📥 Commits

Reviewing files that changed from the base of the PR and between db6e053 and 9fa5922.

📒 Files selected for processing (11)
  • apps/mobile/modules/t3-markdown-text/src/NativeMarkdownSelectableText.tsx
  • apps/mobile/scripts/generate-uniwind-themes.mts
  • apps/mobile/src/components/AndroidAnchoredMenu.tsx
  • apps/mobile/src/features/review/nativeReviewDiffAdapter.ts
  • apps/mobile/src/features/review/reviewModel.test.ts
  • apps/mobile/src/features/terminal/terminalTheme.ts
  • apps/mobile/src/lib/mobileTheme.test-support.ts
  • apps/mobile/src/lib/mobileTheme.test.ts
  • apps/mobile/src/lib/mobileTheme.ts
  • apps/mobile/src/lib/wideMarkdownBlocks.ts
  • apps/mobile/tsconfig.json

Included review availability: 8 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 10 reviews per hour.


📝 Walkthrough

Walkthrough

The mobile changes tighten TypeScript checks, strengthen theme and palette typing, use T3_CHAT_THEME for fallbacks, and add guards for missing indexed values and parser captures.

Changes

Mobile hardening

Layer / File(s) Summary
Theme contracts and fallback behavior
apps/mobile/tsconfig.json, apps/mobile/scripts/generate-uniwind-themes.mts, apps/mobile/src/features/terminal/terminalTheme.ts, apps/mobile/src/lib/mobileTheme.ts, apps/mobile/src/lib/mobileTheme.test.ts, apps/mobile/src/lib/mobileTheme.test-support.ts
Theme palettes use fixed tuple types. Mobile theme variables use keys derived from generated variables. Unknown theme IDs and preview colors fall back to T3_CHAT_THEME. Theme tests use the same fallback theme.
Indexed-access and parsing guards
apps/mobile/modules/t3-markdown-text/src/NativeMarkdownSelectableText.tsx, apps/mobile/src/components/AndroidAnchoredMenu.tsx, apps/mobile/src/features/review/nativeReviewDiffAdapter.ts, apps/mobile/src/features/review/reviewModel.test.ts, apps/mobile/src/lib/wideMarkdownBlocks.ts
Missing heading sizes, color channels, diff rows, and regex captures now receive safe handling. Submenu parent selection keeps its existing null fallback. Test checkpoint indexing uses non-null assertions.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Refactor

Suggested reviewers: chrisdeeming

Merge Risk: ⚪ Minimal · up to 9fa59

No actionable behavioral regression was identified in the mobile hardening changes.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 13.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 15 functions across 10 files. (1 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change: enabling noUncheckedIndexedAccess and noImplicitOverride for mobile TypeScript configuration.
Description check ✅ Passed The description explains what changed, why it changed, the scope of the fixes, and verification results. The UI Changes and Checklist sections are not explicitly included, but no UI changes are descri…
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: Docstring Coverage

Explanation

Docstring coverage is 13.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 15 functions across 10 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/mobile-tsconfig-strictness

Comment @coderabbitai help to get the list of available commands.

@juliusmarminge
juliusmarminge merged commit 20a8f1d into main Sep 13, 2026
22 checks passed
@juliusmarminge
juliusmarminge deleted the fix/mobile-tsconfig-strictness branch September 13, 2026 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📱 Native Change Changes the native fingerprint; merging blocks production OTAs until a new store build ships. size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant