Skip to content

refactor(web): composer overlay re-measures from one layout effect - #25915

Merged
juliusmarminge merged 1 commit into
mainfrom
effect/split-a2-chatview-composer-mounted
Oct 27, 2026
Merged

juliusmarminge merged 1 commit into
mainfrom
effect/split-a2-chatview-composer-mounted

Conversation

@juliusmarminge

Copy link
Copy Markdown
Member

Problem

ChatView kept a composerMountedRef plus a second layout effect that compared it with composerMounted and, on change, reset the three composer inset refs and re-published the overlay height. Its body was identical to the thread-switch reset effect. The ref also lagged: when ChatView mounted on a provider-subagent thread (composer not mounted), the reset and observer effects published with the ref's initial true, and the extra effect then reset and re-published in the same commit.

Change

  • Delete composerMountedRef and the compare effect.
  • publishComposerOverlayHeight reads composerMounted directly. It is called through useStableCallback, which updates in an insertion effect, so every layout effect (and child calls through onComposerOverlayHeightChange) already sees the current render's closure.
  • The thread-switch reset effect also keys on composerMounted; its existing exhaustive-deps disable reason now covers composer mount/unmount. The resize-observer effect does not depend on composerMounted, so effect order within the commit is unchanged.

What this improves

  • Simpler code: one layout effect, one ref and the previous-value bookkeeping removed.
  • On mount with the composer hidden, or a thread switch that also flips the subagent bar, the overlay publishes once with the correct resting flag instead of publishing a stale value and then resetting and re-publishing.
  • No bug fix is claimed: the final inset was already correct on main, so there is no regression test.

Behavior changes

None intended. The intermediate publish with the stale composerMounted: true flag no longer happens (it was immediately overwritten in the same commit).

Effects

  • apps/web/src/components/ChatView.tsx: layout effects 3 -> 2 in this area (compare effect removed; reset and resize-observer effects kept, both measure DOM after commit).

Verification

  • vp run check:changed: format, lint, knip 1/2, knip 2/2, typecheck (3 packages), test (2 files) all pass.

Model: Claude Opus 5.5, Claude Code harness.

🤖 Generated with Claude Code

ChatView kept a composerMountedRef plus a second layout effect that
compared it with composerMounted and, on change, reset the three composer
inset refs and re-published the overlay height. That body is identical to
the thread-switch reset effect. The ref also lagged: when ChatView mounted
on a provider-subagent thread (composer not mounted), the reset and
observer effects published with the ref's initial `true`, and the extra
effect then reset and re-published in the same commit.

publishComposerOverlayHeight goes through useStableCallback, which updates
in an insertion effect, so layout effects already see the current render's
closure. It now reads composerMounted directly, and the thread-switch reset
effect also keys on composerMounted.

Effects in ChatView.tsx: one useLayoutEffect removed (the composerMounted
compare); the reset and resize-observer layout effects are kept, they
measure DOM after commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Oct 27, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs Human Approval

Macroscope's review found this PR requires human approval — This is a narrowly scoped composer measurement refactor with no schema or product-default changes. It also broadens a line-level oxlint diagnostic suppression, which requires human review under the applicable policy.

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

@coderabbitai

coderabbitai Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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 58c31f2 and b673c52.

Files selected for processing: 1
  • apps/web/src/components/ChatView.tsx

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

Walkthrough

The composer overlay measurement effect now responds to changes in composerMounted. The separate ref and layout effect that tracked those changes have been removed.

Changes: Composer Overlay Measurement

Layer / File(s) Summary
Update overlay measurement
apps/web/src/components/ChatView.tsx
publishComposerOverlayHeight now passes composerMounted to overlayComposerIsResting. The overlay measurement effect includes composerMounted as a dependency and handles the reset and measurement. The separate tracking ref and layout effect are removed.

Priority: Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Refactor

Suggested reviewers: t3dotgg, macroscopeapp

Merge Risk: Minimal · up to b673c

No actionable merge-blocking risk was identified in this focused refactor.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly describes the main change: consolidating composer overlay measurement into one layout effect.
Description check Passed The description explains the problem, change, effects, and verification. It does not include the required “Scope and approval” section or explain why the change qualifies for an exemption, but the res…
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 explains the problem, change, effects, and verification. It does not include the required “Scope and approval” section or explain why the change qualifies for an exemption, but the rest of the description is detailed and relevant.

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

Usage-based review receipt

Note

This review was completed with usage-based billing: files reviewed beyond your plan's included limits are billed at $0.25/file. View usage-based billing.

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

@juliusmarminge
juliusmarminge merged commit a4fe62e into main Oct 27, 2026
30 checks passed
@juliusmarminge
juliusmarminge deleted the effect/split-a2-chatview-composer-mounted branch October 27, 2026 12:17
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Oct 27, 2026
## What's Changed
* refactor(mobile): subagent timers share the visible second clock by @juliusmarminge in pingdotgg/t3code#25854
* refactor(mobile): app update checks start with the app by @juliusmarminge in pingdotgg/t3code#25856
* refactor(mobile): workspace tabs, home filters and connection status derive instead of syncing by @juliusmarminge in pingdotgg/t3code#25813
* refactor(mobile): settings permission and update checks without sync effects by @juliusmarminge in pingdotgg/t3code#25895
* fix(desktop): run the packaged bundle self-check on macOS artifacts by @stbenjam in pingdotgg/t3code#25900
* fix(web): the Add ChatGPT account dialog animates closed once the account connects by @juliusmarminge in pingdotgg/t3code#25868
* refactor(web): composer clears scroll-collapse in render, not after paint by @juliusmarminge in pingdotgg/t3code#25909
* refactor(web): composer overlay re-measures from one layout effect by @juliusmarminge in pingdotgg/t3code#25915
* refactor(web): file browser records the right-click position on its own panel by @juliusmarminge in pingdotgg/t3code#25908
* refactor(web): preview element picker drops its unmount guard by @juliusmarminge in pingdotgg/t3code#25920
* fix(web): PR Code tab no longer requests the diff of a commit the PR dropped by @juliusmarminge in pingdotgg/t3code#25916
* perf(mobile): worktree setup updates commit the thread screen once by @juliusmarminge in pingdotgg/t3code#25910
* fix(desktop): a broken release opens an error window instead of hanging by @t3dotgg in pingdotgg/t3code#25903
* ci(web): releases fail when the built web app cannot boot by @t3dotgg in pingdotgg/t3code#25929
* ci(release): desktop builds that cannot open no longer publish by @t3dotgg in pingdotgg/t3code#25928
* refactor(web): file tree drag mentions use React drag handlers by @juliusmarminge in pingdotgg/t3code#25913
* refactor(mobile): git action results buzz from where they are reported by @juliusmarminge in pingdotgg/t3code#25912
* fix(mobile): the Add environment form shows only its own pairing errors by @juliusmarminge in pingdotgg/t3code#25859
* refactor(mobile): showcase capture runs as an app service, not a chain of effects by @juliusmarminge in pingdotgg/t3code#25857
* fix(server): bound hung delegated stop effects so later runs can start by @juliusmarminge in pingdotgg/t3code#25675
* feat(mobile): add One UI navigation preference on Android by @PixPMusic in pingdotgg/t3code#25758


**Full Changelog**: pingdotgg/t3code@v0.1.4-nightly.20261027.3770...v0.1.4-nightly.20261027.3783

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

Labels

size:S 10-29 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