Skip to content

feat(swift-ios): add reliable text and code sizing - #7612

Open
saphid wants to merge 1 commit into
pingdotgg:t3code/rebuild-mobile-app-swiftfrom
saphid:agent/swiftui-text-code-sizes
Open

feat(swift-ios): add reliable text and code sizing#7612
saphid wants to merge 1 commit into
pingdotgg:t3code/rebuild-mobile-app-swiftfrom
saphid:agent/swiftui-text-code-sizes

Conversation

@saphid

@saphid saphid commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

1. Observed problem and reproduction

In the native SwiftUI app, open Settings and look for a way to make prose or code easier to read. The app follows iOS Dynamic Type but has no independent in-app Text and Code controls. Earlier versions of this PR also allowed overlapping saves or a later connection republish to restore settings older than the most recently persisted slider choice.

2. Cause

FeatureSettings had no text/code size preferences, and a root SwiftUI dynamicTypeSize value does not reliably cross sheet hosts or the transcript's UIKit hosting cells. Settings persistence writes full snapshots asynchronously, so rollback must distinguish the last successful snapshot from newer optimistic snapshots. The native client also persisted settings to UserDefaults without refreshing the cached snapshot used during connection republish.

3. What changed and why this boundary

Settings gains one Text & Code section with two stepped sliders and a live preview. Text size shifts the reader's system Dynamic Type category through the window trait used by sheets and UIKit-hosted cells. Code size adds a relative shift only at monospaced leaves: Markdown code blocks, work-log output, command approvals, files, review diffs, and pull-request diffs.

The existing settings owner now serializes full-snapshot writes. Only a successful write advances the rollback point. Settings also serializes slider requests, ignores a stale failed response when a newer choice is visible, and waits for the latest slider save before the Save action completes. NativeFeatureClient now updates its cached snapshot after persistence so a connection republish cannot revive stale settings.

The branch was rebased onto target b67837984e5650888b1eed0e1cd7fff83625f696. Conflict resolution retained upstream's FeatureWorkLogView and thread-settlement invalidation behavior exactly, then applied code sizing within the new work-log component and carried settlement revision updates through this branch's optimistic save and rollback path.

4. Intentionally unchanged and deferred

  • Terminal font sizing remains independent.
  • Web, desktop, and React Native mobile do not change.
  • Providers, server behavior, projections, and wire contracts do not change.
  • Sizes remain relative to iOS Dynamic Type; this does not introduce absolute point-size settings.
  • Other Settings cleanup is out of scope.

5. Affected surfaces

  • Entry point: native SwiftUI Settings → Text & Code.
  • Client/platform: SwiftUI mobile on iOS only.
  • Providers: provider-neutral; Codex, Claude, Cursor, Grok, and OpenCode are unchanged.
  • Contracts/server/projections: unchanged; preferences use existing local settings persistence.
  • Connections: local, remote, relay, and tunnel use the same local preference; reconnect republish now keeps the latest persisted settings.
  • Reverse/failure states: sliders can return to Default; failed current saves roll back to the last durable snapshot; stale failures and stale republished snapshots cannot overwrite newer choices; retry remains available.

6. Validation

Current head: 0eede8d14d22aec0f77f1cf08a90d8bb8aba7346.

  • Rebase result: 0 commits behind and 1 commit ahead of upstream/t3code/rebuild-mobile-app-swift at b67837984e5650888b1eed0e1cd7fff83625f696.
  • Swift frontend parse of all changed Swift files: passed.
  • git diff --check upstream/t3code/rebuild-mobile-app-swift...HEAD: passed.
  • git range-diff verified that upstream's new work-log component and settlement invalidation were retained while this feature was adapted around them.
  • The local focused simulator command for FeatureRootModelTests, TextSizePreferenceTests, and NativeRetryIdentityTests correctly deferred with exit 75 because another active XcodeBuildMCP lease owned the native build lane. No competing lane was disturbed.
  • Exact-head GitHub SwiftUI CI passed 414 tests in 36 suites with 0 failures, including testSavedSettingsSurviveAConnectionRepublish, settlementSettingsInvalidateHomePresentationOnSaveAndRollback, and all text/code-size preference tests.
  • Cross-provider review was skipped because this turn explicitly required the work to be performed without re-delegation. No other provider or model participated.

7. Risks, limitations, and untested paths

  • The window trait affects every native SwiftUI screen, so both light and dark integrated UI proof remain relevant.
  • Remote, relay, and tunnel transport are unchanged and were not separately exercised for this local preference.
  • Exact-head native tests ran in GitHub CI; only a duplicate local simulator run remains unavailable because the active native build lease prevented it.
  • Exact-head UI capture is pending for the same protected native lane; prior-head proof below demonstrates the unchanged interaction but is not relabeled as proof for this rebased head.

8. UI evidence

Historical proof for prior head 019c8b219d6fac4845f76ac06348bdc57446b7f3:

Before — Settings without Text & Code controls, light

Settings before, light

Before — Settings without Text & Code controls, dark

Settings before, dark

Before interaction video

After — Text & Code controls and live preview, light

Settings after, light

After — Text & Code controls and live preview, dark

Settings after, dark

Interaction — change both sliders and verify persistence

Independent slider changes and relaunch persistence video

Known-gaps: exact-head light/dark screenshots and interaction video for 0eede8d14d22aec0f77f1cf08a90d8bb8aba7346 could not be captured because another active XcodeBuildMCP hygiene lease owned the native build/proof lane; that lease was not broken or bypassed.

9. Owning issue and relationship

Feature behavior and phone acceptance: saphid/t3code-personal#129. Failed-predecessor rollback repair: #152. Prior-head proof batch: #150.

This PR targets the live SwiftUI parent branch and remains the same review-history-preserving PR.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for the UI change
  • I included a video for the interaction change

Implemented by GPT-5.6 Sol in the Codex harness.

@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8005f269-1ef4-45a9-b292-7f7a0f0cde32

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XL 500-999 changed lines (additions + deletions). labels Aug 19, 2026
Comment thread apps/swift-ios/Features/Root/FeatureRootModel.swift
@macroscopeapp

macroscopeapp Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR adds a new Text & Code settings workflow and propagates its effects across global text rendering, multiple code surfaces, and UIKit-hosted transcript cells. It also substantially changes settings persistence and rollback behavior, making the overall change broader than a small isolated UI adjustment.

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

Comment thread apps/swift-ios/Features/Root/FeatureRootModel.swift
Comment thread apps/swift-ios/Features/Root/FeatureRootModel.swift
@saphid
saphid force-pushed the agent/swiftui-text-code-sizes branch from e136164 to f3634dc Compare August 26, 2026 23:05
Comment thread apps/swift-ios/Features/Settings/SettingsView.swift
@saphid
saphid force-pushed the agent/swiftui-text-code-sizes branch from f3634dc to 019c8b2 Compare August 27, 2026 04:07
@saphid saphid changed the title feat(swift-ios): add text and code size controls to Settings feat(swift-ios): add reliable text and code sizing Aug 27, 2026
@saphid

saphid commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

Ready for human review on rebuilt current-target head 019c8b219d6fac4845f76ac06348bdc57446b7f3. The vouched 12-item handoff checklist passes: focused native tests are 66/66, exact-base/head simulator proof covers light, dark, independent changes, and relaunch persistence, the in-scope rollback/stale-failure defects are fixed, maintainer edits remain enabled, and the nine-part description/evidence now matches this head. CI triggered by the force-with-lease update is still settling; local affected checks and the exact-head build are green.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 019c8b2. Configure here.

Comment thread apps/swift-ios/Features/Root/FeatureRootModel.swift
@saphid
saphid force-pushed the agent/swiftui-text-code-sizes branch from 019c8b2 to 0eede8d Compare August 28, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 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