Skip to content

fix(oc-docs): center collapsed search overlay within the docs area - #133

Merged
bijin-bruno merged 1 commit into
opencollection-dev:mainfrom
vasharma05-bruno:fix/oc-docs-search-overlay-centering
Jul 21, 2026
Merged

fix(oc-docs): center collapsed search overlay within the docs area#133
bijin-bruno merged 1 commit into
opencollection-dev:mainfrom
vasharma05-bruno:fix/oc-docs-search-overlay-centering

Conversation

@vasharma05-bruno

@vasharma05-bruno vasharma05-bruno commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

What & why

Below desktop, the endpoint search collapses to an icon that opens an overlay panel. Its positioning was gated on viewport @media queries — but the topbar/sidebar responsive mode is derived from the docs-area width (so the inline playground can shrink the docs chrome while the window stays wide).

When the inline playground shrinks the docs column under 1024px on a wide screen, the JS switches to the collapsed icon layout, but none of the viewport media queries fire. The overlay then fell back to the desktop rule and centered on the narrow, left-aligned field — hanging off the left edge of the screen.

Fix

  • Drive the collapsed overlay off the shell's docs-area-derived mode via a collapsed prop on SearchBar → a data-collapsed attribute, instead of viewport media queries.
  • When collapsed, the field wrapper spans the full reveal row so the position: absolute panel centers within the docs area. .appshell-body is overflow: hidden + a container, so the panel stays inside the docs column and never leaks into the playground pane. position: fixed is dropped entirely.
  • AppShell passes collapsed={!isDesktop}, so SearchBar always agrees with the container the Topbar renders (both derive from the same docs-area mode).
  • Consistency cleanups in the search + topbar styles: z-index via the --z-popover token (the overlay no longer risks rendering under other layers), the results scroll region derived from the panel cap so the two can't desync, and a --topbar-height token.

Screenshots

Collapsed search opened while the inline playground shrinks the docs area on a wide window.

Before — panel hangs off the left edge (placeholder/chips clipped):

image

After — panel centers within the docs area:

image image image

Testing

  • npm run lint — clean on the touched files
  • npm run test:run — 902/902 unit tests pass
  • npm run test:e2e -- search/search.spec.ts — 18/18 pass (incl. tablet/mobile viewport cases)
  • Manually verified the split-view scenario (wide window + inline playground, docs area 900px): the panel centers with a 0px offset from the docs-area center (was −115px, hanging off-screen left).

🤖 Generated with Claude Code

Below desktop the search collapses to an icon that opens an overlay. Its
positioning was gated on viewport media queries, but the responsive mode is
derived from the docs-area width — so when the inline playground shrinks the
docs column on a wide window, the overlay fell back to the desktop rule and
hung off the left edge of the screen.

Drive the collapsed treatment off the shell's docs-area mode via a `collapsed`
prop / `data-collapsed` attribute instead of viewport media queries. When
collapsed, the field wrapper spans the full reveal row so the absolute panel
centers within the docs area rather than on a left-aligned field. Includes
token/consistency cleanups in the search + topbar styles (z-index token,
scroll region derived from the panel cap, --topbar-height).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bijin-bruno
bijin-bruno merged commit 407ba7c into opencollection-dev:main Jul 21, 2026
1 check passed
@vasharma05-bruno
vasharma05-bruno deleted the fix/oc-docs-search-overlay-centering branch July 23, 2026 14:42
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.

4 participants