Skip to content

fix(web): show the sidebar's unpin button to keyboard and touch users - #4909

Merged
Quick104 merged 9 commits into
mainfrom
fix/sidebar-unpin-button-reveal
Nov 21, 2026
Merged

Quick104 merged 9 commits into
mainfrom
fix/sidebar-unpin-button-reveal

Conversation

@Quick104

@Quick104 Quick104 commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

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-reveal utility, 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-text utility with dir="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-reveal control 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. initPointerCapability now notes, before it changes the flag, a non-mouse press that starts on a hidden .pointer-reveal control, 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-reveal control, 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

  • Reproduced on a Silo dev deployment built from 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.
  • Hybrid device (iPad preset with a mouse): on the earlier head of this branch a first touch on the hidden button unpinned the shortcut, with or without a CSS-only pointer-events fix. With the guard, the first touch leaves the pin and shows the button; a second touch unpins.
  • The new pointerCapability test fails on the earlier head for that reason and passes now.
  • Same deployment rebuilt with this change: the focused button shows; touch shows it at rest; mouse at rest is unchanged; hover still shows it. A long label truncates before the button on hover, keyboard focus, touch, and with the page flipped to right-to-left, and keeps its full width at rest under a mouse.
  • pnpm run lint, format:check, typecheck, build, and budget:check pass, and the pointerCapability tests 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 existing pointerdown listener. It acts only when a non-mouse press starts on a .pointer-reveal element whose computed opacity is 0, and then only on the click that press produces (detail > 0); every other click passes through untouched.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
  • The Evidence section shows every change a user can see, or how I checked a change nobody sees.

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

Member Visual review round 1 Visual review round 2 Background review (e76bcd6) Background review round 2 (69981ae)
Sol (gpt-6.2-sol, xhigh) better, 8/10 better, 8.5/10 7/10; S1, S2 fixed (not posted: its tool couldn't pin the commit) 8/10; S2-1 answered in a PR comment
Opus (claude-opus-5-5, high) better, 7/10 better, 8/10 7/10; O2 fixed, O1 answered 8.5/10; O2-1 fixed
Gemini (gemini-4-neon, xhigh) better, 6/10 better, 7.5/10 unavailable (provider quota, retried once) unavailable (provider quota)

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

  • Harness: Claude Code in T3 Code
  • Tool(s): Claude Code; Codex CLI and Antigravity for council reviewers
  • Model(s): claude-opus-5-5 (implementation); gpt-6.2-sol, claude-opus-5-5, gemini-4-neon (visual and background review); claude-sonnet-5-5 (code-review subagents)
  • Involvement: Fully AI-generated; not yet verified by a person
  • Adversarial review: a high-level multi-agent code review of the first commit found nothing to fix. Two background review rounds by Sol and Opus (Gemini unavailable) found the hybrid first-touch unpin and smaller issues; all were fixed except one two-input edge case, answered on the PR; see Council review. The plan round was skipped: the cause was clear in the source and the fix reuses an existing utility. A simplify pass found nothing to cut. Two visual review rounds by Sol, Opus, and Gemini on before and after captures led to the hover padding, label direction, and focus ring changes; see Council review.

🤖 Generated with Claude Code

Note

Fix hidden unpin button in sidebar for keyboard and touch users

  • The unpin button on pinned sidebar items was only reachable with a mouse hover. It now uses a pointer-reveal class with reserved row padding so it stays part of the layout for all users, in AppSidebar.tsx.
  • Adds a click guard in pointerCapability.ts: a non-mouse press on a .pointer-reveal element with computed opacity 0 records the element, and a later pointer-generated click (detail > 0) on it is suppressed. Keyboard-style clicks (detail: 0) still work.
  • Also fixes label layout: min-w-0 on links, shrink-0 pin icons, and dir="auto" with bidi-text on labels.
  • Risk: any element using .pointer-reveal gets its tap-while-hidden clicks blocked globally by the new document-level capture handler in pointerCapability.ts; verify other uses of the class are not affected.

Macroscope summarized ca1a7b6.

Quick104 and others added 3 commits November 20, 2026 23:21
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]>
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

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.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c3a30ba3-2996-4c50-b95a-ac458e96a102
Commits

Reviewing files that changed from the base of the PR and between e99fdd2 and ca1a7b6.

Files selected for processing: 3

  • web/src/components/AppSidebar.tsx
  • web/src/lib/pointerCapability.test.ts
  • web/src/lib/pointerCapability.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@silo-triage silo-triage Bot added the size/S 0–49 added + deleted lines (all files); change volume, not priority. label Nov 21, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T05:46:34.120551Z ca1a7b6 New commits
🔒 Security Review ✅ Completed 2026-11-21T05:48:43.871717Z ca1a7b6 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

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

silo-kody Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

Comment thread web/src/components/AppSidebar.tsx Resolved
@silo-triage silo-triage Bot added bug Something isn't working impact: polish Annoyance, cosmetic, or nice-to-have priority: P2 Limited scope, workaround exists, or polish labels Nov 21, 2026

@Quick104 Quick104 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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)

Comment thread web/src/components/AppSidebar.tsx Resolved
Quick104 and others added 3 commits November 21, 2026 00:13
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]>
@silo-triage silo-triage Bot added size/M 50–199 added + deleted lines (all files); change volume, not priority. and removed size/S 0–49 added + deleted lines (all files); change volume, not priority. labels Nov 21, 2026
@silo-kody

This comment has been minimized.

@Quick104 Quick104 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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: preventDefault on a dropped label click also stops its forwarded activation, and no .pointer-reveal is a label today. Nested content: closest() plus contains() 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), hiddenPress stays set, but the next pointerdown resets 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 pointerdown hit.
  • Mid-transition. The exact "0" test lets through a control that is part-way through fading out. That only happens within the 150ms fade on CollectionPosterCard (transition-all) right after a mouse leaves. The sidebar button (transition-none) and SectionRow (transition-colors replaces 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.tsx and useLongPress don't conflict, and React's root listener runs after the guard.
  • Other .pointer-reveal users (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.

Comment thread web/src/lib/pointerCapability.ts Resolved
@Quick104

Copy link
Copy Markdown
Contributor Author

@kody review

Kody's last run on 69981ae produced one comment that couldn't be posted.

🤖 Claude Code (claude-opus-5-5)

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

silo-kody Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@Quick104

Copy link
Copy Markdown
Contributor Author

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

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 pointerId adds per-pointer state and depends on click arriving as a PointerEvent with the matching id, which isn't consistent across browsers. A plain first tap on the hidden button is blocked, as intended.

🤖 Claude Code (claude-opus-5-5)

Quick104 and others added 2 commits November 21, 2026 00:43
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

silo-kody Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@Quick104
Quick104 merged commit 93d1cb8 into main Nov 21, 2026
18 checks passed
@Quick104
Quick104 deleted the fix/sidebar-unpin-button-reveal branch November 21, 2026 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working impact: polish Annoyance, cosmetic, or nice-to-have priority: P2 Limited scope, workaround exists, or polish size/M 50–199 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant