Skip to content

Touching sidebar thread rows can persist the desktop hover inset and Archive action #3832

Closed

Description

@hxy91819

Summary

Touching a sidebar thread row on a device whose primary input cannot hover can leave the row in a synthesized :hover state. The thread title then gains the desktop-only 30px right inset and shifts/truncates even though the quick-action overlay is unavailable on a compact touch layout; on wider touch layouts the desktop Archive action can also appear persistently. Expected: touch interaction must not activate layout or actions intended only for a hover-capable pointer.

Versions and environment

  • bb desktop-v0.43.1, reproduced from source at 267938526dfcbc0edb228ce827b5bec202c1af97
  • Linux 6.8 aarch64, Node v22.19.0
  • Rendered sidebar story with the primary-pointer media features set to (hover: none) and (pointer: coarse); verified at compact and 1280px viewport widths
  • Not provider specific

Steps to reproduce

  1. Run bb at the commit above on a touch browser, or emulate a primary pointer with hover: none and pointer: coarse.
  2. Open the sidebar and use a project with a long thread title.
  3. Tap the thread row so the browser synthesizes :hover.
  4. Observe the title width and trailing actions after the tap.
  5. Repeat at a viewport wider than 767px.

At 767px or narrower, the quick-action overlay remains hidden but the title still receives the hover inset. Above 767px, the old touch override does not apply at all, so the inset and desktop hover actions can both persist.

Expected vs actual

Expected on a touch-only primary pointer:
- padding-right: 0
- desktop quick actions hidden unless their menu is explicitly open
- tapping a row does not change the title's layout

Actual after synthesized :hover:
- padding-right: calc(var(--spacing) * 7.5) (30px)
- compact layout: title shifts/truncates while the overlay remains hidden
- wider touch layout: desktop hover actions can become visible and remain under the synthesized hover state

Evidence

The desktop hover rule applies the 30px inset to every hovered row:

.bb-sidebar-hover-actions-row:is(:hover, :has(:focus-visible))
.bb-sidebar-hover-actions,
.bb-sidebar-hover-actions[data-sidebar-hover-actions-open="true"] {
pointer-events: auto;
opacity: 1;
}
/* Row content beside a hover-actions overlay that grows past its rest slot
* (the thread row's archive button sits left of the menu trigger). Reserve
* one action width under the same row states that reveal the overlay, so the
* title truncates instead of running under the button. */
.bb-sidebar-hover-actions-inset {
transition-property: padding;
transition-duration: 0ms;
}
.bb-sidebar-hover-actions-row:is(:hover, :has(:focus-visible))
.bb-sidebar-hover-actions-inset,
.bb-sidebar-hover-actions-row:has(
.bb-sidebar-hover-actions[data-sidebar-hover-actions-open="true"]
)
.bb-sidebar-hover-actions-inset {
padding-right: calc(var(--spacing) * 7.5);

The intended touch override is limited to max-width: 767px and pointer: coarse, and its inset selector has lower specificity than the active hover rule, so padding-right: 0 loses in the cascade:

@media (max-width: 767px) and (pointer: coarse) {
/* The overlay is hidden on coarse phones, so no room is reserved. */
.bb-sidebar-hover-actions-row .bb-sidebar-hover-actions-inset {
padding-right: 0;
}
.bb-sidebar-hover-actions-row:hover:not(:has(:focus-visible))
.bb-sidebar-hover-actions:not(
[data-sidebar-hover-actions-open="true"]
):not([data-sidebar-hover-actions-mobile="always"]) {
pointer-events: none;
opacity: 0;
}
.bb-sidebar-hover-actions-row:hover:not(:has(:focus-visible))
.bb-sidebar-hover-actions-fade:not(
[data-sidebar-hover-actions-open="true"]
) {
opacity: 1;
}
.bb-sidebar-hover-actions[data-sidebar-hover-actions-mobile="always"] {
pointer-events: auto;
opacity: 1;
}

The thread quick-action container is hidden only for compact coarse-pointer layouts, leaving wider touch layouts exposed to the desktop action behavior:

<div
data-sidebar-hover-actions-open={
isActionsOpen ? "true" : undefined
}
className={cn(
SIDEBAR_HOVER_ACTIONS_CLASS,
"absolute inset-y-0 right-0 z-10 flex items-center justify-end max-md:pointer-coarse:hidden",
)}
>
<SidebarRowControls
primaryAction={
<ThreadArchiveQuickAction
thread={thread}
className={SIDEBAR_CONTROL_BUTTON_CLASS}
/>
}
>
<ThreadActionsMenu
thread={thread}
triggerClassName={SIDEBAR_CONTROL_BUTTON_CLASS}
onOpenInSplit={splitAvailable ? openInSplit : undefined}
onOpenChange={setIsDropdownActionsOpen}
/>
</SidebarRowControls>

A verified fix scopes suppression to (hover: none), matches the synthesized-hover selector strongly enough, and preserves keyboard focus and explicitly open menus: hxy91819@ac8417d

Investigation and rendered verification: https://ampcode.com/threads/T-01a0ae07-1fbf-733b-ae7e-ea058143971f

What I ruled out

  • Searched open and closed issues for touch/coarse-pointer sidebar hover, persistent Archive actions, and thread-title shifting; no duplicate found.
  • Not a duplicate of Sidebar: hovering a parent thread row moves the disclosure chevron and puts the quick Archive button under it #3821: that issue is a fine-pointer desktop bug where a parent row's disclosure target moves under Archive. This bug affects touch-only primary pointers, including leaf rows, because browsers synthesize :hover.
  • Not limited to phone width: the existing media query stops applying above 767px even when the primary pointer still cannot hover.
  • Keyboard focus and an explicitly open actions menu still need to reveal/reserve the controls; the fix preserves both states.

Suggested priority and effort

Medium impact, low effort. It affects touch users whenever the browser preserves synthesized hover; the visible title jump is frequent, and wider touch layouts can expose a destructive desktop-only Archive shortcut. Navigating away clears the state, but there is no reliable in-place workaround.

AGENT GENERATED

Activity

  1. added theissue type on Sep 17, 2026
  2. added
    ui
    mobile
    partial-repro
    on Sep 17, 2026
  3. bb-slop-cop commented on Sep 17, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    Applied Bug · Priority: Medium · Effort: Low, with ui, mobile, and partial-repro.

    Reproduction and root-cause report: PARTIALLY REPRODUCED, medium overall confidence. Two clean checkouts of trusted main produced the 30px inset at 390px and 1280px, plus visible actions at 1280px, in a rendered CSS fixture with forced hover. The unconditional hover selector outranks the compact inset reset; touch suppression also ends at 767px.

    No PR: persistent hover after a native tap in the full sidebar remains unverified, so the automatic-fix reproduction gate was not met.

    AGENT GENERATED

  4. hxy91819 commented on Oct 3, 2026

    @hxy91819
    Author

    Checked this against desktop-v0.45.0 (129f6217), which includes #4114.

    #4114 scopes the touch reset to @media (max-width: 767px) and (pointer: coarse), so phones are fixed. The same synthesized :hover still shifts rows on touch devices wider than 767px: a tablet in landscape or a touch laptop with the sidebar open still reveals Archive and adds the 30px inset on tap.

    A fork change generalizes the rule to the input capability rather than the viewport: hxy91819@d74c70b4b

    • The suppression lives under @media (hover: none), matching devices whose primary input cannot hover at any width.
    • It targets .bb-sidebar-hover-actions-row:hover:not(:has(:focus-visible)):not(:has([data-sidebar-hover-actions-open="true"])), so keyboard focus and explicitly opened action menus keep their inset.
    • A theme.test.ts case asserts the rule has no max-width bound.

    Diff is 2 files, +26/−13 on top of 0.45.0. If the remaining scope here is only phones, this issue can be closed by #4114; otherwise the wider-than-767px case is what is left.

    AGENT GENERATED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    mobilepartial-reproui

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions