Skip to content

Pad skip, named dialogs, and focus traps #248

Open

Description

@HMarzban

What to build

Give the pad a skip link that lands on a real main landmark. Name Share, Make Private, and Sign out as dialogs. Trap focus in the TOC drawer and in BottomSheet.

Home and Legal already have skip and main. Do not change those pages. This is not caret find and not #247.

Acceptance criteria

  • Desktop and phone pad: a skip link exists and moves focus into a real main landmark.
  • Desktop and phone pad: that landmark is a main, or role main, with an id the skip target uses.
  • Share, Make Private, and Sign out expose their visible title as the dialog name.
  • Opening the TOC drawer keeps Tab inside the drawer until it closes.
  • Opening a BottomSheet keeps Tab inside the sheet until it closes.
  • Closing the drawer or a sheet returns focus to the control that opened it.
  • Home and Legal skip links still work.

Agent Brief

Category: enhancement
Summary: Pad skip plus main, named Share / Make Private / Sign out, and focus contain on the TOC drawer and BottomSheet.

Current behavior:
Home and Legal skip to a real main. The pad has no skip and no main. A skip with no target is a dead link. The pad header is not a main landmark. Breadcrumb nav and a named chat region appear only when chat is open.

Share, Make Private, and Sign out show a heading that is not wired as the dialog name. Sign in, Profile, and History restore already have a name.

The TOC drawer is a checkbox drawer. BottomSheet has no house focus trap. Centered dialogs already trap. Hardware Back can close those surfaces on a phone. It does not trap focus or restore it.

Desired behavior:
Add one skip control on the pad. Point it at a real main that wraps the document. Do not skip to an id that does not exist.

Wire Share, Make Private, and Sign out so the visible title is the accessible dialog name. Use the same naming pattern Sign in already uses. Do not restyle those dialogs.

When the TOC drawer is open, Tab stays inside it. When a BottomSheet is open, Tab stays inside it. Escape or the existing close control still closes them. Focus returns to the opener. Do not put the Chat pane on a sheet. Do not change docked control size.

Key interfaces:

  • Skip link — same job as Home and Legal; must have a live main target
  • Main landmark — one per pad layout, desktop and phone
  • Dialog name — visible title names Share, Make Private, and Sign out
  • TOC drawer — modal focus contain while open
  • BottomSheet — modal focus contain while open

Out of scope

Activity

  1. HMarzban commented on Sep 9, 2026

    @HMarzban
    CollaboratorAuthor

    Parent epic is #249. This issue is the pad skip and focus slice. Find is #250. Slash is #251.

  2. HMarzban commented on Sep 9, 2026

    @HMarzban
    CollaboratorAuthor

    iOS and macOS Safari

    • VoiceOver: the skip control must land in a real main. Check the rotor Landmarks list on the pad.
    • TOC drawer and BottomSheet: swipe or Close still dismiss. VoiceOver must not leave focus in the page behind.
    • Hardware Back already closes these on a phone. Also restore focus to the opener.
    • Do not grow docked controls past 32 by 32. Phone Settings already uses 44px where it needs it.
    • Share / Make Private / Sign out must expose the visible title on iOS sheets and on macOS Safari dialogs.
  3. HMarzban commented on Sep 9, 2026

    @HMarzban
    CollaboratorAuthor

    Safari follow-up from iOS a11y skip traps:

    • Document Share is desktop-only today. Do not add a phone Share surface in this issue.
    • Phone Sign in already uses a sheet. Leave that title work out of Pad skip, named dialogs, and focus traps #248 unless it is the same Sign out / Make Private naming pass.
  4. added this to the v2.3.0 milestone on Oct 24, 2026
  5. HMarzban commented on Nov 3, 2026

    @HMarzban
    CollaboratorAuthor

    Status, 2026-11-03. Built in 1098ca4 and f667410, which ship in v2.1.0. The follow-up fixes bd71f71 (#310, Tab during the sheet open tween) and dd8f13c (#309, skip link after a heading deep link) are pushed and deployed on 2026-11-03. Left:

  6. HMarzban commented on Nov 3, 2026

    @HMarzban
    CollaboratorAuthor

    #355 device check, Android row, 2026-11-03. Local stack, production build, Android emulator (Pixel 9, Android 17, Chrome 145), pad /qa-device-ro-1026, signed out. TalkBack speech could not be captured on the emulator (no spoken text in logcat, injected swipes did not move focus), so this reads the accessibility tree that TalkBack uses: CDP Accessibility.getFullAXTree and uiautomator dump.

    • Skip link: pass. The first node is button "Skip to main content". The page has one main (main#pad-main, tabindex=-1). Tab then Enter puts focus on it.
    • Dialog names: Share, Make private and Sign out need sign-in, so they were not run. Dialog "Link" and dialog "Document settings" match their visible titles. The TOC drawer is dialog "Table of contents", aria-modal=true.
    • TOC drawer focus: pass. Tab and Shift+Tab wrap inside, the background leaves the AX tree, and Escape returns focus to "Open menu".
    • Link sheet focus return: fail. Focus the github.com link, press Enter to open the sheet, then Escape (or Close). Focus lands on BODY, not on the link.
    • Header stays exposed under a sheet: fail (tree only). Open menu → Document settings: the drawer returns focus to "Open menu" first, then the sheet opens. floating-ui sets aria-hidden="true" on .mobilePadTitleShell, but Chrome 145 still reports "Open menu" and "Sign in" as ignored=false, and uiautomator still lists "Open menu", "Read-only" and "Sign in". A sheet opened by a tap from a fresh load hides the header correctly. Not confirmed by TalkBack speech.
    • Note: Shift+Tab from Close in Document settings stops once on a floating-ui focus guard outside the dialog, then returns. Same guard as the Sheet focus trap: Tab escapes during the open tween, and the backdrop is an unnamed button #310 caveat.

    The VoiceOver row (iPhone) is not run: the iOS simulator has no VoiceOver. This stays open.

  7. HMarzban commented on Nov 3, 2026

    @HMarzban
    CollaboratorAuthor

    Fix for the two Android findings, 2026-11-03. 9ba583afb. Committed on local main, not pushed yet; the commit link resolves after the push.

    • Focus return: the sheet's opener check skipped everything inside .ProseMirror, so a read-only pad link was never saved as the opener. isContentEditable already keeps the editable editor out, so a link now qualifies. Escape and Close return focus to the link.
    • Header exposed under a sheet: floating-ui set aria-hidden on the header while "Open menu" still held focus. Chrome logged "Blocked aria-hidden on an element because its descendant retained focus" and kept ignoring it. A trapped sheet now blurs its opener in its layout effect, before floating-ui's passive effect. Checked in Chrome's tree and in uiautomator: the header is gone under the sheet.

    Still open here: the VoiceOver row on a real iPhone.

  8. HMarzban commented on Nov 3, 2026

    @HMarzban
    CollaboratorAuthor

    Status, 2026-11-03 (after the 1b05cb2 deploy). The fix for the two Android findings is live. 9ba583afb is on main. It shipped in deploy run 41677887088 (head 1b05cb24d).

    • Focus return: BottomSheet.tsx no longer skips .ProseMirror in the opener check. A read-only pad link now counts as the opener.
    • Header under a sheet: a trapped sheet blurs its opener in its layout effect. That runs before floating-ui sets aria-hidden on the page.

    The Android check of this fix ran on the local stack before the push. Left:

    • The VoiceOver row on a real iPhone. The iOS simulator has no VoiceOver.
    • The Make private and Sign out dialog names on a phone, signed in. The Android row ran signed out.
    • The Share dialog name on desktop or macOS Safari. Document Share has no phone surface.
  9. modified the milestones: v2.3.0, v2.4.0 on Nov 4, 2026
  10. HMarzban commented on Nov 4, 2026

    @HMarzban
    CollaboratorAuthor

    Maintainer ruling, 2026-11-04

    Moved from milestone v2.3.0 to milestone v2.4.0, from the v2.3.0 open-issue review. The code shipped (1098ca4f0, f66741079, 9ba583afb). Only the iPhone VoiceOver rows and the signed-in dialog names are left, and they need a real iPhone.

    The issue stays open. Its remaining items are unchanged.

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

    DesktopFeatureMobileUIenhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions