# Hover Focus Focus the panel under your cursor, without a click, just like most window managers do. ![Hover Focus](preview.png) ## What you see Nothing of its own. The mod draws no pixels and has no colors or type. The focused pane shows the layout's usual `focus` border. The layout's normal pane header is gone, because this mod takes its place. ## How it behaves - Moving the pointer into a pane focuses it, and the keyboard goes with it. - Clicks, text selection and mouse events still reach the terminal underneath. - Focus changes only when the pointer enters a pane. Splitting or closing a pane under a still pointer changes nothing until the pointer moves into another pane. - It does nothing while the window isn't active. - It doesn't look at agent status, and it adds no keys. ## Built from - One mod, `mods/hoverfocus/`, with `mod.json`: `{ "place": "none", "title": "Hover focus" }`. - `main.js` renders one empty `div().id("hover-focus").size_full()`. Its `.on_hover((hovered) => …)` runs `run("pane.focus", { pane: props().pane })` when `hovered` is true and `window().active` is true. - From `herdr`: `props`, `run`, `window`. From `gpui-kit`: `View`, `div`. No programs, network or files. - It's used as the pane header of a layout, one copy per pane. Add this to the `pane` object of a copy of the person's layout, then `layout.switch` to the copy: ```json "header": { "content": { "mod": "hoverfocus" }, "height": 5000, "position": "top", "reveal": "hover" } ``` ## Watch out - The mod does nothing until the layout edit is made. This share has no `layouts/` folder, so adding the mod folder alone isn't enough. - `reveal: "hover"` draws the header over the terminal. Without it the header takes up space and pushes the terminal out of the pane. - `height: 5000` is there to cover the whole pane. The pane clips it. A shorter header only catches the pointer in that strip. - Don't call `.occlude()` on the element: it would stop clicks reaching the terminal. - A layout has one pane header slot, so the normal header is lost. The mod has to be added to each layout the person uses. - Dragging across panes, like selecting text, switches focus mid-drag. The mod can't see that a button is held. - With the palette or a popup open, moving the pointer changes the focused pane behind it. ## Done when - `herdr-app check` passes on `mods/hoverfocus`. - With two panes, moving the pointer into the other pane moves the focus border, with no click. - Typing right after that lands in the pane under the pointer. - Dragging inside one pane still selects text. - Pointing at another pane while another window is active doesn't change focus.