mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-09 22:25:02 +03:00
fix(app): hide browser embeds under the quote comment popover
This commit is contained in:
@@ -143,6 +143,7 @@ export function QuoteCommentEditor(props: {
|
||||
})
|
||||
}}
|
||||
data-component="composer-quote-comment"
|
||||
data-floating
|
||||
data-prevent-autofocus
|
||||
class="fixed z-50"
|
||||
style={{
|
||||
|
||||
@@ -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")}
|
||||
|
||||
Reference in New Issue
Block a user