Skip to content

fix(app): hide spurious folder-picker truncation markers at fractional UI zoom - #64970

Closed
Railander wants to merge 1 commit into
anomalyco:devfrom
Railander:fix/directory-picker-zoom-markers
Closed

Railander wants to merge 1 commit into
anomalyco:devfrom
Railander:fix/directory-picker-zoom-markers

Conversation

@Railander

@Railander Railander commented Nov 19, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #64969

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

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 than 1lh, so the marker is painted even when the name fits. At 110% in the app the cell measures 26.4219px against 1lh 26.3906px.

The picker's unsafeCSS now 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/trees patch, 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 sets middleTruncate: false.

How did you verify your code works?

  • Reproduced in the desktop app at 110%: every row painted the marker; at 100% none did.
  • Applied the same override in the running app at 110%: markers disappeared for fitting names, and a tree narrowed to 72px still showed the marker on an overflowing name.
  • Added packages/app/e2e/regression/directory-picker.spec.ts coverage: at CSS zoom 1.1 (a proxy for the desktop's 110% UI zoom), a fitting name has opacity: 0, and an overflowing name still has opacity: 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=0 passes 10/10; the same test fails without the CSS change at the opacity assertion.

Screenshots / recordings

Before, at 110% (e2e fixture): Before: a fitted folder name still shows the middle-truncation marker

After (same fixture): After: the same rows with no truncation markers

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@Railander

Copy link
Copy Markdown
Author

Closing as superseded: #65225 landed the same fix in dev (hide the marker by default and only reveal it above 1.5lh), which closes #64969. Keeping this branch would only duplicate that CSS, so I won't rebase it.

Thanks to @neriousy for the fix, and to the reviewer here for independently reproducing the zoom failure earlier.

@Railander Railander closed this Nov 28, 2026
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.

Folder picker shows middle-truncation markers on fitting names at 110% UI zoom

1 participant