Skip to content

Keep T3 Sidebar child menus inside compact viewports - #2108

Open
Willhong wants to merge 2 commits into
get-bb:mainfrom
Willhong:fix/t3sidebar-compact-menu-position
Open

Keep T3 Sidebar child menus inside compact viewports#2108
Willhong wants to merge 2 commits into
get-bb:mainfrom
Willhong:fix/t3sidebar-compact-menu-position

Conversation

@Willhong

Copy link
Copy Markdown
Contributor

What was wrong

T3 Sidebar unconditionally positioned its 20rem child menu with absolute right-0 relative to the header chip. Compact headers can place that chip farther left than the menu width, producing a negative left edge and clipping the menu outside the viewport. Fixes #2104. Standalone counterpart: SawyerHood/bb-plugin-t3sidebar#3.

What changed

  • Keep desktop placement unchanged (absolute right-0).
  • On compact viewports, preserve the 20rem maximum width and the trigger's preferred right alignment.
  • Clamp the computed left coordinate only when the preferred position would cross the 8px viewport gutter.
  • Recompute on window and visual-viewport resize/scroll so rotation and browser chrome changes stay aligned.
  • Add regression coverage for the unclamped, clamped, and desktop branches.
  • No host-daemon wire, public plugin API, CLI, configuration, guide, or documentation changes.

How you verified

  • pnpm exec turbo run test typecheck --filter=bb-plugin-t3sidebar — 83 tests passed; typecheck passed.
  • Compact geometry at 390px:
    • trigger right 380px → preferred/aligned left 60px remains 60px
    • trigger right 250px → negative preferred left clamps to 8px
  • The desktop regression keeps absolute right-0 w-80.
  • iPhone 17 / iOS 26.4 Simulator Safari reproduced the pre-fix clipping.

Fixes #2104

AGENT GENERATED: by GPT-5.6

@Willhong

Copy link
Copy Markdown
Contributor Author

Standalone implementation counterpart: SawyerHood/bb-plugin-t3sidebar#5

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.

T3 Sidebar child-thread menu clips outside compact viewports

1 participant