Skip to content

perf(mobile): skip unchanged terminal toolbar fade updates - #25312

Merged
Yash-Singh1 merged 3 commits into
pingdotgg:mainfrom
saphid:perf/mobile-toolbar-fades-20261026
Nov 5, 2026
Merged

Yash-Singh1 merged 3 commits into
pingdotgg:mainfrom
saphid:perf/mobile-toolbar-fades-20261026

Conversation

@saphid

@saphid saphid commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Scrolling the mobile terminal accessory schedules React state updates for each accepted horizontal offset even when both edge fades stay the same. React Compiler already caches the ScrollView and its children, but the parent scroller still executes for unchanged fade output.

Change

Keep accepted scroll/layout metrics in an event-only ref and publish state only when a fade flag changes. Retain the existing 1px accepted-offset filter, strict 4px edge comparisons, content/viewport recomputation and native scroll event cadence. Keyboard, modifier buttons, accessibility, layout and scrolling props are unchanged.

Scope and approval

This is a focused redundant-update correction in the existing terminal accessory scroller, with no new setting or product behavior. Only ComposerToolbar.tsx changes. Related #24628 changes terminal toolbar placement and #22161 changes modifier input; their inspected patches do not address fade-state publication.

Verification

  • A dynamic production-compiled React harness executes the actual baseline/candidate component, including React Compiler caches, using native host stand-ins. The baseline optimization assertion fails; candidate passes. For 300 interior scroll events, parent executions and setter calls fall 300→0, while ScrollView/child executions are 0→0. Across 868 events, all 863 observed outputs match per platform, including fractional thresholds, overscroll, resize/content changes, batched events and remounts. iOS and Android Expo production callers compile; execution uses React DOM/jsdom, not native Android.
  • Scoped React Compiler test and CI=true vp run check:changed refs/heads/battery/upstream-main: exit 0. Fresh read-only GPT-6.1 Sol/high review independently reran the dynamic harness and scoped test, with no actionable findings on the exact one-file patch. Base: 53896ae.

Native compatibility: actual iPhone 16 Pro / iOS 27 Simulator base/candidate runs used the same existing terminal, left/interior/right toolbar scrolling, modifier toggles, arrow keys, retained keyboard and terminal reopen. No visible regression was observed. Exact reviewed JS overlay hashes were verified before/after; eight prior JS fixes and the native row-decode fix were held constant. Native Android was not run: the Device host selected an incomplete SDK despite a full SDK existing elsewhere. Counts establish reduced parent React/state work during scrolling, not fewer native redraws or physical battery/energy savings. No visible behavior change; unchanged-UI GIFs are omitted.

Implementation and fresh read-only review: GPT-6.1 Sol (high reasoning), Codex harness through T3 Code. Review used a fresh session of the same requested model.

Current-main verification (2026-10-29)

Integrated upstream dac8b11. Fresh independent Codex/GPT-6.1 Sol high review found no actionable source findings. The compiler case passes; the current-main production comparison preserves 863 outputs across 868 events per platform and reduces 300 interior parent executions/setter calls to zero. These are React DOM/native-host fixtures, not a native-client runtime run. CI=true vp run check:changed dac8b11ddc25bd5da62a367fdb6c3de777ae2986 passed after the merge commit, covering only this contribution.

The iOS screenshots and gestures above are historical and were not recaptured on this integrated head. Current native keyboard/modifier/accessibility behavior and Android runtime remain unverified. All eight required checks now pass on 372c9d9. GitHub reports CLEAN/MERGEABLE; Macroscope approved that exact head, and CodeRabbit found no actionable source issues with all four pre-merge checks passing. These results do not replace the current native verification limits above.

Implemented and independently reviewed in separate GPT-6.1 Sol/high sessions through Codex in T3 Code.

@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). labels Oct 26, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Oct 26, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 372c9d9

Macroscope's review found this PR approvable — This reduces toolbar rerenders by updating state only when scroll-edge fade visibility changes. Its effects are confined to visual overlays, with no changes to product defaults or toolbar actions.

Notes:

  • All code in this push has already been reviewed. Approvability was decided on eligibility alone.

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

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 372c9d9 and b17e917.

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

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 9bf3158 and 372c9d9.

Files selected for processing: 1
  • apps/mobile/src/components/ComposerToolbar.tsx

Limit details: You’ve used all 10 included reviews currently available.

Walkthrough

ComposerToolbarScroller stores content width, scroll offset, and viewport width in a ref. It keeps left and right fade visibility in state and recalculates visibility when layout, content size, or scroll position changes.

Changes: Composer toolbar fades

Layer / File(s) Summary
Scroll metrics and fade recalculation
apps/mobile/src/components/ComposerToolbar.tsx
The component stores scroll metrics in a ref and fade visibility in state. Layout and content-size handlers skip unchanged measurements. The scroll handler ignores offset changes smaller than 1 pixel. Fade visibility uses the existing 4-pixel epsilon.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Refactor

Suggested reviewers: t3dotgg, juliusmarminge, maria-rcks

Merge Risk: Minimal · previous review 372c9

The toolbar now skips unchanged fade updates; no merge-blocking issue was established.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title is concise, specific, and accurately describes the primary performance change: skipping unchanged terminal toolbar fade updates.
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.
Description check Passed The description includes all required sections and clearly explains the problem, implementation, scope, verification results, limitations, and agent details. The scope section does not provide a direc…
Full details: Description check

Explanation

The description includes all required sections and clearly explains the problem, implementation, scope, verification results, limitations, and agent details. The scope section does not provide a direct maintainer approval comment, but it gives a focused-fix justification and relevant related PRs.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@macroscopeapp
macroscopeapp Bot dismissed their stale review October 29, 2026 06:20

Dismissing prior approval to re-evaluate 372c9d9

GigaZoro pushed a commit to GigaZoro/CodeShip that referenced this pull request Oct 30, 2026
…ingdotgg#25312)

Cherry-picked from pingdotgg#25312

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Yash-Singh1
Yash-Singh1 merged commit 6ae0d3f into pingdotgg:main Nov 5, 2026
29 checks passed
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Nov 6, 2026
**v0.1.8-nightly.20261106.4247** · 67 changes from 19 contributors

- **Environment dictation.** Choose an environment for dictation in web and desktop, including desktop browser annotations.
- **Fresh sessions.** Use /clear to start a fresh session without leaving your thread.
- **Scheduled task sessions.** Run scheduled tasks in one thread, either continuing the conversation or starting fresh each time.
- **Secret requests.** Answer secret requests using a secret provider instead of copying and pasting credentials.
- **Snooze questions.** Snooze a thread with a pending question and answer it later.
- **Claude Ultracode.** Use Ultracode at any effort level, including with Claude Sonnet 5.5 and Haiku 5.5.
- **Faster pull requests.** Pull requests open faster using data already available in the app.

### Plus 31 more bug fixes and performance improvements.

<details>
<summary>Full changelog</summary>

## What's Changed
* fix(threads): side chats inherit parent permissions by default by @extoci in pingdotgg/t3code#31114
* fix(server): threads follow their worktree's branch changes by @Yash-Singh1 in pingdotgg/t3code#31599
* fix(pi): usage reports include sessions stored in a --session-dir launch argument by @saphid in pingdotgg/t3code#30690
* perf(mobile): skip unchanged terminal toolbar fade updates by @saphid in pingdotgg/t3code#25312
* perf(mobile): assemble HTML replacements in one pass by @saphid in pingdotgg/t3code#25278
* perf(mobile): skip canceled SVG parsing by @saphid in pingdotgg/t3code#25314
* test(server): strengthen v1 cutover proof with event-stream waits and content snapshots by @saphid in pingdotgg/t3code#11869
* fix(contracts): a stored secret reference is always sensitive by @yordis in pingdotgg/t3code#31403
* fix(server): a settings save no longer reads an unreadable secret again by @yordis in pingdotgg/t3code#31226
* fix(threads): allow snoozing pending input requests by @saphid in pingdotgg/t3code#20058
* fix(server): repair cutover test crypto import breaking main CI by @Yash-Singh1 in pingdotgg/t3code#31630
* feat(server): sends can start a fresh provider session by @juliusmarminge in pingdotgg/t3code#30323
* feat: /clear starts a fresh session in the same thread by @juliusmarminge in pingdotgg/t3code#30325
* feat: scheduled tasks can run in one thread with a fresh session each run by @juliusmarminge in pingdotgg/t3code#30326
* fix(web): dragging a sidebar thread no longer scrolls the list out from under the pointer by @juliusmarminge in pingdotgg/t3code#30346
* fix(assets): preserve the PR repository for GitHub media by @juliusmarminge in pingdotgg/t3code#21631
* fix(server): load PR uploads from SSO organizations by @juliusmarminge in pingdotgg/t3code#21632
* fix(mobile): the Duo inspector stops at its widest instead of vanishing by @juliusmarminge in pingdotgg/t3code#31665
* test(server): launcher PATH lookup test no longer drops the Windows drive letter by @tris203 in pingdotgg/t3code#22534
* test(server): replay tests delete their temp directories by @only21mil in pingdotgg/t3code#23445
* fix(mobile): transcribe Android audio during recording by @PixPMusic in pingdotgg/t3code#31300
* test(web): linked-environment subagents keep opening in their own thread by @RealDoc06 in pingdotgg/t3code#26492
* test(server): pin post-commit outbox settle boundary by @Narayan201120 in pingdotgg/t3code#27560
* test: remove unreachable github cli decoding test by @t3-code-bot[bot] in pingdotgg/t3code#28115
* test(server): retain delegated child events when detaching a parent by @benjamin-di in pingdotgg/t3code#29622
* test(lint): pin which ResizeObserver constructions no-raw-resize-observer reports by @only21mil in pingdotgg/t3code#28781
* test(mobile): drop two deleted tests from the React test list by @only21mil in pingdotgg/t3code#28800
* test(web): worked-for expand test waits for the timeline to finish loading by @saphid in pingdotgg/t3code#29661
* test(web): avoid PDF worker startup timeouts in attachment tests by @voltcrash in pingdotgg/t3code#29933
* test(web): source control writing settings test waits for the reset button by @juliusmarminge in pingdotgg/t3code#30372
* test(web): keep the work heading test inside the viewport by @voltcrash in pingdotgg/t3code#30613
* test: use an empty config file instead of the null device for git fixtures on Windows by @Pyseph in pingdotgg/t3code#30772
* test: remove stale tests for unused thread and onboarding helpers by @t3-code-bot[bot] in pingdotgg/t3code#30817
* test(server): correct Windows path and settings assertions by @ElliotDrel in pingdotgg/t3code#30983
* feat(claude): Ultracode works with any effort, like Claude Desktop by @Bil0000 in pingdotgg/t3code#27034
* perf(pr): pull requests paint from data already held, on web, desktop and mobile by @Bil0000 in pingdotgg/t3code#27798
* fix(mobile): approval card buttons line up by @shivamhwp in pingdotgg/t3code#31415
* fix(gitlab): author names link to GitLab profiles by @TonybynMp4 in pingdotgg/t3code#30418
* fix(gitlab): merge messages drop agent credits by @TonybynMp4 in pingdotgg/t3code#30441
* fix(gitlab): file and image comments appear as review threads by @TonybynMp4 in pingdotgg/t3code#30425
* fix(web): screen readers no longer read out a secret typed into the request card by @juliusmarminge in pingdotgg/t3code#31653
* perf(pr): actions update every client from the host's reply instead of re-reads by @Bil0000 in pingdotgg/t3code#25761
* feat(mobile): start side chats with /side by @juliusmarminge in pingdotgg/t3code#31709
* feat(claude): expose Ultracode on Claude Sonnet 5.5 and Haiku 5.5 by @DrSeedon in pingdotgg/t3code#30781
* feat(settings): Simlock, Antigravity and OpenCode credentials can come from a secret provider by @juliusmarminge in pingdotgg/t3code#31652
* refactor(mobile): screens declare what they are; layout and AppBar own every platform bar decision by @juliusmarminge in pingdotgg/t3code#31310
* fix(server): a saved source control token that can't be read no longer falls back to another account by @juliusmarminge in pingdotgg/t3code#31646
* feat(secrets): answer a secret request with a secret provider reference by @juliusmarminge in pingdotgg/t3code#31670
* fix(settings): removing a secret provider clears the fields that used it by @juliusmarminge in pingdotgg/t3code#31651
* docs(user): explain secret providers and secret requests by @juliusmarminge in pingdotgg/t3code#31654
* feat(server): transcribe audio on a chosen environment by @juliusmarminge in pingdotgg/t3code#30625
* feat(web): opt into environment dictation on this device by @juliusmarminge in pingdotgg/t3code#30623
* feat(desktop): dictate into browser annotations with the same consent by @juliusmarminge in pingdotgg/t3code#30624
* feat(mobile): opt in to dictation on a paired environment by @juliusmarminge in pingdotgg/t3code#31059
* fix(web): keep the folder path caret in place while editing by @juliusmarminge in pingdotgg/t3code#31642
* perf(mobile): call the highlights lexer through Nitro, up to 10x faster calls on Android by @camchis in pingdotgg/t3code#31188
* fix(claude): turns use the downloaded model catalog by @juliusmarminge in pingdotgg/t3code#31717
* fix(gitlab): bot authors are flagged as bots by @TonybynMp4 in pingdotgg/t3code#30383
* fix(gitlab): merge requests can edit their labels by @TonybynMp4 in pingdotgg/t3code#30483
* perf(mobile): faster thread sync, connects, and reconnects on bad wifi by @Bil0000 in pingdotgg/t3code#28487
* fix(mobile): iPad composer drops when the keyboard floats or minimizes by @juliusmarminge in pingdotgg/t3code#31251
* perf(mobile): stop iOS syntax highlighting from looking up a thread-local on every lexer call by @camchis in pingdotgg/t3code#31187
* fix(gitlab): edited comments wake PR watchers by @TonybynMp4 in pingdotgg/t3code#30403

## New Contributors
* @benjamin-di made their first contribution in pingdotgg/t3code#29622
* @ElliotDrel made their first contribution in pingdotgg/t3code#30983
* @DrSeedon made their first contribution in pingdotgg/t3code#30781

**Full Changelog**: pingdotgg/t3code@v0.1.8-nightly.20261105.4234...v0.1.8-nightly.20261106.4247

</details>


Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.1.8-nightly.20261106.4247
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

2 participants