Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
fix(agentic-ide): make a pane drop land where the pointer is aiming
rubenluetke10-beep307dc87ca754
diff --git a/jarvis/ui/web/frontend/src/components/agentic/paneArrange.test.ts b/jarvis/ui/web/frontend/src/components/agentic/paneArrange.test.tsindex eae6c166c8..60117a8842 100644--- a/jarvis/ui/web/frontend/src/components/agentic/paneArrange.test.ts+++ b/jarvis/ui/web/frontend/src/components/agentic/paneArrange.test.ts@@ -8,7 +8,7 @@*/import { describe, expect, it } from "vitest";-import { EDGE_MAX_PX, pickTarget, zoneFor, type PaneRect } from "./paneArrange";+import { pickTarget, zoneFor, type PaneRect } from "./paneArrange";/** A 200×100 pane at the origin — round numbers so the arithmetic is readable. */const RECT: PaneRect = { left: 0, top: 0, width: 200, height: 100 };@@ -36,34 +36,49 @@ describe("zoneFor", () => {}});- it("gives every point in a TALL pane a side, at any height", () => {- // Nobody aims vertically while dragging sideways, so the whole middle of a- // grid column has to be a landing place rather than a dead zone.- for (const y of [200, 400, 490, 600, 700, 800]) {+ it("gives every point on a TALL pane's FLANKS a side, at any height", () => {+ // Nobody aims vertically while dragging sideways, so the part of a grid+ // column a sideways drag crosses has to be a landing place at every height+ // — otherwise carrying a pane past this one stacks it by accident.+ for (const y of [50, 200, 400, 490, 600, 800, 930]) {expect(zoneFor(COLUMN, 560, y)).toBe("left");expect(zoneFor(COLUMN, 800, y)).toBe("right");}});- it("keeps the top and bottom edges for joining the target's column", () => {+ it("reads the middle of a pane as joining the target's column", () => {expect(zoneFor(RECT, 100, 3)).toBe("above");expect(zoneFor(RECT, 100, 97)).toBe("below");expect(zoneFor(COLUMN, 680, 45)).toBe("above");expect(zoneFor(COLUMN, 680, 935)).toBe("below");});- it("keeps a stack-it band the same size however tall the pane grows", () => {- // An edge is a place the user aims at; aiming does not get harder because- // the pane got taller, and a band that grows with it eats the whole drag.+ it("stacks anywhere down a tall pane's middle, not just at its edges", () => {+ // The bug this replaced (reported 2026-08-03): the vertical zones were two+ // 88 px bands, which in a 900 px column is under a tenth of the pane at+ // each end, so "put this terminal underneath that one" was a shot nobody+ // could land. Pointing at the middle of the lower half is the obvious way+ // to ask for it, and it is now the answer at ANY depth.+ for (const y of [500, 600, 700, 800, 900]) {+ expect(zoneFor(COLUMN, 680, y)).toBe("below");+ }+ for (const y of [50, 150, 300, 400, 480]) {+ expect(zoneFor(COLUMN, 680, y)).toBe("above");+ }+ });++ it("keeps the stack-it stripe the same size however tall the pane grows", () => {+ // A pane's width barely moves as the grid fills — its height is what+ // changes — so the target the user aims at is measured across the axis that+ // holds still, and a taller pane is not a harder one to stack into.const shortPane: PaneRect = { left: 0, top: 0, width: 360, height: 400 };- const insideBand = EDGE_MAX_PX - 10;- expect(zoneFor(COLUMN, 680, COLUMN.top + insideBand)).toBe("above");- expect(zoneFor(shortPane, 180, insideBand)).toBe("above");- // Just past the ceiling it is a sideways landing again — in BOTH panes,- // which is the property a share alone could not give.- const pastBand = EDGE_MAX_PX + 10;- expect(zoneFor(COLUMN, 560, COLUMN.top + pastBand)).toBe("left");- expect(zoneFor(shortPane, 100, pastBand)).toBe("left");+ expect(zoneFor(COLUMN, 680, COLUMN.top + 300)).toBe("above");+ expect(zoneFor(shortPane, 180, 120)).toBe("above");+ // Out on the flanks it is a sideways landing again — in BOTH panes, at the+ // same fraction of the width, which is the property the bands could not+ // give at two different heights.+ expect(zoneFor(COLUMN, 560, COLUMN.top + 300)).toBe("left");+ expect(zoneFor(shortPane, 60, 120)).toBe("left");});it("swaps only when the modifier asks for it", () => {diff --git a/jarvis/ui/web/frontend/src/components/agentic/paneArrange.ts b/jarvis/ui/web/frontend/src/components/agentic/paneArrange.tsindex db6d0d4dde..24c6c29d12 100644--- a/jarvis/ui/web/frontend/src/components/agentic/paneArrange.ts+++ b/jarvis/ui/web/frontend/src/components/agentic/paneArrange.ts@@ -31,24 +31,28 @@ import { useCallback, useEffect, useRef, useState, type PointerEvent as ReactPoiexport type DropZone = "swap" | "left" | "right" | "above" | "below";/**- * The most of a pane's HEIGHT the stack-it bands at the top and bottom may take.+ * Share of a pane's WIDTH, down its middle, where a drop stacks rather than+ * lands beside — the column the two vertical zones live in.*- * Only the horizontal edges need a band at all — see `zoneFor`, where left and- * right split what is left between them. A share on its own was once the whole- * story and it made stacking far too easy to hit by accident: five panes draw- * each column tall and narrow, so 0.3 of the height is a very deep band, and the- * two of them together swallowed most of the pane (BUG-111).- */-export const EDGE_FRACTION = 0.3;--/**- * The ceiling that keeps a stack-it band from growing with the pane.+ * The two vertical zones used to be BANDS along the top and bottom edges+ * instead, and that shape cannot be made to work at both of the sizes a pane+ * really has. A band deep enough to aim at in a 900 px column swallows the+ * sideways drag that crosses it (BUG-111); one shallow enough not to —+ * `EDGE_MAX_PX` was 88 — is under a tenth of that column's height, and reported+ * on 2026-08-03 as "you cannot drag terminals underneath each other at all".+ * Both complaints are true of the same geometry, so the geometry is what+ * changed.*- * An edge is a place a user AIMS at, and aiming does not get harder because the- * pane got taller — so past a point the band stops growing and the sideways- * halves keep the rest.+ * A stripe answers both because it divides the axis the pane does NOT vary+ * much on. Panes get taller and shorter as the grid fills; a column's width+ * stays near `MIN_PANE_WIDTH_PX` whatever happens below it. So the stripe is a+ * target of roughly constant size, and — the part the bands could never give —+ * it runs the pane's FULL height: anywhere down the middle is "stack it", with+ * the half the pointer is in saying above or below.+ *+ * Half the width, so aiming for a side and aiming for the middle cost the same.*/-export const EDGE_MAX_PX = 88;+export const STACK_STRIPE_FRACTION = 0.5;/** Pixels the pointer must travel before a click on a header becomes a drag. */export const DRAG_THRESHOLD_PX = 5;@@ -65,8 +69,8 @@ export interface PaneRect {export interface ZoneOptions {/** The swap modifier is held — every drop becomes an exchange. */swap?: boolean;- /** Share of the height the stack-it bands may claim. Test seam. */- edge?: number;+ /** Share of the width the stack-it stripe may claim. Test seam. */+ stripe?: number;}/**@@ -76,20 +80,26 @@ export interface ZoneOptions {* of this function, and it was learned the hard way: carrying a pane sideways* onto another one is how a person says "put it over there", and answering that* with a swap sends the target back the other way — the user asked for one pane- * to move and two of them did (BUG-111). So the horizontal half the pointer is- * in decides which SIDE of the target the pane lands on, and every point in the- * pane is a landing place. There is no aiming, and no dead middle that means- * something else.+ * to move and two of them did (BUG-111). Exchanging two panes is still worth+ * having — it is the only move that leaves the grid's shape untouched — so it+ * stays on the swap modifier, where it cannot happen to someone who did not ask+ * for it.+ *+ * What is left is read as a picture of the result, which is what a person+ * dropping something believes they are doing: **the pane lands where they are+ * pointing.** A pane dropped down the middle of the target shares that column,+ * so the target's own space splits horizontally and the vertical half under the+ * pointer says which of the two the moved pane takes. A pane dropped out on+ * either flank becomes a column of its own on that side.*- * Two bands are carved out first, along the top and bottom edges, for joining- * the target's own column — the one drop that is genuinely vertical, so it is- * the one that reads the vertical position. They are measured in PIXELS and- * capped (`EDGE_MAX_PX`), because a band that keeps a fixed SHARE of a tall- * narrow column is deep enough to swallow the sideways drag it sits in.+ * The middle is a full-height STRIPE rather than two edge bands (see+ * `STACK_STRIPE_FRACTION`), and that is the difference that makes stacking+ * reachable: the flanks still take a drop at any height, so carrying a pane+ * sideways across a tall column never stacks it by accident, while aiming for+ * the middle no longer means hitting a strip a tenth of the pane deep.*- * Exchanging two panes is still worth having — it is the only move that leaves- * the grid's shape untouched — so it stays on the swap modifier, where it can no- * longer happen to someone who did not ask for it.+ * Every point in the pane is still a landing place — there is no dead middle+ * and nothing to hit exactly.*/export function zoneFor(rect: PaneRect,@@ -102,11 +112,10 @@ export function zoneFor(// cannot produce a nonsensical layout, so it is the fallback.if (rect.width <= 0 || rect.height <= 0) return "swap";if (options.swap) return "swap";- const band = Math.min(rect.height * (options.edge ?? EDGE_FRACTION), EDGE_MAX_PX);- const fromTop = y - rect.top;- const fromBottom = rect.top + rect.height - y;- if (fromTop <= band || fromBottom <= band) {- return fromTop <= fromBottom ? "above" : "below";+ const stripe = rect.width * (options.stripe ?? STACK_STRIPE_FRACTION);+ const fromCentre = Math.abs(x - (rect.left + rect.width / 2));+ if (fromCentre <= stripe / 2) {+ return y - rect.top < rect.height / 2 ? "above" : "below";}return x - rect.left < rect.width / 2 ? "left" : "right";}