Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(quill): mark the active row the same way in every menu (#129006)

Adam Leith83376d22aae6
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index cb664cc311f0..62dce20c9365 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -717,13 +717,13 @@ snapshots:
components-chart-legend-series-menu--single-series--light:
hash: v1.k794b7964.45544c43c187fd1d1fc7b204e7c33c7e422c5c56838cac44e5d63318c7f5e283.phbzfcS5A5m2LHaspjABfv-I6FPQ1-LnsCFRwyX81uQ
components-command-k-search--chip-and-value-suggestions--dark:
- hash: v1.k794b7964.e2cf036318e82d7af931975ced73d650a9b53723986853b5bac7ce5ae3b576bd.mkkCjEHVSszzagFa9wpCoMZM3k0NFHzhuv_ghy7a9hU
+ hash: v1.k794b7964.ced343446b982f961f849c3c21b0291456454a8bdabbffb4c40bc2465c38b705.vVQJg_pcOqsFUbRrIZOaZz2gMa8IBYTJQKsMPbfUGJ0
components-command-k-search--chip-and-value-suggestions--light:
- hash: v1.k794b7964.e7333bff9cf7731d6fc4de2c3de02126f269c9f18072af98231084282a7c5d65.J458vmekHctug5oj4MC67c2qudoY1nHzt0P9V_3lzx4
+ hash: v1.k794b7964.ccb298dc4076c600a145a31a044963cef3118ca4843fa8ff894a3ef90c79d808.8qYvuh3gupAupj16CkZQvwzrc2fANTy_rRWfxckuleI
components-command-k-search--empty--dark:
- hash: v1.k794b7964.711532ac6e726991456a1aa5a65adf56f507b821de5e1a0c1fdfdb346fbd6e50.-PeRL7ixVxVUioP_mIhM-QchAgCbxP020gNMtokg-Xk
+ hash: v1.k794b7964.f3260178d12c5e4e9a6b52804d25e9682b65d51d6fb097d2cfff69b6e124bdfb.5cMrbH5cW9Vi0zRIEfsr36NFl_6gFKU9xPbhprCc3Po
components-command-k-search--empty--light:
- hash: v1.k794b7964.f4c44beb1177df5a36770418b3141cbc9c26aa1665bf648865efd6eeab65437f.yDDLvsODc11eeiBKHRmSt12Ox8AxQZSgiRfGcd_ZR5o
+ hash: v1.k794b7964.2fe17203f6572c08eb8b837f1f764d1ad9de4bf44c9806504dbb8e9dbbb3de8e.dwlzrd6hB4t05RAf3vxzqaGmaCjbA53_SxsS5D6LnEk
components-command-k-search-notice--close-spellings--dark:
hash: v1.k794b7964.ffa192d267350a8866038659a7415aed68505662d35ae38774d58f83d5836c77.mHzLJfwxAGLcu-XeF7aGcByPBoDWki0HcQVfD-vHjos
components-command-k-search-notice--close-spellings--light:
@@ -11455,9 +11455,9 @@ snapshots:
scenes-app-errortracking--group-page-releases-stacked--light:
hash: v1.k794b7964.bbd7d8f861510cc79188ecbe20e6af110f08f96a53ef27ac75ce28bbd704f48c.bBi7jDw0DwllpcX_pkQJi-DdiBG_XAmTwS_GzqDEoRw
scenes-app-errortracking--group-page-today-rail-nav--dark:
- hash: v1.k794b7964.44bec3bc5d0ee4ef65f548012c4ec6e4cc65ddb94d6251f4cd9563bdc90f16bf.iSE4tmNbkJFoeG6DCM5k-F8hXt0cFQUPYkcOfbamQUk
+ hash: v1.k794b7964.7b967502dd276f40a0035c9f1fec6c4fff32e4558afd88b2605089ae34d79bf5.Qa-Nb2wVDvXbs1WAzJLiYFVpc-IJMDtPG31P0njv5lc
scenes-app-errortracking--group-page-today-rail-nav--light:
- hash: v1.k794b7964.e74f7ba76b28c0803dcd71ec276c0774cc236ead25cbcd7c5e911775e1b2391c.Utp2DqgtqoD_iT_VmejgjPgCsR1YJYhZAAmyrqE_dkA
+ hash: v1.k794b7964.195f79c54a1021066a5212c8f778741cb247edc4a77fed677d59f09d2d8b9c98.DoLnAH2gz3VSkmqa-0j8TUEIO-gAuHe1oPz5NWZf0Dw
scenes-app-errortracking--group-page-with-many-self-driving-reports--dark:
hash: v1.k794b7964.80a2533ac0237e1c88e747da106127fb7f335c4dfbda4dcd9acc58d5fad4133d.-bwvh6NUGPl4apMtIctBlqZHzMtXaDazhCLw-q4AUtM
scenes-app-errortracking--group-page-with-many-self-driving-reports--light:
@@ -11603,13 +11603,13 @@ snapshots:
scenes-app-experiments--experiment-recordings-empty-in-session-has-none--light:
hash: v1.k794b7964.5c85105ab9444ffc8ce4a3e9555924cd95137c1877fa967acef8e76b8d961071.ub13Q6e9xXJv4HGQrx1Lx4e-qtFFhlB61nOd1JFRVwg
scenes-app-experiments--experiment-recordings-empty-metric-filter-failed--dark:
- hash: v1.k794b7964.8a7e5d560bcfe4077b393deebbe0ac6a966c4733a07e988fd565f761fc5d284e.L6c_1rHbqwQCqmjcZfSR-FzBpnUKelxTEKuNzjYkcJs
+ hash: v1.k794b7964.792f3415a54e357a63e07c8462c6ff4d6cc5a23d1389f95492db451cd97bb595.XmT1vm8BV5oPAZhy70UfZwRP-rTxIgAQthY5by_LpAs
scenes-app-experiments--experiment-recordings-empty-metric-filter-failed--light:
- hash: v1.k794b7964.f8b5e7def7b6fd6d1a7f1f3122fbc6087dd2c96ce594d99817350912f2a33ef0.NsB81HhpL1SN3e9bGp6t5ygFkeKJ2wbocIWbY4kxOSY
+ hash: v1.k794b7964.ae88163fbe3bd0aef014b016cd8ab9bacde9e99639609a2bb652d7f6d898e797.YKFPldQToi2uaHd4QtcsKex3fBXjcMQjW6B-Ex4qrHk
scenes-app-experiments--experiment-recordings-empty-metric-filter-matched-nothing--dark:
- hash: v1.k794b7964.76401d6b006d3f7da3171290c10fdbddd96eb13d1a61d8303db55ccc697b46d1.zzI53pKMUqwq0Uza0ei5S7fzR8q_hkWRpPHSpvpAKw4
+ hash: v1.k794b7964.cdd7c3112086763ea2825ece27a02f581985afb2c204727ba6aad11d8fb73eba.bzA9SB2aik123eZIrOOcYneROOTG3K5TcjoXKVwqaY4
scenes-app-experiments--experiment-recordings-empty-metric-filter-matched-nothing--light:
- hash: v1.k794b7964.b1ae720741bd3b6382965b0f5ac03467f9f525c752dd31b63ef01df224f25a4b.ApCKxaxjWnJGi1e_hhBViY2JtjO0UwjBn8gV30leNgs
+ hash: v1.k794b7964.ffbef39b322adb9c44e861613af4c0819b5128261d828ed8b0ef2892f56bfeae.aFFm57j_GBrJ98ahT2y1MZgkz0uhVv7Yed-FxkDN4T0
scenes-app-experiments--experiment-recordings-empty-too-early--dark:
hash: v1.k794b7964.d85e6184e9fa6c5ebde50cbd9f69d43fb5a2852f0fe1faaa0547e510e8af548e.jsyKzWBMSCOFsJGn2OIrKktKaUzMUoZZwB9aVdxNdyM
scenes-app-experiments--experiment-recordings-empty-too-early--light:
@@ -16643,9 +16643,9 @@ snapshots:
scenes-data-warehouse-sql-editor-save-as-menu--lemon--light:
hash: v1.k794b7964.ce49834d2dd9a3e8d8f7f2ded91b0977b7c4f6fa9ae4094a26f75958097ce647.giNr9vzojfM_H0KtB2m449ZMzA2qtjt_Taw5_XsjwvQ
scenes-data-warehouse-sql-editor-save-as-menu--quill--dark:
- hash: v1.k794b7964.71d22f1784db63d4d163056fc4ca69f28ec4769dc924324114f81a1e73d6dd5d.zDoDPkZY04gocUtFOs0koHllRDvOQ9EtmB4RMM_F7qA
+ hash: v1.k794b7964.e396b3281daddcb67dbc14225067df3dab1a6077867daadafede5dc4dcb4279b.FggnmgmTjKlhyMzbp6j3ljT9GtV_cOInn4pCoXrL_4Q
scenes-data-warehouse-sql-editor-save-as-menu--quill--light:
- hash: v1.k794b7964.6515668099ff3a4bd1bbb4dac22586daeb8a1419fbd49d8bec87336b00cb3a50.bRgz6NTo6yEZtn_77eHLnzNprgOyoTnF7g6bWrSxMEY
+ hash: v1.k794b7964.a4d8e5587668a9e51adb4e6cb84af579198518505792df34aa50b70bba3ba1fc.7S_CAG8YdHkCIadU9ffHpHWUC0d_et_sgX8QDaEI-zs
scenes-inbox-scout-tags--editor-and-filter--dark:
hash: v1.k794b7964.79b0730ad23bc4daace066e8418a8f851d9a3e018bce50cd906f6f9276017d39.oiSmz7Fd649f4FBQK82nQ2-HLpGPZPaM9stDumq8qPo
scenes-inbox-scout-tags--editor-and-filter--light:
diff --git a/packages/quill/packages/primitives/AGENTS.md b/packages/quill/packages/primitives/AGENTS.md
index 43a256db1f97..4a909ee78deb 100644
--- a/packages/quill/packages/primitives/AGENTS.md
+++ b/packages/quill/packages/primitives/AGENTS.md
@@ -68,6 +68,8 @@ Pick by intent, not appearance. Each cluster below lists the discriminating ques
For a custom menu-like list inside a Popover (when DropdownMenu's open/close semantics don't fit), use `Item variant="menuItem"` with `ItemMenuItem`/`ItemCheckbox`/`ItemRadio` — don't restyle Buttons into menu rows. Inside quill, a primitive that renders a Button as a list row passes `size="row"` rather than pinning width, weight and text size per caller. `MenuLabel` is the shared section-label primitive the menu families render internally (DropdownMenuLabel, ComboboxLabel); it's exported for these custom menu-like lists.
+Every menu-like list marks its active row the same way: the row that keyboard input or a filter would act on (`data-highlighted`) gets a ring, and a row under the pointer gets the plain hover fill. Don't override this per component.
+
### Disclosure
**One section or a coordinated set? Hiding content or switching between views?**
diff --git a/packages/quill/packages/primitives/src/autocomplete.tsx b/packages/quill/packages/primitives/src/autocomplete.tsx
index c6273d8fcfe0..99eb58f01475 100644
--- a/packages/quill/packages/primitives/src/autocomplete.tsx
+++ b/packages/quill/packages/primitives/src/autocomplete.tsx
@@ -175,7 +175,7 @@ const AutocompleteItem = React.forwardRef<
<Button
size="row"
left
- className="min-w-0 aria-selected:bg-fill-selected data-highlighted:border-ring data-highlighted:ring-2 data-highlighted:ring-ring/30 ring-offset-1"
+ className="min-w-0 aria-selected:bg-fill-selected"
/>
}
tabIndex={-1}
diff --git a/packages/quill/packages/primitives/src/button.css b/packages/quill/packages/primitives/src/button.css
index 4ad5f8de41a6..7e8a31747ac9 100644
--- a/packages/quill/packages/primitives/src/button.css
+++ b/packages/quill/packages/primitives/src/button.css
@@ -2,6 +2,13 @@
/* =========================================================================
Base
========================================================================= */
+
+ /* The ring on a highlighted row of any menu. It is set on the row so that `--ring` resolves in the row's theme. */
+ :is(.quill-button, .quill-select__item) {
+ --quill-row-ring-color: color-mix(in oklab, var(--ring) 30%, transparent);
+ --quill-row-ring: 0 0 0 1px var(--card), 0 0 0 3px var(--quill-row-ring-color);
+ }
+
.quill-button {
font-size: var(--text-ui, 0.8125rem);
font-weight: 500;
@@ -114,13 +121,11 @@
background-color: var(--fill-selected);
}
+ /* The row keyboard input or a filter would act on takes the ring. A row under the pointer stays a plain hover. */
.quill-button--variant-default[data-highlighted] {
background-color: var(--fill-hover);
- }
-
- .quill-button--variant-default[data-highlighted]:not(:hover) {
border-color: var(--ring);
- box-shadow: 0 0 0 2px color-mix(in oklab, var(--ring) 30%, transparent);
+ box-shadow: var(--quill-row-ring);
}
/* Consecutive selected items collapse corners for a seamless stack */
@@ -268,6 +273,22 @@
box-shadow: 0 0 0 2px color-mix(in oklab, var(--destructive-foreground) 60%, transparent);
}
+ :is(.quill-button--variant-destructive, .quill-button--variant-destructive-outline)[data-highlighted] {
+ --quill-row-ring-color: color-mix(in oklab, var(--destructive-foreground) 60%, transparent);
+
+ border-color: currentColor;
+ box-shadow: var(--quill-row-ring);
+ }
+
+ :is(
+ .quill-button--variant-default,
+ .quill-button--variant-destructive,
+ .quill-button--variant-destructive-outline
+ )[data-highlighted]:hover {
+ border-color: transparent;
+ box-shadow: none;
+ }
+
/* =========================================================================
Variant: link / link-foreground / link-muted
========================================================================= */
diff --git a/packages/quill/packages/primitives/src/combobox.css b/packages/quill/packages/primitives/src/combobox.css
index df5eacff03fb..5f50a677cd1b 100644
--- a/packages/quill/packages/primitives/src/combobox.css
+++ b/packages/quill/packages/primitives/src/combobox.css
@@ -154,18 +154,6 @@
opacity: 0.5;
}
- /*
- * No focus ring on options — the `[data-highlighted]` background fill is the
- * sole active indicator (combobox uses virtual focus: the input keeps focus,
- * so options never get `:focus-visible`). Suppress every ring Button can
- * paint on an option. Scoped under `.quill-combobox__content` so the (0,4,0)
- * specificity outranks Button's base rules regardless of stylesheet order.
- */
- .quill-combobox__content .quill-button--variant-default:is([data-highlighted], :focus-visible) {
- border-color: transparent;
- box-shadow: none;
- }
-
/* `data-keep-color` opts a child out, for example a product icon that carries its own color. */
.quill-combobox__item:not([data-variant='destructive'])[data-highlighted]
*:not([data-keep-color], [data-keep-color] *) {
diff --git a/packages/quill/packages/primitives/src/combobox.tsx b/packages/quill/packages/primitives/src/combobox.tsx
index aaa869df8d56..70ca430dcb1a 100644
--- a/packages/quill/packages/primitives/src/combobox.tsx
+++ b/packages/quill/packages/primitives/src/combobox.tsx
@@ -191,8 +191,7 @@ const ComboboxItem = React.forwardRef<
) {
const hasReason = hasTooltipContent(disabledReason)
const described = hasTooltipContent(description)
- // A disabled item ignores the pointer, so the tooltip listens on a wrapper and opens beside the row.
- return withTooltip(
+ const item = (
<ComboboxPrimitive.Item
ref={ref}
data-slot="combobox-item"
@@ -214,10 +213,12 @@ const ComboboxItem = React.forwardRef<
>
<CheckIcon className="quill-combobox__indicator-icon pointer-events-none size-3.5" />
</ComboboxPrimitive.ItemIndicator>
- </ComboboxPrimitive.Item>,
- hasReason ? disabledReason : tooltip,
- { target: 'block', side: 'inline-end' }
+ </ComboboxPrimitive.Item>
)
+ const content = hasReason ? disabledReason : tooltip
+ // A disabled item ignores the pointer, so the tooltip listens on a wrapper and opens beside the row. Rows without a
+ // tooltip skip the wrapper: a long list would mount one per row, and it hides a row's neighbours from sibling selectors.
+ return hasTooltipContent(content) ? withTooltip(item, content, { target: 'block', side: 'inline-end' }) : item
})
const ComboboxGroup = React.forwardRef<
diff --git a/packages/quill/packages/primitives/src/dropdown-menu.tsx b/packages/quill/packages/primitives/src/dropdown-menu.tsx
index 9a9523722ef1..b61c1f462ceb 100644
--- a/packages/quill/packages/primitives/src/dropdown-menu.tsx
+++ b/packages/quill/packages/primitives/src/dropdown-menu.tsx
@@ -25,13 +25,16 @@ type DescribedMenuItemExtras = MenuItemExtras & {
description?: React.ReactNode
}
-/** Disabled items ignore the pointer, so the tooltip listens on a wrapper and opens beside the row. */
+/**
+ * Disabled items ignore the pointer, so the tooltip listens on a wrapper and opens beside the row. Rows without a
+ * tooltip skip the wrapper: a long list would mount one per row, and it hides a row's neighbours from sibling selectors.
+ */
function withItemTooltip(
item: React.ReactElement,
{ tooltip, disabledReason }: Pick<MenuItemExtras, 'tooltip' | 'disabledReason'>
): React.ReactElement {
const content = hasTooltipContent(disabledReason) ? disabledReason : tooltip
- return withTooltip(item, content, { target: 'block', side: 'inline-end' })
+ return hasTooltipContent(content) ? withTooltip(item, content, { target: 'block', side: 'inline-end' }) : item
}
function DropdownMenu({ ...props }: MenuPrimitive.Root.Props): React.ReactElement {
@@ -76,7 +79,7 @@ const DropdownMenuContent = React.forwardRef<
data-slot="dropdown-menu-content"
data-flush={flush ? '' : undefined}
className={cn(
- 'quill-menu__content w-max min-w-(--anchor-width) max-w-(--available-width)',
+ 'quill-menu__content w-max min-w-[max(10rem,var(--anchor-width))] max-w-(--available-width)',
className
)}
{...props}
diff --git a/packages/quill/packages/primitives/src/menu-label.css b/packages/quill/packages/primitives/src/menu-label.css
index d95811e6d182..132acb3bfef4 100644
--- a/packages/quill/packages/primitives/src/menu-label.css
+++ b/packages/quill/packages/primitives/src/menu-label.css
@@ -1,10 +1,10 @@
@layer components {
.quill-menu-label {
- padding-block: 0.375rem;
+ padding-block: 0.25rem;
padding-inline: 0.5rem;
font-size: var(--text-xxs, 0.625rem);
font-weight: 600;
- line-height: 1.25rem;
+ line-height: 1rem;
color: color-mix(in oklab, var(--muted-foreground) 50%, transparent);
text-transform: uppercase;
letter-spacing: 0.075em;
diff --git a/packages/quill/packages/primitives/src/menu.css b/packages/quill/packages/primitives/src/menu.css
index f9c96e0d6f10..765a7d8f754a 100644
--- a/packages/quill/packages/primitives/src/menu.css
+++ b/packages/quill/packages/primitives/src/menu.css
@@ -187,42 +187,15 @@
}
/*
- * Consecutive checked items merge corners into a seamless block — mirrors
- * the aria-selected/aria-checked Button rules, scoped to menu items so the
- * effect reads even when Base UI wraps items in a group/list container.
- */
- :is(
- [data-slot='dropdown-menu-checkbox-item'],
- [data-slot='dropdown-menu-radio-item'],
- [data-slot='context-menu-checkbox-item'],
- [data-slot='context-menu-radio-item']
- ):is([aria-checked='true'], [data-checked]):has(+ :is([aria-checked='true'], [data-checked])) {
- border-bottom-right-radius: 0;
- border-bottom-left-radius: 0;
- }
-
- :is([aria-checked='true'], [data-checked])
- + :is(
- [data-slot='dropdown-menu-checkbox-item'],
- [data-slot='dropdown-menu-radio-item'],
- [data-slot='context-menu-checkbox-item'],
- [data-slot='context-menu-radio-item']
- ):is([aria-checked='true'], [data-checked]) {
- border-top-left-radius: 0;
- border-top-right-radius: 0;
- }
-
- /*
- * Menu items show no focus ring — the `[data-highlighted]` background fill
- * is the sole active-item indicator for both mouse and keyboard. Suppress
- * both the `data-highlighted` ring and the `:focus-visible` ring Button
- * carries. The redundant `.quill-button` only raises specificity, so this
- * outranks Button's own ring rules regardless of stylesheet order.
+ * Button's `[data-highlighted]` ring is the sole active-item indicator.
+ * Menu rows take real focus as the pointer moves, so `:focus-visible` must
+ * not paint a second ring. The redundant `.quill-button` only raises
+ * specificity, so this outranks Button's own ring rules regardless of
+ * stylesheet order.
*/
:is(.quill-menu__content, .quill-menu__sub-content)
- .quill-button:is(.quill-button--variant-default, .quill-button--variant-destructive):is(
- [data-highlighted],
- :focus-visible
+ .quill-button:is(.quill-button--variant-default, .quill-button--variant-destructive):focus-visible:not(
+ [data-highlighted]
) {
border-color: transparent;
box-shadow: none;
diff --git a/packages/quill/packages/primitives/src/select.css b/packages/quill/packages/primitives/src/select.css
index 08fa28c8cb2f..95aff464faec 100644
--- a/packages/quill/packages/primitives/src/select.css
+++ b/packages/quill/packages/primitives/src/select.css
@@ -120,11 +120,22 @@
color 0.1s ease;
}
- .quill-select__item:focus {
+ .quill-select__item:is(:focus, :hover) {
color: var(--foreground);
background-color: var(--fill-hover);
}
+ /* Matches the ring Button gives a highlighted row. Select's rows are not Buttons, so the border is an inset shadow. */
+ .quill-select__item[data-highlighted] {
+ box-shadow:
+ inset 0 0 0 1px var(--ring),
+ var(--quill-row-ring);
+ }
+
+ .quill-select__item[data-highlighted]:hover {
+ box-shadow: none;
+ }
+
.quill-select__item:not(:hover)[aria-selected='true'] {
background-color: var(--fill-selected);
}