From 41c77660d38e23e6585e83cbe666f6a38020c9e6 Mon Sep 17 00:00:00 2001 From: bailey <74082460+bmjcoding@users.noreply.github.com> Date: Sun, 22 Nov 2026 18:42:52 -0600 Subject: [PATCH 1/7] The stream's arrival and two hovers read the public plate; the mention picker stops under what is pinned Found by CIMIP adopting B2 and B3 (2026-11-22). B3 made the plate public as --basalt-plate and removed the private --_plate-solid, but B2's arrival plate and panel wash, the notification center's hover and a search passage's hover still read the old name, so an arrived entry showed its word and no fill. They read --basalt-plate now. And at 390 a MentionPicker with many rows opened over the app's bar and a strip stuck under it: opening above, it now stops under the lowest pinned part above the caret (data-pinned-edge="top" or .basalt-sticky-bar), measured on each placement, whether or not the page measures its pinned edges. A test added. Co-Authored-By: Claude Opus 5.5 --- packages/react/src/mention.tsx | 18 ++++++++++- packages/react/src/styles/components.css | 8 ++--- .../react/test/composer-mentions.test.mjs | 31 +++++++++++++++++++ 3 files changed, 52 insertions(+), 5 deletions(-) diff --git a/packages/react/src/mention.tsx b/packages/react/src/mention.tsx index c50007ab..b3270a75 100644 --- a/packages/react/src/mention.tsx +++ b/packages/react/src/mention.tsx @@ -137,6 +137,22 @@ const OWNED = ["aria-autocomplete", "aria-haspopup", "aria-controls", "aria-acti /** 6px from the trigger's line, as a popup sits from its trigger; 8px from the window's edges. */ const OFFSET = 6; + +/** + * The lowest edge, above the caret, of what is pinned at the top of the view: the app's bar, a band stuck under it, an app's own strip marked + * `data-pinned-edge="top"` or `.basalt-sticky-bar`. The picker opens above only into the room below it, so it never covers them. Measured on + * each placement, so it holds whether or not the page measures its pinned edges (`usePinnedEdges`). + */ +function pinnedCeiling(viewTop: number, caretTop: number): number { + let ceiling = viewTop; + for (const part of document.querySelectorAll('[data-pinned-edge="top"], .basalt-sticky-bar')) { + const position = getComputedStyle(part).position; + if (position !== "sticky" && position !== "fixed") continue; + const box = part.getBoundingClientRect(); + if (box.height > 0 && box.bottom <= caretTop && box.bottom > ceiling) ceiling = box.bottom; + } + return ceiling; +} const MARGIN = 8; /** @@ -348,7 +364,7 @@ export function MentionPicker({ field, options, trigger = "@", filter, onQueryCh const height = view?.height ?? window.innerHeight; const viewWidth = view?.width ?? window.innerWidth; const below = top + height - caret.bottom - OFFSET - MARGIN; - const above = caret.top - top - OFFSET - MARGIN; + const above = caret.top - pinnedCeiling(top, caret.top) - OFFSET - MARGIN; list.style.removeProperty("--available-height"); const natural = list.scrollHeight + (list.offsetHeight - list.clientHeight); const down = below >= natural || below >= above; diff --git a/packages/react/src/styles/components.css b/packages/react/src/styles/components.css index 32b84251..69b60bc8 100644 --- a/packages/react/src/styles/components.css +++ b/packages/react/src/styles/components.css @@ -3276,7 +3276,7 @@ transition: background-color var(--basalt-duration-fast) var(--basalt-ease-out); } /* In a popover the plate is its level's; in the page (NotificationList, no level of its own) it is the page's solid plate. */ - .basalt-notification:hover::before { background-color: var(--_plate, var(--_plate-solid)); transition-duration: var(--basalt-duration-instant); } + .basalt-notification:hover::before { background-color: var(--_plate, var(--basalt-plate)); transition-duration: var(--basalt-duration-instant); } /* The hover glide, navigation's rules: one shared plate follows the pointer between entries (40 or 58 tall); the first key hides it and the resting hover, so only the ring shows, until the pointer moves again. Off on touch, under reduced motion and in forced colours, where each entry paints its own. */ @@ -5099,7 +5099,7 @@ transition: background-color var(--basalt-duration-fast) var(--basalt-ease-out); } @media (hover: hover) { - .basalt-passage:hover::before { background-color: var(--_plate, var(--_plate-solid)); transition-duration: var(--basalt-duration-instant); } + .basalt-passage:hover::before { background-color: var(--_plate, var(--basalt-plate)); transition-duration: var(--basalt-duration-instant); } .basalt-passage:hover .basalt-passage-meta { color: var(--basalt-text-secondary); } } .basalt-passage:focus-visible { outline: var(--basalt-size-focus-width) solid var(--basalt-border-focus); outline-offset: calc(var(--basalt-size-focus-offset) - var(--_plate-inset)); } @@ -6629,9 +6629,9 @@ content: ""; position: absolute; z-index: -1; inset: calc(-1 * var(--basalt-space-1)) calc(-1 * var(--basalt-space-2)); border-radius: var(--basalt-radius-md); pointer-events: none; background-color: transparent; transition: background-color calc(var(--basalt-duration-slow) * 0.75) var(--basalt-ease-in); } - :is(.basalt-stream-message, .basalt-stream-note, .basalt-stream-entry, .basalt-stream-block)[data-arrived]:not([data-panel])::before { background-color: var(--_plate-solid); transition-duration: var(--basalt-duration-instant); } + :is(.basalt-stream-message, .basalt-stream-note, .basalt-stream-entry, .basalt-stream-block)[data-arrived]:not([data-panel])::before { background-color: var(--basalt-plate); transition-duration: var(--basalt-duration-instant); } :is(.basalt-stream-entry, .basalt-stream-block)[data-panel][data-arrival] > :not(.basalt-visually-hidden, .basalt-stream-word) { transition: background-color calc(var(--basalt-duration-slow) * 0.75) var(--basalt-ease-in); } - :is(.basalt-stream-entry, .basalt-stream-block)[data-panel][data-arrived] > :not(.basalt-visually-hidden, .basalt-stream-word) { background-color: var(--_plate-solid); transition-duration: var(--basalt-duration-instant); } + :is(.basalt-stream-entry, .basalt-stream-block)[data-panel][data-arrived] > :not(.basalt-visually-hidden, .basalt-stream-word) { background-color: var(--basalt-plate); transition-duration: var(--basalt-duration-instant); } :is(.basalt-stream-message, .basalt-stream-note, .basalt-stream-entry, .basalt-stream-block)[data-arrival]:focus { outline: none; } :is(.basalt-stream-message, .basalt-stream-note, .basalt-stream-entry, .basalt-stream-block)[data-arrived] :is(.basalt-stream-time, .basalt-stream-meta, .basalt-stream-quote-cite, .basalt-text[data-tone="tertiary"], .basalt-disclosure-meta, .basalt-activity-meta) { color: var(--basalt-text-secondary); } .basalt-stream-word { color: var(--basalt-text-secondary); font-size: var(--basalt-text-xs-size); line-height: var(--basalt-text-xs-line-height); white-space: nowrap; opacity: 0; visibility: hidden; transition: opacity calc(var(--basalt-duration-slow) * 0.75) var(--basalt-ease-in), visibility var(--basalt-duration-instant) linear calc(var(--basalt-duration-slow) * 0.75); } diff --git a/packages/react/test/composer-mentions.test.mjs b/packages/react/test/composer-mentions.test.mjs index d830e170..b84e3c7a 100644 --- a/packages/react/test/composer-mentions.test.mjs +++ b/packages/react/test/composer-mentions.test.mjs @@ -685,3 +685,34 @@ describe("fix pass 1", () => { await withPicker.close(); }); }); + +// Found adopting B3 (2026-11-22): at 390 a picker with many rows opened over the app's bar and a strip stuck under it. Opening above, it now +// stops under the lowest pinned part above the caret (data-pinned-edge="top" or .basalt-sticky-bar), measured whether or not the page +// measures its pinned edges. +describe("The picker under what is pinned", () => { + test("opening above, it never covers a pinned bar or strip", async () => { + const page = await open(` +window.picks = []; +const OPTIONS = ${PEOPLE}; +function App() { + const ref = React.useRef(null); + return ( +
+
Synthetic bar
+
Synthetic strip
+
+