Skip to content

feat(panel): the desktop panel is as tall as its content - #495

Merged
Ardnived merged 12 commits into
mainfrom
ux/panel-fits-content
Nov 26, 2026
Merged

Ardnived merged 12 commits into
mainfrom
ux/panel-fits-content

Conversation

@Ardnived

@Ardnived Ardnived commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • At ≥1024px the floating panel ends under its view (up to the frame less 32px), so it covers less map.
  • Height changes ease over 200ms (none under reduced motion). Phones, the wide calendar and map-less are unchanged.
  • Joined: the location prompt and Load more carry 16px under themselves, so a panel never ends flush on them.
  • Joined: while someone types in a search box, the panel takes the full height so suggestions fit (feat(search): a search box under the title on every place page, loading and error screens included #485 put one under every title).
  • Joined: "We couldn't find that place." shows in the suggestions' spot and look, once typing pauses.
  • Joined: the suggestion list now starts at the field and ends at its band; on SearchView it overran the field.
  • Joined: a list view's empty state no longer fills the body, which had pushed the location prompt out of view.

Change outline

Components — the cross-fade gives the panel its height

The view layers used to be absolute inset-0, so they added no height. They now share one grid cell and stay in flow. With no <style> injection, the #236 shadow-root fix holds.

 DrawerStack                                    src/views/DrawerStack/DrawerStack.tsx
   DrawerContent
-    div.relative.min-h-0.flex-1
+    div.grid.min-h-0.flex-1.grid-cols-1.grid-rows-1
       AnimatePresence
-        ViewLayer  absolute inset-0 flex-col    src/views/DrawerStack/ViewLayer.tsx
+        ViewLayer  col-start-1 row-start-1 min-h-0 flex-col   # outgoing + incoming overlap in the cell

Contract — the left panel variant at ≥lg

 drawer.variants.direction.left.content         src/components/atoms/Drawer/Drawer.tsx
-  lg:inset-y-4                                 # always full height
+  lg:top-4 lg:bottom-auto                      # height comes from the view
+  lg:max-h-[frame-h − 32px]                    # a long list fills it, then scrolls inside
+  lg:has-[[role=search]:focus-within input:not(:placeholder-shown)]:h-[frame-h − 32px]   # typing → full height
 wide calendar compound: lg:!inset-4            # unchanged, still overrides top/bottom

The full-height rule keys on the typing session (the search holds focus and text), not on the list being open: Mapbox opens and closes the list on every response, and a panel following aria-expanded grew and shrank between keystrokes. It works wherever the field sits: header, toolbar, or under a wrapped title.

Flow — easing a content-driven height

A CSS transition never fires here, because the height stays auto while only the content changes. So the atom eases it with the Web Animations API, in an effect beside useSheetDragClaim.

 DrawerContent                                  src/components/atoms/Drawer/Drawer.tsx
   useSheetDragClaim(bottom sheet ? panel : null)
+  eases = left && anchored && !wide && !usePrefersReducedMotion()
+  useLayoutEffect, while `eases` and ResizeObserver exists
+    ResizeObserver(panel)
+      first delivery → seed `last`
+      an ease is running → skip            # the return to `auto` re-fires and eases the rest
+      height changed → panel.animate(height last → next, 200ms ease-out)
+    cleanup → disconnect, cancel           # a layout effect, so the wide calendar never eases

Behaviour — "We couldn't find that place."

It used to be a line under the field that toggled with each keystroke's response and pushed the panel down 28px each time.

 MapSearch                                      src/components/organisms/Mapbox/MapSearch.tsx
   onChange(text) → setSearchQuery
+                 → foundNothing = false        # pending until this text's own answer
   onSuggest(empty, no scope) → foundNothing = true
+  foundNothing held for 300ms → settledNothing # one answer per typing pause
-  {foundNothing && <p role=status> under the field}
+  <p role=status> always mounted, absolute 10px under the field, styled like .Results, empty → hidden

Behaviour — the suggestion list's width

--sy-results-w used to be the band's container width (100cqi, #370), which assumed the field starts the band. SearchView's Back comes first, so the list overran the field by 28px and the panel by 3px (28px off a 390px screen).

 Drawer header / DrawerToolbar field            src/components/atoms/Drawer/Drawer.tsx
-  [container-type:inline-size] [--sy-results-w:calc(100cqi - 2px)]
+  sy-results-band                              # a marker only
 MapSearch                                      src/components/organisms/Mapbox/MapSearch.tsx
+  ResizeObserver(field, band) → --sy-results-w = band content end − field start − 2   (mirrored in RTL)

Behaviour — who owns the space under the last block

Every block that can close a panel already carries its own bottom space (rows, EventDetails, fallbacks, form bodies) except these two.

 GeolocationSuggestion wrapper                  src/views/shared.tsx
-  above: —          below: pt-3      (prompt: mb-2)
+  above: pb-2       below: pb-4      (prompt: no margin of its own)
 LoadMore, while more remain                    src/components/organisms/EventsList/LoadMore.tsx
-  pt-4 pb-6
+  py-4
 START_BODY (a list view's empty state)         src/components/molecules/Fallbacks/Fallbacks.tsx
-  flex h-full flex-col …                       # filled the body, pushing the prompt below it out of view
+  flex flex-col …

Preview

  • App and Ladle previews pending (Cloudflare posts the branch alias once the PR's build lands).
  • Pages to open, at a 1280×800 window:
    • /gb/south-east/london/balham-library — the panel ends under two classes and the prompt
    • /gb/south-east/london — a long list fills the height and scrolls inside
    • /gb/midlands/coventry/1493/share — Share ends under its content
    • /gb?langs=zu, then type Lon in the search box — the short panel grows once to full height and all suggestions show. Click the map and it shrinks back.
    • /search?q=London, then type Lon — the list lines up with the field, beside Back
    • /gb?langs=zu, then type Xqzv — no bounce while typing, then "We couldn't find that place." in the list's spot
    • /calendar — the month grid keeps its full size. Switch to List: the narrow panel, which scrolls

Test results

  • Lean gate (lint + typecheck + test:run): ✓ (2504 passed, 1 skipped)
  • Drawer.results.test.tsx now pins the band marker instead of the container width.
  • New spec Drawer.ease.test.tsx: 8 passed. Each rule watched failing with it removed.
  • New spec MapSearch.not-found.test.tsx: 3 passed (the pause, a superseded answer, withdrawal on typing). Each watched failing against its rule removed.
  • ViewLayer.test.tsx now pins the shared grid cell.
  • Build: not run locally. CI runs it, including assert:css.

Manual verification

  1. At 1280×800, click from /gb down to a class and back. The bottom edge eases. Under DevTools → Rendering → "prefers-reduced-motion: reduce", it changes at once.
  2. On a short place page, type in the search box. The panel grows once and stays while you type, picking a suggestion still lands, and clicking away shrinks it.
  3. At 390×844 and 900×1024 the layout matches main.
  4. Switch to the dark theme: the shorter panel's edge and shadow look right.
  5. On Windows (classic scrollbars), navigate to a taller view. A scrollbar may show inside the panel for the 200ms of a growing ease.

Notes for reviewer

  • The proposal on ux/polish (2e01942) measured the layer in JS and wrote --sy-panel-h / --sy-panel-room. This replaces it with CSS sizing plus a ~30-line effect in the Drawer atom, so there is no viewport read, no vaul.css edit and no src/styles/ security trigger.
  • Main (with feat(search): a search box under the title on every place page, loading and error screens included #485) is merged in. A first fix kept ≥400px on panels holding the search box, but that assumed the field sits in the header. Under a title, the fourth suggestion was cut off, so it became "full height while suggestions are open", then "while typing", after the panel was seen following Mapbox's list open and close on every response.
  • Accepted: at the height cap, dragging the window height lags the edge by up to 200ms. From 768px to 1023px the hook is armed but the panel is full height, so only a window resize eases there.
  • Dismissed review findings:
    • "The calendar's list view loses its height": measured, the panel is 768px and the list scrolls inside.
    • A generic 16px body inset was built, then replaced. It stacked on the closing space every block already carries (56px under a class, 40px under empty states), and its list exemption missed the search list's wrapper div.
  • CENTERED_BODY's four centring classes are inert at ≥lg now, and they stay. Measured at 1280×800 against the class chain: a 768px panel centring at 304.5px auto margins becomes a 159px panel at 0, because h-full takes the body's own content height. They are still the fix for fallbacks that were invisible on every phone, so only the docblock's desktop claim changed.
  • Breaking the suggestions out of the panel would mean moving Mapbox's listbox out of the vaul panel, reaching into the geocoder's DOM and Radix's outside-click handling. Left for a ticket if wanted.
  • Open feat(widget): submit or correct a class, and opt into a mailing list #318 also edits DrawerStack.tsx, so one of the two will need a small rebase.
Detail

Measured at 1280×800 on this branch (main: 768px everywhere):

Page Panel height
Balham Library 494
UK, no-match filter 386, then 768 while suggestions are open
Start page, no-match filter 312, then 768 while suggestions are open
London 768, scrolls inside

The first painted frame of a growing ease is the old height. The animation starts inside the ResizeObserver callback, which runs before paint, so no frame flashes at the new height.

🤖 Generated with Claude Code

Ardnived and others added 3 commits November 25, 2026 16:27
On a computer the floating panel ran the full height of the window even
around two classes, so most of it was blank white over the map. At 1024px
and wider it now ends under its view, up to the frame's height less its
margins, and a long list still fills it and scrolls inside.

The view layers share one grid cell instead of being absolute, so they stay
in flow and give the panel its height with no measuring in JS. A height
change eases over 200ms through the Web Animations API, since a CSS
transition never fires while the height stays `auto`; reduced motion skips
it. Phones, the full-width calendar and map-less embeds are unchanged.

Every drawer body now ends with a 16px inset that mirrors the header's top,
so whatever closes a view (the location prompt, an alert, Load more) sits as
far off the bottom edge as the header does off the top. A body ending in a
list keeps its rows' own padding instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The atom owns the panel element and the inputs that make it content-sized,
so the easing hook runs beside `useSheetDragClaim` there: DrawerStack loses
its element state and the hook its DOM climb. It seeds from the observer's
first delivery, and a spec now holds its four rules.

Every block that can close a panel already carried its own bottom space but
the location prompt and Load more, so those two carry 16px instead of the
body adding an inset that stacked on the rest (the class page, empty states,
search results).

A panel holding the place search keeps room for its suggestions, which open
inside it and now scroll past a cap rather than being cut off by a short
panel.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sydevs-dispatcher

sydevs-dispatcher Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

🤖 no session running
conflict held since 23:31Z, waiting for the base to settle

recent dispatches
  • 00:00Z address-review · attempt 1 · session · done
  • 00:00Z address-review · attempt 1 · session
  • 23:49Z review-pr · attempt 1 · session · done
  • 23:49Z review-pr · attempt 1 · session

Written by the sydevs dispatcher. Sessions never edit this comment.

Ardnived and others added 2 commits November 25, 2026 16:32
#485 put a search box under every place title, so the 400px floor that
assumed the field in the header no longer fit the suggestions. Any floor
breaks whenever the field moves; instead, while the combobox reports
`aria-expanded="true"` the panel takes the full height, eased, and the list
cap goes. A list view's fallback no longer fills the body either: in a panel
sized to its content that pushed the location prompt below it out of view.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sydevs-dispatcher sydevs-dispatcher Bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 25, 2026
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Pending to Working in SYDevelopers Technical Roadmap Nov 25, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
sahajatlas-design cdf3757 Nov 26 2026, 12:03 AM

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧐 Adversarial review

The shape is right. CSS owns the height, a ~30-line hook owns only the easing CSS cannot do, and each spacing edit follows from one new fact: a panel may now end here. Nothing is smuggled in.

top-4, the cap and the suggestions rule all key on --sy-frame-h, so a contained embed clamps to its frame, not the window. The lg: residue stays a float-or-not decision.

One gap: the diff reasons about START_BODY and leaves CENTERED_BODY, whose centring depended on the panel being full height.

Findings

  • should-fix — CENTERED_BODY's h-full and auto margins centre nothing in a content-height panel, and its docblock still claims they do. Fallbacks.tsx:817.
  • should-fix — Streamline: use-ease-height.ts is a module hosting one one-caller effect. Line 10.

What was checked

Read whole on the branch: the 14 changed files, plus shared.tsx, geocoder-dom.ts, sheet-touch.ts.

  • Ladder, useEaseHeight. No platform answer: auto → auto fires no transition, so the JSDoc holds. No dependency added. Streamliner: 2 pieces walked, 1 finding, START_BODY kept.
  • The suggestions coupling holds at both ends. role="search" occurs once (shared.tsx:253) and MapSearch renders nowhere else, so the rule reaches every geocoder in a panel; geocoder-dom.ts seeds aria-expanded and the library keeps it. It is the repo's only has-[ utility, and such a class fails silently — the measured table is the only evidence.
  • ViewLayer stopped being a positioned ancestor. Every absolute under src/views and the drawer-rendered molecules has a relative parent, and --sy-footer-h still publishes on the layer (#312).
  • No contract surface touched; CHANGELOG.md carries the host-visible entry and docs/embedding.md documents no panel geometry. Every path the body names exists.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 26, 2026
@sydevs-dispatcher sydevs-dispatcher Bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 26, 2026
claude and others added 5 commits November 26, 2026 00:01
…ults show

Mapbox opens and closes its list on every response, so a panel following
`aria-expanded` grew and shrank between keystrokes. It now takes the full
height for the typing session: while the search holds focus and text.

"We couldn't find that place." toggled under the field on each response and
pushed the panel 28px each time. It now waits for a 300ms pause on an empty
answer, and shows in the suggestion list's spot and look, overlaying rather
than pushing. Its status region stays mounted so the text is announced.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`use-ease-height.ts` hosted one effect with one caller, and `DrawerContent` already
carries an equivalent inline `ResizeObserver` effect in `DrawerFooter`. The gate becomes
the effect's condition, so the module and its re-export of the panel argument both go.

The spec drives `DrawerContent` through vaul instead of the hook, as `Drawer.scroll` and
`Drawer.snap` already do, and keys the fake observer by the element it was given so a
second observer in the tree cannot answer for the panel's. That buys four variant cases
the hook-level spec could not state: bottom, right, `filled` and wide each observe
nothing. Every rule watched failing with it removed.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVoQUZCUt4jqo5QjdM
`CENTERED_BODY`'s docblock claimed its `max-h` was correct on the desktop panel because
the body is the visible area there. A content-height panel makes the body its own
content, so the cap never binds and both auto margins collapse — the centring is the
bottom sheet's alone now. Measured at 1280×800 against the class chain: a 768px panel
centring at 304.5px margins became a 159px panel at 0.

The four classes stay. They are the fix for states that were invisible on every phone,
and inert is not the same as spare.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVoQUZCUt4jqo5QjdM
@sydevs-bot

Copy link
Copy Markdown
Contributor

Both critic threads built and resolved.

  • Streamline, use-ease-height.ts — folded into DrawerContent (0ab5782). Drawer.ease.test.tsx drives the atom through vaul, as Drawer.scroll and Drawer.snap already do, and gains four variant cases.
  • CENTERED_BODY at ≥lg — measured at 1280×800: a 768px panel centring at 304.5px margins becomes a 159px panel at 0. The four classes stay, as the phone fix. 32a0d4b corrects the docblock's desktop claim.

origin/main (3d6e8b7) and your cdf3757 are both merged in, cleanly. Lean gate on the merged tree: 2504 passed, 1 skipped. No security-trigger path touched.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 26, 2026
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Working to Pending in SYDevelopers Technical Roadmap Nov 26, 2026

@sydevs-dispatcher sydevs-dispatcher Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved for Ardnived, who wrote it: GitHub refuses an author's own approval. CI is green and the automated review has run. Enable auto-merge when you want it merged: the queue tests it against its base. 🤖 Written by the sydevs autonomous loop — see what this is

@sydevs-dispatcher sydevs-dispatcher Bot moved this from Pending to Awaiting in SYDevelopers Technical Roadmap Nov 26, 2026
Ardnived and others added 2 commits November 25, 2026 17:25
…band

The list took the band's full width (#370) on the assumption that the field
starts the band. On SearchView, Back comes first, so the list ran 28px past
the field and off the panel (off the screen on a phone). MapSearch now
measures the span from the field to the band's end and hands it to the list;
the start page still covers the strip under Filters, as #370 intended.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Ardnived
Ardnived added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit a64676b Nov 26, 2026
14 checks passed
@Ardnived
Ardnived deleted the ux/panel-fits-content branch November 26, 2026 00:41
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Awaiting to Done in SYDevelopers Technical Roadmap Nov 26, 2026
sydevs-bot pushed a commit that referenced this pull request Nov 26, 2026
Nine conflicts. `main` landed #495, a desktop panel as tall as its view, and
#485, a search field under every place page's title, while this branch removed
the compact card, the contained map and the `filled` drawer mode.

`Drawer.tsx` — `main`'s height ease stays, so the slot context keeps the `wide`
flag it reads. `filled` is gone, so `showHandle` loses that arm and the real
drawer is always `anchored`. `Drawer.ease.test.tsx` loses its `mode: 'filled'`
case for the same reason: there is no such panel left to leave uneased.

`src/views/fallbacks.tsx` — `main`'s shape, with the field band and without
`SearchButton`, plus this branch's `isPlace` on the header.

`Icons.stories.tsx` and `translations.en.json` — both sides' additions. Each
glyph has its own call site, and the gallery spec checks both directions.

`components/AGENTS.md`, `DESIGN_SYSTEM.md`, `Fallbacks.tsx` — prose where both
sides rewrote one line. The geometry class names and the `Disclosure` row are
`main`'s; the reasons beside them are this branch's, since the contained map and
the map-less container `main` names are gone. `CENTERED_BODY`'s note now names
the inline column, the one surface left where the body IS the visible area.

`CHANGELOG.md` — every entry stays, `main`'s three above this branch's, which
keeps the place the branch chose for its own.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjUybd1Bs7yKWy9HkV7
sydevs-bot pushed a commit that referenced this pull request Nov 26, 2026
main reworked the geocoder field (#485, #495), the drawer snaps (#492, #495)
and the panel header (#490) while this branch was open. Every hunk keeps both
sides' behaviour.

- `MapSearch` keeps this branch's controlled `value`/`onChange` — the Where
  step holds the draft's text, `SearchField` holds `?q` — and takes main's
  settle delay, measured results band and overlaying not-found message. Main's
  new spec held the text inside the field, so it now owns it the way both
  callers do; watched failing against the settle removed.
- `NavHeader` takes main's `pendingTitle`, without its `t`: the X it named is
  this branch's `CloseButton`, which brings its own.
- The mobile snap reads `opensTall(kind)` over main's `fitsContent`, so
  calendar, add and correct stay tall and event and Share still fit their own
  content. The two predicates are disjoint.
- `EventHeader` takes a `title` rather than an event since #490, so the submit
  listing and its story pass one.
- `CHANGELOG.md`, `DESIGN_SYSTEM.md` and the two import hunks are unions.
  DESIGN_SYSTEM.md is rebuilt on main's restructure, carrying this branch's
  `ProposalForm` row, `SubmitView`, `CloseButton` and the `Link` footnote note.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjY4MwaWAk4ZhpqxBB5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants