The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(desktop): let HUD prompts take clicks on solid X11
Brooklyn Nicholson240790af6007
diff --git a/apps/desktop/electron/hud-windowing.test.ts b/apps/desktop/electron/hud-windowing.test.tsindex 1e4d9b99f80..51cda2719a9 100644--- a/apps/desktop/electron/hud-windowing.test.ts+++ b/apps/desktop/electron/hud-windowing.test.ts@@ -111,12 +111,14 @@ test('the renderer view is a boolean slice of the profile', () => {clientPlacement: false,controlDrag: false,nativeDrag: true,+ solid: false,workspaceTransfer: false})assert.deepEqual(x11, {clientPlacement: true,controlDrag: true,nativeDrag: false,+ solid: true,workspaceTransfer: true})})diff --git a/apps/desktop/electron/hud-windowing.ts b/apps/desktop/electron/hud-windowing.tsindex 8a95b0712e2..07f1f3a7ec1 100644--- a/apps/desktop/electron/hud-windowing.ts+++ b/apps/desktop/electron/hud-windowing.ts@@ -37,6 +37,8 @@ export interface HudWindowingView {clientPlacement: booleancontrolDrag: booleannativeDrag: boolean+ /** The OS window cannot punch click-through holes (Linux X11). */+ solid: booleanworkspaceTransfer: boolean}@@ -128,6 +130,7 @@ export function hudWindowingView(windowing: HudWindowing): HudWindowingView {clientPlacement: windowing.clientPlacement,controlDrag: windowing.controlDrag,nativeDrag: windowing.move === 'native-drag',+ solid: windowing.input === 'solid',workspaceTransfer: windowing.workspaceTransfer}}diff --git a/apps/desktop/electron/preload.ts b/apps/desktop/electron/preload.tsindex 7e5526c00ea..1a3fac1f9c0 100644--- a/apps/desktop/electron/preload.ts+++ b/apps/desktop/electron/preload.ts@@ -84,6 +84,7 @@ contextBridge.exposeInMainWorld('hermesDesktop', {clientPlacement: hudWindowing?.clientPlacement !== false,controlDrag: hudWindowing?.controlDrag === true,nativeDrag: hudNativeDrag,+ solid: hudWindowing?.solid === true,workspaceTransfer: hudWindowing?.workspaceTransfer === true},open: request => ipcRenderer.invoke('hermes:hud:open', request),diff --git a/apps/desktop/src/app/hud/hud-shell.tsx b/apps/desktop/src/app/hud/hud-shell.tsxindex 09958d664d1..1d0d4cdd4a1 100644--- a/apps/desktop/src/app/hud/hud-shell.tsx+++ b/apps/desktop/src/app/hud/hud-shell.tsx@@ -377,7 +377,11 @@ export function HudShell() {// growth bug); the handle is the one sanctioned way to change size, driving// the same flip-resizable-for-the-call pattern the pet overlay uses.const { resizing: hudResizing, onPointerDown: onHudResizePointerDown } = useHudResizeHandle()- const resizeDirections = hudResizeDirections(window.hermesDesktop?.hud?.windowing?.clientPlacement !== false)+ const hudWindowing = window.hermesDesktop?.hud?.windowing+ const resizeDirections = hudResizeDirections(hudWindowing?.clientPlacement !== false)+ // Linux X11 cannot ignore-mouse; a visible band that also ignores the+ // pointer just eats the click. The stylesheet keys off this.+ const hudInput = hudWindowing?.solid ? 'solid' : 'click-through'// Force the HOST layers transparent. index.html's pre-paint script writes an// opaque themed background onto <html> as an INLINE style (the anti-white-@@ -399,6 +403,8 @@ export function HudShell() {className="relative flex h-screen w-screen flex-col overflow-hidden"data-hud-edge={edge}data-hud-game={gameUnder ? '' : undefined}+ data-hud-held={held ? '' : undefined}+ data-hud-input={hudInput}data-hud-recent={recent || held ? '' : undefined}data-hud-shell// Letting go of the composer re-arms the hold, so the transcript stepsdiff --git a/apps/desktop/src/global.d.ts b/apps/desktop/src/global.d.tsindex bb09b46c48a..66e79acb320 100644--- a/apps/desktop/src/global.d.ts+++ b/apps/desktop/src/global.d.ts@@ -101,6 +101,7 @@ declare global {clientPlacement: booleancontrolDrag: booleannativeDrag: boolean+ solid: booleanworkspaceTransfer: boolean}open: (request?: { sessionId?: null | string; profile?: null | string }) => Promise<{ ok: boolean }>diff --git a/apps/desktop/src/styles.css b/apps/desktop/src/styles.cssindex 00b9c88af1b..c0583524d36 100644--- a/apps/desktop/src/styles.css+++ b/apps/desktop/src/styles.css@@ -2846,6 +2846,37 @@ button[data-slot='aui_msg-reactions'] svg {pointer-events: auto;}+/* A held band is the interface — clarify / approval / a live turn. It must+ take clicks even if the composer never received focus. On click-through+ hosts that is a deliberate dead zone over the game; on a prompt it is a+ surface you cannot use. */+[data-hud-shell][data-hud-held] [data-slot='composer-bounds'] {+ pointer-events: auto;+}++/* Linux X11 is a solid window: ignore-mouse cannot restore, so a visible+ band that still has pointer-events:none swallows the click and does+ nothing. Once the band is up it is the surface. */+[data-hud-shell][data-hud-input='solid'][data-hud-recent] [data-slot='composer-bounds'] {+ pointer-events: auto;+}++/* Widgets and links opt in even when the band is a ghost, so a click-through+ HUD can still answer a clarify option or open an OAuth URL without sitting+ in the composer first. Children inherit auto from these roots. */+[data-hud-shell]+ :is(+ [data-slot='clarify-inline'],+ [data-clarify-choices],+ [data-clarify-batch],+ [data-slot='tool-approval-inline'],+ [data-slot='tool-approval-fallback'],+ [data-slot='tool-approval-actions'],+ a[href]+ ) {+ pointer-events: auto;+}+/* Three states, not two. A turn landing brings the transcript up, but only partway — it is there to be glanced at over whatever you are actually doing, andfull-strength text over another app reads as the HUD demanding attention it@@ -3466,11 +3497,14 @@ html:has([data-hud-shell]) [data-slot='popover-content'] [class*='max-h-'] {max-height: max(5rem, calc(100dvh - 9rem)) !important;}-/* The menu panels themselves: never taller than the window minus the bar. */+/* The menu panels themselves: never taller than the window minus the bar.+ Portalled out of the shell, they must still take the pointer — the HUD+ defaults to none and a right-click menu that cannot be clicked is dead. */html:has([data-hud-shell]) [data-slot='dropdown-menu-content'],html:has([data-hud-shell]) [data-slot='popover-content'] {max-height: calc(100dvh - 4.5rem) !important;overflow-y: auto;+ pointer-events: auto;}/* Hide the scrollbar — a HUD with a visible track stops reading as an overlay. */