Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

feat(desktop-app): confine composer reference overlays to the chat drawer (Fase 3)

Diego Zacarias915867be4681
diff --git a/desktop-app/ui/src/components/ChatDrawer/ChatDrawer.test.tsx b/desktop-app/ui/src/components/ChatDrawer/ChatDrawer.test.tsx
index a66035649..1e43f7f1e 100644
--- a/desktop-app/ui/src/components/ChatDrawer/ChatDrawer.test.tsx
+++ b/desktop-app/ui/src/components/ChatDrawer/ChatDrawer.test.tsx
@@ -6,6 +6,11 @@ import { readFileSync } from 'node:fs'
import path from 'node:path'
import { ChatDrawer } from '.'
+const stylesheet = readFileSync(
+ path.join(process.cwd(), 'ui', 'src', 'styles.css'),
+ 'utf8'
+)
+
beforeEach(() => {
const style = document.createElement('style')
style.dataset.testStyles = 'chat-drawer'
@@ -66,6 +71,19 @@ describe('ChatDrawer', () => {
expect(getComputedStyle(drawer).pointerEvents).toBe('none')
})
+ it('confines the composer reference submenu to the drawer interior, off the embed rect', () => {
+ // Right-docked drawer: the embed is to its LEFT, so the composer submenu must
+ // stay anchored rightward (left: 100%+, right: auto) to render over drawer DOM
+ // instead of being occluded by the native view. A left flip would cross the
+ // embed rect — the confinement guards against that.
+ const rule = stylesheet.match(
+ /\.chat-drawer \.composer-reference-submenu\s*\{([^}]*)\}/
+ )?.[1]
+ expect(rule).toBeTruthy()
+ expect(rule).toMatch(/left:\s*calc\(100% \+ var\(--space-1\)\)/)
+ expect(rule).toMatch(/right:\s*auto/)
+ })
+
it('reveals once ready', () => {
const { container } = renderDrawer({ ready: true })
const drawer = container.querySelector('.chat-drawer') as HTMLElement
diff --git a/desktop-app/ui/src/styles.css b/desktop-app/ui/src/styles.css
index d184762d5..095c8a785 100644
--- a/desktop-app/ui/src/styles.css
+++ b/desktop-app/ui/src/styles.css
@@ -12682,6 +12682,25 @@ pre {
padding-top: var(--space-1);
}
+/* Overlay confinement (spec §6). The native app view paints above ALL DOM, so
+ any chat overlay that crosses the embed's rect is hidden behind it. The drawer
+ is RIGHT-docked, so the embed sits to its LEFT. The composer reference menu is
+ anchored at the composer's left edge and its submenu flies RIGHT
+ (`left: calc(100% + …)`) — i.e. INTO the drawer, away from the embed — so it is
+ already off the app rect. Pin that rightward direction inside the drawer so a
+ future global LEFT flip can't leak the submenu over the embed and be occluded.
+ (The spec's suggested LEFT flip is inverted for a right-docked drawer: leftward
+ pushes the submenu over the embed, not off it. See report.) */
+.chat-drawer .composer-reference-submenu {
+ left: calc(100% + var(--space-1));
+ right: auto;
+}
+
+.chat-drawer .composer-reference-menu-panel {
+ left: 0;
+ right: auto;
+}
+
@media (min-width: 901px) and (max-width: 1220px) {
.content-panel {
--app-header-utilities-width: calc(