Repository navigation
Conversation
There was a problem hiding this comment.
The fix works. In the PR's own e2e test (headless Chromium with CSS zoom: 1.1), the new test fails with dialog.tsx reverted to base and passes with the change. Repeat runs passed (6/6, 8/8, 12/12). One earlier batch of 8 failed 4 times; it was probably a cold dev server, but I didn't capture the error. I didn't check it in the Electron desktop app itself. The override mirrors @pierre/trees' own @container measure (height > 1lh) rule with 1px of slack, in the same shadow root. Because the library's rule isn't !important, it wins cleanly, and real overflow (about two lines tall) still shows the marker.
Public API: unchanged.
The only point worth changing is the size of the test (see the inline comment).
|
Closing as superseded: #65225 landed the same fix in Thanks to @neriousy for the fix, and to the reviewer here for independently reproducing the zoom failure earlier. |
Issue for this PR
Closes #64969
Type of change
What does this PR do?
The directory picker's tree (
@pierre/trees) shows its middle-truncation marker when@container measure (height > 1lh)matches. At fractional UI zoom, sub-pixel rounding can make the marker cell a fraction of a pixel taller than1lh, so the marker is painted even when the name fits. At 110% in the app the cell measures 26.4219px against1lh26.3906px.The picker's
unsafeCSSnow hides the marker when the container is at most one line plus 1px tall. A name that really does not fit makes the cell about two lines tall, so real truncation still gets the marker. Middle truncation is otherwise unchanged.The same 1px tolerance was proposed upstream in pierrecomputer/pierre#840 (closed unmerged); pierrecomputer/pierre#939 is a WIP rewrite that removes this marker. Keeping the override in the picker avoids changing the vendored
@pierre/treespatch, and it can be dropped once a release includes the rewrite. The picker is the only app tree that uses middle truncation; the other tree setsmiddleTruncate: false.How did you verify your code works?
packages/app/e2e/regression/directory-picker.spec.tscoverage: at CSS zoom 1.1 (a proxy for the desktop's 110% UI zoom), a fitting name hasopacity: 0, and an overflowing name still hasopacity: 1.cd packages/app && bun run test:e2e:built -- e2e/regression/directory-picker.spec.ts --grep "fractional UI zoom" --repeat-each=10 --workers=5 --retries=0passes 10/10; the same test fails without the CSS change at the opacity assertion.Screenshots / recordings
Before, at 110% (e2e fixture):
After (same fixture):
Checklist