Conversation
useVimSelection resets only when vim goes from on to off, so a mount with vim never on calls no window.getSelection(). AnnotationToolstrip's buttons take their expanded width from layout (a 0fr -> 1fr grid column holding a hidden copy of the label) instead of reading offsetWidth in a layout effect. Co-Authored-By: Claude <noreply@anthropic.com>
…he icon right to left The label was placed with a physical left, so under dir="rtl" it covered the icon. The label, the side padding and the sizer's gap now use logical properties. toolstrip-stacking.spec.ts checks in Chromium and WebKit that every expanded button's label sits after its icon, left to right and right to left. Co-Authored-By: Claude <noreply@anthropic.com>
…a hand launch The check launched WebKit inside the Chromium run, which inherited the config's Chromium flags and failed on the CI runner. It now lives in toolstrip-rtl.spec.ts, which the chromium project runs with every spec and a webkit project (that spec only, launched with no Chromium flags) runs in WebKit. Co-Authored-By: Claude <noreply@anthropic.com>
# Conflicts: # tests/e2e/playwright.config.ts
…rt for the remote-mode update test toolstrip-stacking: on CI's Chromium the pointer can still read as (0, 0) on the new document, on the sidebar peek's edge strip, so the peek opened over the page (over the thread beside a file on main too) and, at full screen, over the strip. The peek closes only when the pointer leaves it: enter it and leave, then require it closed before the strip is probed. update-advert: the remote-mode case picked a random port in 30000-50000, inside Linux's ephemeral range, and CI hit "Port … in use after 5 retries" twice. It now takes a port the OS reports free. Co-Authored-By: Claude <noreply@anthropic.com>
# Conflicts: # tests/e2e/playwright.config.ts
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Asked for by the Workspaces perf program: a warm document open spent most of its mount task in forced layouts, and two of them were in
@plannotator/ui. This removes both and prepares@plannotator/ui0.53.1 (not published; Plannotator's app versions are unchanged).What changed
useVimSelection: the reset when vim is off (state, focus, HUD, and the selection inside the viewer throughwindow.getSelection()) now runs only when vim goes from on to off. A mount where vim was never on reads no selection. The enable path is unchanged. One behaviour change a host may notice: with vim off, a selection already inside the viewer is no longer cleared when the document mounts or its content changes (useVimSelection.selectionScope.test.tsxupdated to say so). Turning vim off still clears it.AnnotationToolstrip: the buttons no longer readoffsetWidthin a layout effect. A hidden copy of the label sits in a one-column grid whose column animates0frto1fr, so the width comes from layout; the side padding animates 7 to 10 px as before. The visible label is positioned beside the icon and clipped by the button, as before. (Drawing the label inside the grid track itself reveals it more slowly than the button grows, since a track laid out at a fraction of its width is narrower again, and WebKit does not animate the width at all unless the item clips its overflow; so the track holds a hidden copy.)packages/ui/package.jsonandbun.lock; HANDOFF.md has a section on the two changes; the README and HANDOFF entries labelled "after 0.53.0 / unreleased" now say 0.53.1.Numbers
Chromium trace, a harness that renders
Viewerwith the toolstrip header (a 120-section document), the open clicked after three warm-up opens, median of 25 runs:offsetWidth)clearSelectionWithin)The layout itself still happens once, in the frame, so total layout time is about the same; what goes away is the synchronous layout inside the mount task. Fixing only the toolstrip just moves the forced layout to the vim reset, so both are needed.
In Plannotator's own annotate app the count does not drop: other readers in the same commit (a visual-viewport read, a measuring component, the sticky lane's
offsetTop) take the forced layout over (13 vs 12 forced layouts on a full page load in an earlier run). The gain is for hosts like Workspaces where these were the readers.Checked
offsetWidthit used. Reduced motion behaves as before (the toolstrip never had its own rule).tests/e2e/toolstrip-stacking.spec.tson a compiled binary: 2 passed. Newtests/e2e/toolstrip-rtl.spec.ts, run by the existingchromiumproject and a newwebkitproject inplaywright.config.ts(that spec only, launched without the Chromium flags): every expanded button's label sits after its icon, left to right and underdir="rtl", in both engines. The label is placed withinset-inline-start; the first version used a physicalleftand covered the icon right to left, which this spec catches.useVimSelection(new: nogetSelectioncall on a never-enabled mount; turning vim off after it was on still clears, and only then),useVimDocumentFocus,AnnotationToolstrip,Viewer.documentHeader,StickyHeaderLane;bun test packages/ui.bun run typecheck(strict consumer included). The guides.show viewer manifest does not change.🤖 Generated with Claude Code