Skip to content

Fix mobile project action and Thread Info icon alignment - #6367

Merged
ymichael merged 2 commits into
get-bb:mainfrom
dillonzq:fix/mobile-project-icon-layout
Oct 28, 2026
Merged

ymichael merged 2 commits into
get-bb:mainfrom
dillonzq:fix/mobile-project-icon-layout

Conversation

@dillonzq

@dillonzq dillonzq commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Human comments

What was wrong

On mobile, the sidebar's Project settings link was nested inside a menu-item button because the compact DropdownMenuItem ignored asChild. The link's icon missed the menu's flex layout and direct-child sizing, placing a 24px gear above its label.

Thread Info also inherited the provider artwork's intrinsic minimum dimensions. A provider icon with a fixed frame could widen Environment's icon slot and shift its label relative to Project. This reproduces with a controlled provider-icon slot fixture; the reporter's exact iPhone setup remains unverified.

What changed

Honor asChild through Radix Slot in compact dropdown items, so Project settings is the actual menu-item anchor and retains navigation and menu dismissal. Keep disabled links from navigating. Bound Thread Info icon slots to their requested dimensions by resetting minimum width and height. Regenerate the published dropdown-menu registry item, including its Radix Slot dependency.

Investigation, screenshots, and fixture details.

How you verified

  • The shared action-link regression runs against compact and desktop menus. On the base revision, compact fails with expected 'BUTTON' to be 'A'; desktop passes. Both pass after the fix.
  • pnpm exec turbo run test --filter=@bb/app -- src/components/ui/responsive-overlay.test.tsx src/components/plugin/ProviderIcon.test.tsx src/components/secondary-panel/ThreadMetadataContent.test.tsx: 59 tests pass, including existing app-root and deferred drawer realization coverage.
  • pnpm exec turbo run lint typecheck --filter=@bb/app --filter=@bb/shared-ui: passes; app lint retains existing unrelated warnings.
  • pnpm exec turbo run prepare:bundled --filter=bb-plugin-thread-list: passes. Reloaded the rebuilt plugin in the isolated dev app before browser verification.
  • Actual source app in Chromium at 390 × 844: Project settings shrinks from a 60px row / 24px gear to a 36px row / 16px gear. The controlled provider artwork fixture changes Environment's glyph/label starts from x=20/x=46 to Project's x=16/x=38.
  • pnpm exec turbo run test typecheck --filter=@bb/plugin-registry: passes, including the registry freshness check.
  • Linux Playwright WebKit at 320, 390, and 430px touch widths and 1280px desktop width: aligned default Project/Environment rows, single-line Project settings, non-inert app root, and successful project-settings navigation.
  • iOS Simulator Safari and the reporter's physical iPhone were unavailable. Linux WebKit is not an iOS device verification.

Fixes #6366

AGENT GENERATED

@ymichael
ymichael merged commit f4a198f into get-bb:main Oct 28, 2026
49 checks passed
ymichael added a commit that referenced this pull request Oct 28, 2026
)

## Human comments

## What was wrong

On phone-sized coarse-pointer screens, the Info panel's Branch, Merge
base and Git status rows drew 12px icons, while Parent, Project,
Environment and Directory drew 16px. Their labels started 4px further
left. This began with #6157, which moved those rows into the Git plugin
via the SDK `experimental_DetailRow`.

The SDK component is core's own `DetailRow`, so the class list stayed
the same: `size-3 … max-md:pointer-coarse:size-4`. What changed is that
the row now renders inside the Git plugin's root. Plugin sheets compile
into the shared `utilities` cascade layer and load after the app sheet.
The Git plugin uses `size-3` itself, so its sheet emits
`:where([data-bb-plugin="bb--git"], …) .size-3`. That rule has the same
specificity as core's `max-md:pointer-coarse:size-4` and comes later, so
it wins.

Nothing drops the variant. In the live page, the matched rules on the
Branch icon are core `.size-3`, core `@media (width < 48rem) and
(pointer: coarse) .max-md\:pointer-coarse\:size-4`, and the Git plugin's
scoped `.size-3`, last and winning. This is the same ordering problem as
#3691, which made `hidden md:flex` disjoint after the layer change in
#3635 was reverted.

## What changed

- `apps/app/src/components/ui/detail-card.tsx`: `DETAIL_ROW_ICON_CLASS`
is now a single size utility, `size-(--bb-detail-row-icon-size)`, with
no base/variant pair. A plugin sheet re-emitting `size-3` or `size-4` no
longer matches the icon. `cn`/tailwind-merge still drops `Icon`'s
default `size-6` for custom and asset icons.
- `apps/app/src/components/ui/theme.css`: defines
`--bb-detail-row-icon-size` as `calc(var(--spacing) * 3)` on `:root`.
The existing `(max-width: 767px) and (pointer: coarse)` `:root` block
raises it to `* 4`, the same token-override pattern the file already
uses for `--text-*` so responsive values don't fight in the cascade.
- Rebased onto #6367, which added `min-h-0 min-w-0` to
`DETAIL_ROW_ICON_CLASS`. Those are kept, so the class is now
`size-(--bb-detail-row-icon-size) min-h-0 min-w-0 shrink-0
text-subtle-foreground`.
- Every SDK DetailRow from any plugin, and core's own rows using
`DETAIL_ROW_ICON_CLASS`, now resolve the icon size from the token.

No wire, SDK surface, CLI or doc changes. Plugin artifacts do not need
rebuilding.

## How you verified

New test in `apps/app/src/lib/plugin-sdk-app-impl.test.tsx`. It renders
`pluginSdkAppImplementation.experimental_DetailRow` and fails if any
rendered element pairs an unconditional utility with a variant utility
that overrides it (checked with tailwind-merge). Any such pair breaks
once a plugin sheet re-emits the base utility. With main's
`detail-card.tsx` it fails, reporting `size-3 +
max-md:pointer-coarse:size-4`. With this change it passes.

`pnpm exec turbo run typecheck lint --filter=@bb/app` passes. `pnpm exec
turbo run test --filter=@bb/app -- src/lib/plugin-sdk-app-impl.test.tsx
src/components/ui/theme.test.ts src/components/secondary-panel` passes:
54 files, 571 tests.

I checked the live layout on a source dev app (`pnpm dev`), using a
project on a local git repo and a worktree thread with the Info panel
open.

Chromium, 390×844, touch plus `pointer: coarse` emulation (icon box,
label left in CSS px):

| Row | main | this branch |
| --- | --- | --- |
| Parent / Project / Directory (core) | 16×16, 38 | 16×16, 38 |
| Branch (git plugin) | **12×12, 34** | 16×16, 38 |
| Merge base (git plugin) | **12×12, 34** | 16×16, 38 |
| Git status (git plugin) | **12×12, 34** | 16×16, 38 |

iOS 18.4 Simulator Safari (iPhone 16 Pro, 402px wide), measured from
simulator screenshots. On main, Branch, Merge base and Git status labels
start at x≈35.3 with ~9–10px glyphs, while core rows start at 39.3. On
this branch all six of those rows start at 39.3 with matching ~13–14px
glyphs.

On desktop (Chromium 1280×800, fine pointer), every row stays 12×12 with
labels at x=835, and the Info panel region is pixel-identical between
main and this branch.

> AGENT GENERATED

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Michael Yong <review@local>
Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

Mobile: Project settings icon wraps above its label; Thread Info environment icon is offset

2 participants