Skip to content

perf(web): reduce layout work when opening side threads - #1294

Merged
nixuuu merged 1 commit into
devfrom
perf/diagnose-rendering-performance
Nov 26, 2026
Merged

nixuuu merged 1 commit into
devfrom
perf/diagnose-rendering-performance

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 26, 2026

Copy link
Copy Markdown
Member

Change

Animate side-thread branches with a CSS grid track. The browser derives the height from the content, removing the synchronous layout read at the start of the transition. Reduced motion switches the branch immediately. The sidebar's Working and Snoozed disclosures reuse the same transition helper.

Verification

  • Compared two-minute runs in headless Chromium with 15 main threads, four concurrent synthetic streams and 122 switches between two warm conversations with side threads.
  • The p95 interval between animation callbacks during navigation fell from 50.0 to 33.4 ms. Long animation frames in the navigation and reveal windows fell from 115 to 88. During the reveal alone, the p95 callback interval remained 33.3 ms.
  • Checked rapid switching, selecting a side thread and opening a branch in a 220 px sidebar. Web typecheck, lint on edited files and git diff --check passed. The rebase changed only the documentation within this patch.
  • The headless run measured renderer callbacks at about 60 Hz. Frame presentation in Electron at 120 Hz remains unverified. Repository-wide checks run in CI.

@nixuuu
nixuuu enabled auto-merge (squash) November 26, 2026 07:38
@nixuuu
nixuuu merged commit 7a2f614 into dev Nov 26, 2026
11 checks passed
@nixuuu
nixuuu deleted the perf/diagnose-rendering-performance branch November 26, 2026 07:40
nixuuu added a commit that referenced this pull request Nov 26, 2026
## Change

- Determine summary docking and the side panel's placement from their
target widths. Use ResizeObserver data for the live floating-summary
breakpoint. Keep the existing CSS transitions for the sidebar, side
panel and summary.
- Prepare the composer's paused transitions once per scroll segment.
Subsequent frames only seek those transitions to the current scroll
progress.

## Verification

- Headless Chromium with a seeded Canopy workspace. Six sidebar toggles
produced 1,029 geometry reads on the observed columns before the change
and zero after. Width samples matched. The p95 requestAnimationFrame
interval was 16.7 ms in both versions.
- A controlled Chromium composer comparison matched all 25 samples,
including reversal and settlement. Animation pause calls fell from 63 to
18 with the same number of seeks. Checked folding and reopening in the
live workspace.
- Checked the summary and side panel at 1,440 px and 410 px, and
confirmed navigation restores each thread's panel state without a grid
transition.
- Web typecheck, lint on changed code, and diff checks passed locally.
Repository-wide verification runs in CI. Frame presentation in Electron
at 120 Hz remains unmeasured.

Refs: #755
Refs: #756
Related: #1294
nixuuu added a commit that referenced this pull request Nov 26, 2026
## Changes

- Document when a new test earns its place, how to assert an independent
result, and how to wait for observable events. Keep repeated stress runs
and benchmarks out of required CI.
- Remove three low-value or duplicated files and repeated cases,
including 18 identical thread moves. Keep both attachment sizes and the
move recovery cases.
- Replace production-duration waits in linked routes, worktree checkout
and proxy account tests with scoped clocks or barriers. Fix false
positives in worker compatibility, oversized images, linked reads and
Slack retry. Wait for the gateway/worker permission outcome despite
redelivery.
- Refresh shard weights from two complete green runs with the deleted
files removed. Adjust the estimates for the shortened files using their
previous durations and focused run evidence. Add a command to refresh
from verified timing reports.
- Start PR native source checks alongside builds. Send only the binaries
for each smoke runner's target. Native PR jobs check the build from the
same run, with a five-minute wait limit if it is still running. Install
the workspaces needed by the native checks.

## Baseline and verification

- Compared with #1294 Push CI, which took 8 min 16 s on the previous
workflows. Its five binary smoke jobs each downloaded the same 669 MB
bundle. The revised timings predict about 5 min 8 s of Bun execution on
each shard. GitHub Actions will measure elapsed time, including setup
and transfer.
- Focused Bun 1.4.5 verification covered the edited integration suites
on isolated PostgreSQL 18, including full move and worktree files, proxy
and linked routes, plus the affected tests without a database. The large
and small move variants passed in the same suite. Mutation checks caught
the removed GIF size limit and a wrong Slack Retry-After deadline.
- Worker-side test lint and formatting, gateway/integration/scripts
typechecks where affected, actionlint, shellcheck and diff checks
passed. Verified all 904 paths are assigned once and the report
validator rejects duplicate entries and invalid durations. Scoped
install ran the 52 matching source checks on macOS.
- GitHub CI verifies Docker-backed PostgreSQL, the Windows and Intel
macOS native paths, and the same-run artifact downloads. The release
gate continues to require successful Push CI for the released commit.
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