fix(app): hide browser embeds under the quote comment popover

This commit is contained in:
iamdavidhill
2026-11-01 04:46:21 +00:00
Unverified
parent 01276f9061
commit 37c038093c
4 changed files with 9 additions and 2 deletions
@@ -143,6 +143,7 @@ export function QuoteCommentEditor(props: {
})
}}
data-component="composer-quote-comment"
data-floating
data-prevent-autofocus
class="fixed z-50"
style={{
+6 -2
View File
@@ -187,9 +187,13 @@ function EmbedView(props: EmbedProps & { input: Input; bridge: Bridge }) {
}
// The native embed always paints above the DOM, so hide it while a floating
// menu, select, or popover overlaps it. Tooltips are excluded.
// menu, select, or popover overlaps it. Tooltips are excluded. Floating content
// positioned without Kobalte, such as the quote toolbar and comment editor, marks
// itself with data-floating.
const covered = (rect: DOMRect) =>
Array.from(document.querySelectorAll('[data-popper-positioner]:not(:has([role="tooltip"]))')).some((el) => {
Array.from(
document.querySelectorAll('[data-popper-positioner]:not(:has([role="tooltip"])), [data-floating]'),
).some((el) => {
const r = el.getBoundingClientRect()
return r.width > 0 && r.left < rect.right && r.right > rect.left && r.top < rect.bottom && r.bottom > rect.top
@@ -348,6 +348,7 @@ export function TimelineQuote(props: { controller: TimelineQuoteController }) {
onCleanup(() => quote.setElement(undefined))
}}
data-component="timeline-quote"
data-floating
data-prevent-autofocus
role="toolbar"
aria-label={language.t("session.quote.actions")}
@@ -232,6 +232,7 @@ export function TerminalQuote(props: {
})
}}
data-component="terminal-quote"
data-floating
data-prevent-autofocus
role="toolbar"
aria-label={plugin.t("quote.actions")}