Repository navigation
fix(web): show the sidebar's unpin button to keyboard and touch users - #4909
Conversation
The unpin button on pinned library shortcuts only appeared on mouse hover, so Tab focused an invisible button and touch screens never showed it while it still took taps at the end of the row. It now uses the shared pointer-reveal utility, and on touch the link reserves room so a long label truncates before the button instead of running under it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Under a mouse the label now gives up the button's room only while the row is hovered or focused, so the ellipsis lands before the icon instead of under it, and labels keep their full width at rest. The button now spans the row's height and 28px of its end, a larger tap target with the icon where it was. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The pinned label takes its direction from its own text, so an English title in a right-to-left interface truncates at its end. The unpin button's focus ring wraps the icon instead of the button's full-height hit area. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 1 minute. View limit details
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Quick104
left a comment
There was a problem hiding this comment.
Adversarial review (claude-opus-5-5, reviewed e76bcd6)
The fix is correct. With .pointer-reveal and the group/row rename, the button shows on keyboard focus and always on touch, and the padding stops the label running under the button. Both findings below are simplifications: the change uses more machinery than the bug needs.
Also checked, no finding: the specificity of the compiled group-hover/row and group-focus-within/row rules (the custom hover variant's :where() adds nothing, so they compile to (0,2,0) against the rest rule's (0,1,0)). Hybrid pointers: the padding and the reveal both read the same data-fine-pointer attribute, so they switch together. When canToggle is false there's no button and no padding reserve. The other group/row users (ListRow, PosterPeek, SeriesDrilldown, SuggestionList) are separate subtrees and aren't affected. I found no 1.0 validation task that covers sidebar pins.
AI disclosure: written by Claude Code (model claude-opus-5-5) as an automated adversarial reviewer.
| className={`flex flex-1 items-center gap-2 rounded-xl px-2.5 py-2.5 text-[0.78125rem] font-medium transition-colors duration-150 ${ | ||
| className={`flex min-w-0 flex-1 items-center gap-2 rounded-xl px-2.5 py-2.5 text-[0.78125rem] font-medium transition-colors duration-150 ${ | ||
| canToggle | ||
| ? "pe-7 group-focus-within/row:pe-7 group-hover/row:pe-7 [:where(:root[data-fine-pointer=true])_&]:pe-2.5" |
There was a problem hiding this comment.
O1 (nit, simplification): reserve the end padding all the time instead of toggling it under a mouse.
Trigger: with a mouse, hover or Tab onto a pinned row whose label is truncated.
Impact: end padding goes from pe-2.5 to pe-7, so the ellipsis moves about 18px and the visible label changes on every hover and focus. The PR already accepts this. To do it, the row needs three classes plus an arbitrary variant that copies the data-fine-pointer gate inline, and it only works while the compiled rest rule (0,1,0) stays less specific than the group-hover/group-focus-within rules (0,2,0). Touch users already get pe-7 all the time.
Repair: canToggle ? "pe-7" : "". Mouse users lose about 18px of label at rest. In return there's one rule for every pointer type, no reflow on hover or focus, and no second copy of the pointer gate to keep in sync with app.css.
There was a problem hiding this comment.
Keeping the hover/focus toggle. Always reserving pe-7 was the first version on this branch, and on desktop it truncated "Recently Released Movies" at rest, where it used to fit. The visual reviewers then flagged the icon drawn over the ellipsis on hover, which the toggle fixes. The ellipsis does move about 18px on hover; that's the trade for full-width labels at rest.
🤖 Claude Code (claude-opus-5-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
On a hybrid last used with a mouse, `.pointer-reveal` controls are hidden but still take hits. A touch on one clears the fine-pointer flag, which reveals the control before the tap's click arrives, so the first touch at the end of a pinned sidebar row unpinned it. A press that starts on a hidden control now drops its click; keyboard activation and taps on a visible control are unchanged. The sidebar unpin button also stops fading, so it never shows over a label that has just reclaimed its room. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This comment has been minimized.
This comment has been minimized.
Quick104
left a comment
There was a problem hiding this comment.
Adversarial review (claude-opus-5-5, reviewed 69981ae)
The round-1 fixes hold up. The 24×24 button keeps the native focus ring on itself, so the inner span and [outline:auto] are gone, and end-1 plus 24px still matches the pe-7 reserve. The hybrid-tap guard works for every current .pointer-reveal user. One simplification nit is inline.
Checked, no finding:
- Guard false positives. Keyboard and
element.click()clicks (detail 0) pass. Labels:preventDefaulton a dropped label click also stops its forwarded activation, and no.pointer-revealis a label today. Nested content:closest()pluscontains()covers a press on the icon inside the button. A second tap, including the second half of a double-tap, sees opacity 1 and passes. A touch on a hybrid whose mouse cursor is still over the row sees the control already revealed and passes. - Stale state. When a press produces no click (scroll, long press, WebKit's hover-on-first-tap cancel),
hiddenPressstays set, but the nextpointerdownresets it and the next keyboard click clears it without being dropped. - Misses. Nothing moves the absolutely positioned button when the flag clears, so a tap's click lands on the element its
pointerdownhit. - Mid-transition. The exact
"0"test lets through a control that is part-way through fading out. That only happens within the 150ms fade onCollectionPosterCard(transition-all) right after a mouse leaves. The sidebar button (transition-none) andSectionRow(transition-colorsreplaces the opacity transition) snap, so they can't hit it. I don't think this is worth handling. - Other click listeners. The window capture listeners in
Collections.tsxanduseLongPressdon't conflict, and React's root listener runs after the guard. - Other
.pointer-revealusers (SectionRow,CollectionPosterCard,SuggestionList,SeriesDrilldown) get the same first-tap-reveals behavior on hybrids. That is consistent with the intent of each. I found no 1.0 validation case that covers pinning or these controls.
O1's answer is accepted. I'm not raising it again.
AI disclosure: written by Claude Code (model claude-opus-5-5) as an automated adversarial reviewer.
Record the press at the top of onPointer, before the flag changes, so the guard no longer depends on a window listener running ahead of the document one. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
Background review round 2, Sol (gpt-6.2-sol, reviewed 69981ae): 8/10, one P3 finding. Its tool couldn't post a review pinned to the commit, so it's recorded here. S2-1 (P3): on a hybrid device, hold a touch on the hidden Unpin button and, before lifting it, click elsewhere with the mouse or press Enter on another control. The other input clears the pending press, so lifting the finger unpins the shortcut. Suggested repair: track pending presses by Not fixing it here. It needs two inputs at once, with a touch held while the other hand clicks or types, and the result is what happened before this PR. Keying by 🤖 Claude Code (claude-opus-5-5) |
Main now gives every cut .bidi-text element dir="auto" (#4853), so Firefox and WebKit keep the start and the ellipsis of an English title in a right-to-left interface. The pinned shortcut label is cut with truncate. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Problem
Related issue: N/A
Validation tasks: none
Other clients: N/A (web-only: the hover-only reveal is specific to the web sidebar)
In the web sidebar, the Unpin button on each pinned library shortcut appeared only on mouse hover. A keyboard user who tabbed through the sidebar landed on a button they could not see. On a touch screen, including the mobile drawer, the button never appeared, but it still took taps at the end of the row, so a tap meant to open a shortcut could remove it instead. On a hybrid device last used with a mouse, the button was hidden but a first touch at the end of the row still unpinned the shortcut. A long pinned label also never truncated: it ran under the button and past the sidebar's edge.
Approach
The button now uses the shared
pointer-revealutility, which already handles other hover-revealed row actions. With a mouse it stays hidden at rest and appears when the row is hovered or anything in it has keyboard focus. On touch it is always visible.The link can now shrink, so a long label truncates with an ellipsis, and the label takes its direction from its own text (the existing
bidi-textutility withdir="auto", as main now requires for cut text in #4853), so an English title in a right-to-left interface truncates at its end. It reserves 28px for the button only while the button shows: always on touch, and on hover or focus with a mouse. At rest with a mouse, labels keep their full width as before. The button is a 24px square (was 20px), the WCAG 2.5.8 minimum, with its own focus ring, and it no longer fades, so it never shows over a label that has just taken its room back.A hidden
.pointer-revealcontrol still takes hits, and a touch on one clears the fine-pointer flag, which reveals it before the tap's click arrives. Making it ignore pointer events while hidden doesn't stop that click.initPointerCapabilitynow notes, before it changes the flag, a non-mouse press that starts on a hidden.pointer-revealcontrol, and drops the click that press produces. The first touch reveals the control; the next one activates it. Keyboard activation is unchanged. This applies to every.pointer-revealcontrol, not only the sidebar.On touch, a default title such as "Recently Released Movies" now loses its last two letters to make room for the always-visible button; on desktop it does so only while its row is hovered or focused. Unpinning still takes effect at once with no undo, as it did when the button was invisible; the shortcut can be pinned again from the library page.
Validation
main: on desktop the focused Unpin button had computed opacity 0, and in the iPhone drawer (touch) it had opacity 0 at rest while still taking taps.pointer-eventsfix. With the guard, the first touch leaves the pin and shows the button; a second touch unpins.pointerCapabilitytest fails on the earlier head for that reason and passes now.pnpm run lint,format:check, typecheck,build, andbudget:checkpass, and thepointerCapabilitytests pass.make test-web, run on this branch before the review fixes (class-name changes only since), failed 7 tests in 5 unrelated files (player, admin, settings) on 5-second timeouts while the host was heavily loaded; those 5 files pass when rerun alone.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/sidebar-unpin-reveal/
Risks
The guard adds a document-level capture listener for
click, and checks presses in the existingpointerdownlistener. It acts only when a non-mouse press starts on a.pointer-revealelement whose computed opacity is 0, and then only on the click that press produces (detail> 0); every other click passes through untouched.Checklist
Follow-ups: the mobile drawer's close button is nearly invisible and half covered where the sidebar ends inside the drawer; it predates this change and is being handled separately.
Council review
gpt-6.2-sol, xhigh)claude-opus-5-5, high)gemini-4-neon, xhigh)Visual round 1 found the button drawn over a long label's ellipsis on hover (all three) and a small touch target (Opus, Gemini); both were fixed. All three noted the touch truncation of "Recently Released Movies", kept as the cost of an always-visible control. Round 2 found an English label truncating at its start in a right-to-left layout (Sol, Opus) and a tall focus ring (Gemini, Opus); both were fixed. The label shortening on hover, the link focus ring enclosing the button, and the lack of undo were kept.
The background review on e76bcd6: Sol's S1 (with Kody's matching comment) found the hybrid first-touch unpin, fixed by the guard; S2 found the fading icon overlapping the label for a frame, fixed with
transition-none. Opus's O2 led to the 24px button with its own focus ring; O1 (always reserve the padding) was kept as is, with the reason in its thread.Round 2 on 69981ae: Opus's O2-1 moved the press check into the flag's own listener so the guard no longer depends on listener order. Sol's S2-1 (a held touch plus a simultaneous mouse click or Enter elsewhere can still unpin) is left as is: it needs two inputs at once and falls back to the pre-PR behavior.
AI Disclosure
🤖 Generated with Claude Code
Note
Fix hidden unpin button in sidebar for keyboard and touch users
pointer-revealclass with reserved row padding so it stays part of the layout for all users, in AppSidebar.tsx..pointer-revealelement with computed opacity0records the element, and a later pointer-generated click (detail > 0) on it is suppressed. Keyboard-style clicks (detail: 0) still work.min-w-0on links,shrink-0pin icons, anddir="auto"withbidi-texton labels..pointer-revealgets its tap-while-hidden clicks blocked globally by the new document-level capture handler inpointerCapability.ts; verify other uses of the class are not affected.Macroscope summarized ca1a7b6.