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
feat(agent-chat): cancel a running turn and scope chats to a workspace dir
rubenluetke10-beep17ac84b35a93
diff --git a/jarvis/agentic_ide/agent_transcript.py b/jarvis/agentic_ide/agent_transcript.pyindex 3790ee62e4..194960b88f 100644--- a/jarvis/agentic_ide/agent_transcript.py+++ b/jarvis/agentic_ide/agent_transcript.py@@ -665,6 +665,8 @@ class _EventLog:self.live = liveself.model = ""self.effort = ""+ #: The CLI's own permission stance, as its record last stated it.+ self.permission_mode = ""self.turn_id: str | None = Noneself.turns = 0self.turn_started_ms = 0@@ -864,7 +866,24 @@ class _EventLog:# Asked and not yet answered, on a pane that is working: open the# turn so the timeline says so instead of ending on the question.self._ensure_turn(self.events[-1]["ts_ms"])- return _last_turns(self.events, MAX_TURNS)+ self.events = _last_turns(self.events, MAX_TURNS)+ return self.events+++@dataclass(frozen=True, slots=True)+class TimelineRead:+ """One session's recent conversation as events, plus what the pane runs on.++ The three strings are the CLI's own statements about itself — the model+ and effort its last reply carried, the permission stance its record last+ declared — and they are what the chat's composer shows in its pills for a+ pane, where a session it runs itself shows the picks it was created with.+ """++ events: list[dict[str, Any]]+ model: str = ""+ effort: str = ""+ permission_mode: str = ""#: The token counts worth carrying — the chat shows output only, but the rest@@ -927,6 +946,20 @@ def _claude_events(session_id: str, home: Path | None, live: bool) -> list[dict[if row.get("isSidechain"):continuekind = str(row.get("type") or "")+ if kind == "permission-mode":+ # The CLI's stance is a fact of the pane, stated by the pane; the+ # chat's composer shows it where it shows the picked mode of a+ # session it runs itself.+ mode = row.get("permissionMode")+ if isinstance(mode, str) and mode:+ log.permission_mode = mode+ continue+ if kind == "mode":+ # `plan` is a stance too, written under its own record kind.+ mode = row.get("mode")+ if mode == "plan":+ log.permission_mode = "plan"+ continueif kind not in ("user", "assistant"):continuemessage = row.get("message")@@ -993,7 +1026,8 @@ def _claude_events(session_id: str, home: Path | None, live: bool) -> list[dict[ts,)log.usage(mid, message.get("usage"), ts)- return log.finish()+ log.finish()+ return logdef _codex_events(session_id: str, home: Path | None, live: bool) -> list[dict[str, Any]] | None:@@ -1092,24 +1126,23 @@ def _codex_events(session_id: str, home: Path | None, live: bool) -> list[dict[sif isinstance(block, dict) and block.get("text"))log.thinking("\n\n".join(p for p in parts if p), item_id, ts)- return log.finish()+ log.finish()+ return log-_EVENT_READERS: dict[- str, Callable[[str, Path | None, bool], list[dict[str, Any]] | _EventLog | None]-] = {+_EVENT_READERS: dict[str, Callable[[str, Path | None, bool], _EventLog | None]] = {"claude": _claude_events,"codex": _codex_events,}-def read_events(+def read_timeline(agent: str,session_id: str,*,home: Path | None = None,live: bool = False,-) -> list[dict[str, Any]] | None:+) -> TimelineRead | None:"""The recent conversation of one session as agent-chat events, oldest first.The same ``None`` contract as :func:`read`: no readable record, no file yet,@@ -1121,14 +1154,32 @@ def read_events(if reader is None or not str(session_id or "").strip():return Nonetry:- read_result = reader(session_id.strip(), home, live)+ log = reader(session_id.strip(), home, live)except OSError as exc:logger.warning("Agent transcript: {} session {} unreadable as events: {}", agent, session_id, exc)return None- # The newer readers answer with the log itself, whose events are the list.- return read_result.events if isinstance(read_result, _EventLog) else read_result+ if log is None:+ return None+ return TimelineRead(+ events=log.events,+ model=log.model,+ effort=log.effort,+ permission_mode=log.permission_mode,+ )+++def read_events(+ agent: str,+ session_id: str,+ *,+ home: Path | None = None,+ live: bool = False,+) -> list[dict[str, Any]] | None:+ """The events alone — :func:`read_timeline` without the pane's picks."""+ read_result = read_timeline(agent, session_id, home=home, live=live)+ return None if read_result is None else read_result.events# --------------------------------------------------------------------------- #@@ -1919,8 +1970,10 @@ __all__ = ["MAX_TEXT","MAX_TURNS","Step",+ "TimelineRead","Turn","can_read","read","read_events",+ "read_timeline",]diff --git a/jarvis/core/paths.py b/jarvis/core/paths.pyindex a79ab822ec..dba904c89f 100644--- a/jarvis/core/paths.py+++ b/jarvis/core/paths.py@@ -59,6 +59,23 @@ def user_clis_dir() -> Path:return user_data_dir() / "clis"+def chat_workspace_dir() -> Path:+ """Where a typed Jarvis chat works when nobody picked a folder for it.++ The Jarvis chat hands the turn file and shell tools scoped to a working+ directory (``jarvis.agent_chat.folder_tools``), and a CLI-backed seat needs+ a directory to start in at all. The fallback used to be :func:`Path.home` —+ the entire user profile, with the read-only tools (``Read``/``Ls``/``Glob``/+ ``Grep``) running inside it unprompted because their risk tier is ``safe``.+ A directory of its own keeps that default reach small; pointing a chat at a+ real project folder stays a per-session choice.++ Does NOT create the directory — the caller does, so a read-only install can+ fall back instead of failing (see ``jarvis.ui.web.server``).+ """+ return user_data_dir() / "chat-workspace"++def workspace_clis_dir() -> Path:"""Where the user's own terminal CLIs and their logos are kept.@@ -234,6 +251,7 @@ __all__ = ["user_memory_dir","user_logs_dir","user_clis_dir",+ "chat_workspace_dir","workspace_clis_dir","workspace_clis_path","cli_usage_db_path",diff --git a/jarvis/core/runtime_refs.py b/jarvis/core/runtime_refs.pyindex a301a88f97..7d5d3b2cec 100644--- a/jarvis/core/runtime_refs.py+++ b/jarvis/core/runtime_refs.py@@ -23,6 +23,7 @@ required" rather than crashing — the anti-silent-drop contract (AD-OE6).Thread-safety: assignment of a single object reference is atomic in CPython, andthese are write-once-at-bootstrap / read-many. No lock needed."""+from __future__ import annotationsimport asyncio@@ -107,6 +108,24 @@ def get_mcp_registry() -> Any | None:return _MCP_REGISTRY[0] if _MCP_REGISTRY else None+# Where this process' own HTTP API actually listens, stamped at bind time. A+# dev instance offsets the port at runtime while SHARING jarvis.toml, so the+# config value is the live app's port even inside the dev app — anything that+# hands its own address to a child (the agent chat's MCP config) must read it+# from here, never from config.+_API_BASE_URL: list[str] = []+++def set_api_base_url(url: str) -> None:+ """Record the effective loopback base URL of this process' web server."""+ _set(_API_BASE_URL, url)+++def get_api_base_url() -> str | None:+ """This process' own base URL, or ``None`` before the server bound."""+ return _API_BASE_URL[0] if _API_BASE_URL else None++# The live FastAPI app (set by WebServer._build_app). The ``app-command`` tool# executes Command-Registry commands through it in-process (httpx ASGI# transport — full route validation, no TCP), so a voice command runs thediff --git a/jarvis/ui/web/agent_chat_routes.py b/jarvis/ui/web/agent_chat_routes.pyindex 4ed0c0adb0..ffd881e757 100644--- a/jarvis/ui/web/agent_chat_routes.py+++ b/jarvis/ui/web/agent_chat_routes.py@@ -656,7 +656,14 @@ async def post_message(session_id: str, body: MessageBody, request: Request) ->return {"turn_id": turn_id, "session_id": session_id}[email protected]("/sessions/{session_id}/cancel")+ "/sessions/{session_id}/cancel",+ summary="Stop the turn this chat session is running",+ # Cancelling throws away work in flight: the runner is interrupted mid-turn+ # and whatever it had not yet written is lost. The CLI safety gate and the+ # Command Registry must treat it as destructive and ask before firing.+ openapi_extra={"x-jarvis-dangerous": True},+)async def cancel_turn(session_id: str, request: Request) -> dict[str, Any]:svc = _service(request)if svc.store.get_session(session_id) is None:diff --git a/jarvis/ui/web/frontend/src/components/agentic/FolderPicker.tsx b/jarvis/ui/web/frontend/src/components/agentic/FolderPicker.tsxindex bc3e5b3faa..d8d423248f 100644--- a/jarvis/ui/web/frontend/src/components/agentic/FolderPicker.tsx+++ b/jarvis/ui/web/frontend/src/components/agentic/FolderPicker.tsx@@ -9,13 +9,20 @@* 2. **Recents** — the folders opened before, with their previous layout. One* click and the launcher already knows how many terminals to open.* 3. **Search** — type a name, get matches from anywhere under home and the- * usual code directories. Faster than clicking down five levels.- * 4. **Browsing** — the list, projects and repositories sorted first.+ * usual code directories. Faster than clicking down five levels. The same+ * field reads a PATH as a place, not a name: `C:\Users\me\.claude` opens+ * that folder on the spot instead of searching the disk for a folder called+ * that (which found nothing, and was reported as "search is broken").+ * 4. **Browsing** — the list, projects and repositories sorted first. Hidden+ * folders (`.claude`, `.config`) stay out of the way until asked for.* 5. **Typing a path** — with completion, the way `cd` works in a terminal.* 6. **Drag and drop** — drop a folder (or a file inside it) anywhere on the* panel. Inside the desktop shell the host reports the real path* (`waitForNativeDrop`); in a browser only the NAME is known, and the* backend searches for it — see `extractDropPayload`.+ * 7. **A new folder** — a project that does not exist yet has nothing to pick.+ * "New folder" makes one inside the folder on screen, and a typed path that+ * is not a folder yet is offered for creation rather than only refused.** The in-page browser is not a fallback for the system window, it is the floor:* the system window opens on the machine the BACKEND runs on, so it is useless@@ -45,9 +52,12 @@ import { useCallback, useEffect, useMemo, useRef, useState } from "react";import {CornerDownLeft,CornerLeftUp,+ Eye,+ EyeOff,Folder,FolderGit2,FolderOpen,+ FolderPlus,Loader2,RefreshCw,Search,@@ -59,6 +69,7 @@ import { waitForNativeDrop } from "@/lib/nativeDrop";import { useDragSessionEnd } from "./dragSessionEnd";import { Button, Field, IconButton, SectionLabel } from "./controls";import {+ createFolder,fetchFolders,fetchNativePickerSupport,fetchRecents,@@ -142,6 +153,7 @@ export function FolderPicker({const [parent, setParent] = useState<string | null>(null);const [entries, setEntries] = useState<FolderItem[]>([]);const [deviceName, setDeviceName] = useState<string>("");+ const [home, setHome] = useState<string | null>(null);const [loading, setLoading] = useState(false);const [error, setError] = useState<string | null>(null);@@ -161,15 +173,48 @@ export function FolderPicker({const [nativeOpen, setNativeOpen] = useState(false);const [nativeNote, setNativeNote] = useState<string | null>(null);- const load = useCallback(async (target: string | null) => {+ // Dot-folders are noise in a project list and the one thing someone opening+ // `.claude` needs — so they are a switch, off by default, and a typed name+ // that starts with a dot turns them on for that lookup by itself.+ const [showHidden, setShowHidden] = useState(false);+ const showHiddenRef = useRef(showHidden);+ showHiddenRef.current = showHidden;++ // The search field holding a path whose last segment is not a folder (yet):+ // the folder above it is on screen, filtered to names starting with this.+ const [pathLeaf, setPathLeaf] = useState<string | null>(null);+ // Where a folder that does not exist could be made, and what to call it.+ const [createOffer, setCreateOffer] = useState<{+ parent: string | null;+ name: string;+ } | null>(null);+ const [naming, setNaming] = useState(false);+ const [newName, setNewName] = useState("");+ const [creating, setCreating] = useState(false);+ const [createNote, setCreateNote] = useState<string | null>(null);++ // Read through a ref by the search effect: the launcher may hand in a fresh+ // callback every render, and an effect keyed on it would re-run — and+ // re-fetch — on each of its own state updates.+ const onSelectRef = useRef(onSelect);+ onSelectRef.current = onSelect;++ const load = useCallback(async (target: string | null, hidden?: boolean) => {setLoading(true);setError(null);try {- const res = await fetchFolders(target);+ const res = await fetchFolders(target, hidden ?? showHiddenRef.current);setPath(res.path);setParent(res.parent);setEntries(res.entries);if (res.device_name) setDeviceName(res.device_name);+ // The start view names the home folder; its path is what an example+ // path is built from, so the hint shows THIS machine's spelling —+ // `C:\Users\me\…` here, `/Users/me/…` on a Mac — not a guess.+ if (target === null) {+ const homeEntry = res.entries.find((e) => e.name === "Home");+ if (homeEntry) setHome(homeEntry.path);+ }if (res.error) setError(res.error);} catch (e) {setError((e as Error).message);@@ -226,9 +271,69 @@ export function FolderPicker({.finally(() => setNativeOpen(false));};+ /**+ * A path typed into the search field is a place to go, not a name to find.+ *+ * The folder is listed and becomes the selection when it exists. When it does+ * not, the folder ABOVE it is listed instead, narrowed to names starting with+ * the last segment — so a half-typed name completes on screen — and, once+ * nothing matches, creating it is offered. Nothing here is relative to the+ * folder that happened to be open: a typed path means exactly what it says.+ */+ const goToTypedPath = useCallback((typed: string) => {+ const { dir, leaf } = splitTypedPath(typed);+ const hidden = showHiddenRef.current || leaf.startsWith(".");+ return fetchFolders(typed, hidden).then(async (res) => {+ if (res.device_name) setDeviceName(res.device_name);+ if (!res.error) {+ setPath(res.path);+ setParent(res.parent);+ setEntries(res.entries);+ setPathLeaf(null);+ setCreateOffer(null);+ setError(null);+ if (res.path) onSelectRef.current(res.path);+ return;+ }+ if (!dir || !leaf) {+ setError(res.error);+ setPathLeaf(null);+ setCreateOffer(null);+ return;+ }+ const above = await fetchFolders(dir, hidden);+ if (above.error) {+ setError(above.error);+ setPathLeaf(null);+ setCreateOffer(null);+ return;+ }+ setPath(above.path);+ setParent(above.parent);+ setEntries(above.entries);+ setError(null);+ setPathLeaf(leaf);+ setCreateOffer({ parent: above.path, name: leaf });+ });+ }, []);+// Server-side search once the query is long enough; shorter input just filters- // the folder list already on screen, which feels instant.+ // the folder list already on screen, which feels instant. A path goes its own+ // way (see `goToTypedPath`) and never reaches the name search.useEffect(() => {+ const typed = normalizeTypedPath(query);+ if (looksLikePath(typed)) {+ setSearchHits(null);+ setSearching(true);+ const handle = window.setTimeout(() => {+ goToTypedPath(typed)+ .catch((e) => setError((e as Error).message))+ .finally(() => setSearching(false));+ }, SEARCH_DEBOUNCE_MS);+ return () => window.clearTimeout(handle);+ }+ setPathLeaf(null);+ setCreateOffer(null);const trimmed = query.trim();if (trimmed.length < SEARCH_MIN) {setSearchHits(null);@@ -243,22 +348,59 @@ export function FolderPicker({.finally(() => setSearching(false));}, SEARCH_DEBOUNCE_MS);return () => window.clearTimeout(handle);- }, [query]);+ }, [query, goToTypedPath]);const visible = useMemo(() => {if (searchHits !== null) return searchHits;+ if (pathLeaf !== null) {+ const needle = pathLeaf.toLowerCase();+ return entries.filter((e) => e.name.toLowerCase().startsWith(needle));+ }+ const typed = normalizeTypedPath(query);+ // A path on its way to being listed: the folder itself is what is shown,+ // not the list filtered by a string no folder is called.+ if (looksLikePath(typed)) return entries;const needle = query.trim().toLowerCase();if (!needle) return entries;return entries.filter((e) => e.name.toLowerCase().includes(needle));- }, [entries, query, searchHits]);+ }, [entries, query, searchHits, pathLeaf]);const open = (item: FolderItem) => {onSelect(item.path);setQuery("");setSearchHits(null);+ setPathLeaf(null);+ setCreateOffer(null);void load(item.path);};+ /** Make the folder, then treat it like any other folder that was clicked. */+ const makeFolder = (parent: string | null, name: string) => {+ if (creating) return;+ setCreating(true);+ setCreateNote(null);+ createFolder({ parent, name })+ .then((res) => {+ if (res.error || !res.folder) {+ setCreateNote(res.error || "Could not create that folder.");+ return;+ }+ setNaming(false);+ setNewName("");+ setError(null);+ open(res.folder);+ })+ .catch((e) => setCreateNote((e as Error).message))+ .finally(() => setCreating(false));+ };++ const toggleHidden = () => {+ const next = !showHidden;+ setShowHidden(next);+ showHiddenRef.current = next;+ if (searchHits === null) void load(path, next);+ };+/*** A typed path is checked before it is chosen. The old order — select first,* then list — let "cd haral\.personal-jarvis" (not a folder anywhere) reach@@ -271,16 +413,22 @@ export function FolderPicker({if (!value) return;setLoading(true);setError(null);- fetchFolders(value)+ const { dir, leaf } = splitTypedPath(value);+ fetchFolders(value, showHiddenRef.current || leaf.startsWith(".")).then((res) => {if (res.device_name) setDeviceName(res.device_name);if (res.error) {setError(res.error);+ // Not a folder — but it could be one. The offer sits next to the+ // message, so a typo is corrected and a new project is created from+ // the same line.+ setCreateOffer(dir && leaf ? { parent: dir, name: leaf } : null);return;}setPath(res.path);setParent(res.parent);setEntries(res.entries);+ setCreateOffer(null);onSelect(res.path ?? value);}).catch((e) => setError((e as Error).message))@@ -344,6 +492,10 @@ export function FolderPicker({useDragSessionEnd(dragOver, clearDragOver);const searchingMachine = searchHits !== null;+ // What a full path looks like on THIS machine, for the placeholder and the+ // "nothing found" hints. Built from the real home folder, never from a+ // hard-coded `C:\…` — the same UI is opened against Macs and Linux boxes.+ const pathExample = home ? joinPath(home, "my-project") : null;return (<div@@ -385,8 +537,12 @@ export function FolderPicker({<Fieldvalue={query}onChange={(e) => setQuery(e.target.value)}- placeholder="Search folders by name…"- aria-label="Search folders by name"+ placeholder={+ pathExample+ ? `Search by name, or type a path like ${pathExample}`+ : "Search folders by name, or type a path…"+ }+ aria-label="Search folders by name, or type a path"data-testid="folder-search"className="w-full pl-8 pr-7"spellCheck={false}@@ -417,6 +573,38 @@ export function FolderPicker({{nativeOpen ? "Window open…" : "Browse"}</Button>)}+ <Button+ onClick={() => {+ setNaming(true);+ setNewName("");+ setCreateNote(null);+ }}+ disabled={naming}+ data-testid="new-folder"+ title={`Make a new folder in ${path ?? "your home folder"}`}+ >+ <FolderPlus className="h-3.5 w-3.5" />+ New folder+ </Button>+ <IconButton+ label={showHidden ? "Hide hidden folders" : "Show hidden folders"}+ title={+ showHidden+ ? "Hidden folders (names starting with a dot) are shown"+ : "Also list hidden folders — names starting with a dot"+ }+ aria-pressed={showHidden}+ onClick={toggleHidden}+ disabled={loading}+ data-testid="toggle-hidden"+ className={cn(showHidden && "text-primary")}+ >+ {showHidden ? (+ <Eye className="h-4 w-4" />+ ) : (+ <EyeOff className="h-4 w-4" />+ )}+ </IconButton><IconButtonlabel="Go up one folder"onClick={() => void load(parent)}@@ -470,6 +658,56 @@ export function FolderPicker({</p>)}+ {/* --------------------------------------------------------- new folder */}+ {naming && (+ <form+ data-testid="new-folder-form"+ className="flex items-center gap-1.5 px-3 pb-2"+ onSubmit={(e) => {+ e.preventDefault();+ if (newName.trim()) makeFolder(path, newName);+ }}+ >+ <FolderPlus className="h-4 w-4 shrink-0 text-primary" />+ <Field+ autoFocus+ value={newName}+ onChange={(e) => setNewName(e.target.value)}+ onKeyDown={(e) => {+ if (e.key === "Escape") setNaming(false);+ }}+ placeholder={`Name of the new folder in ${path ?? "your home folder"}`}+ aria-label="Name of the new folder"+ data-testid="new-folder-name"+ className="min-w-0 flex-1"+ spellCheck={false}+ autoComplete="off"+ />+ <Button+ type="submit"+ variant="primary"+ disabled={creating || !newName.trim()}+ data-testid="new-folder-create"+ >+ {creating ? (+ <Loader2 className="h-3.5 w-3.5 animate-spin" />+ ) : (+ <FolderPlus className="h-3.5 w-3.5" />+ )}+ Create+ </Button>+ <IconButton+ label="Cancel new folder"+ onClick={() => {+ setNaming(false);+ setCreateNote(null);+ }}+ >+ <X className="h-4 w-4" />+ </IconButton>+ </form>+ )}+{/* --------------------------------------------------------------- list */}<div className="min-h-[16rem] flex-1 overflow-y-auto scrollbar-jarvis border-y border-border/70">{recents.length > 0 && !searchingMachine && (@@ -537,11 +775,46 @@ export function FolderPicker({</>)}+ {/*+ The typed path's last segment is not a folder in the folder on+ screen, and nothing there starts with it either: the one thing left+ to do with that name is make it.+ */}+ {createOffer && pathLeaf !== null && visible.length === 0 && !searching && (+ <button+ type="button"+ data-testid="create-offer"+ onClick={() => makeFolder(createOffer.parent, createOffer.name)}+ disabled={creating}+ className="flex w-full items-center gap-2.5 px-3 py-2 text-left text-sm text-primary transition-colors hover:bg-secondary/60"+ >+ {creating ? (+ <Loader2 className="h-4 w-4 shrink-0 animate-spin" />+ ) : (+ <FolderPlus className="h-4 w-4 shrink-0" />+ )}+ <span className="min-w-0 flex-1">+ <span className="block truncate">+ Create folder “{createOffer.name}”+ </span>+ <span className="block truncate font-mono text-[10px] text-muted-foreground">+ in {createOffer.parent ?? "your home folder"}+ </span>+ </span>+ </button>+ )}+{visible.length === 0 && !loading && !searching ? (<p className="px-3 py-4 text-sm text-muted-foreground">{searchingMachine- ? "No folder with that name was found."- : "Nothing to list here — search above, drop a folder, or type its path below."}+ ? `No folder with that name was found.${+ pathExample+ ? ` To open one by where it is, type its full path — like ${pathExample}.`+ : ""+ }`+ : pathLeaf !== null+ ? `No folder here starts with “${pathLeaf}”.`+ : "Nothing to list here — search above, drop a folder, or type its path below."}</p>) : (<ul>@@ -603,16 +876,43 @@ export function FolderPicker({</div>{/* ------------------------------------------------------------- typing */}- <PathInput base={path} onUse={usePath} />+ <PathInput base={path} showHidden={showHidden} onUse={usePath} />{/* ---------------------------------------------------------- reporting */}- {(error || nativeNote || dropNote) && (+ {(error || nativeNote || dropNote || createNote) && (<div className="space-y-1 px-3 pb-3">{error && (<p className="text-xs text-destructive" role="alert">{error}</p>)}+ {error && pathExample && (+ <p className="text-xs text-muted-foreground">+ A full path on this machine looks like{" "}+ <code className="font-mono">{pathExample}</code>.+ </p>+ )}+ {/* The path field's "no such folder", answered: make it. */}+ {error && createOffer && pathLeaf === null && (+ <Button+ onClick={() => makeFolder(createOffer.parent, createOffer.name)}+ disabled={creating}+ data-testid="create-offer"+ className="h-7 text-xs"+ >+ {creating ? (+ <Loader2 className="h-3.5 w-3.5 animate-spin" />+ ) : (+ <FolderPlus className="h-3.5 w-3.5" />+ )}+ Create folder “{createOffer.name}”+ </Button>+ )}+ {createNote && (+ <p className="text-xs text-destructive" role="alert">+ {createNote}+ </p>+ )}{nativeNote && !nativeOpen && (<p className="text-xs text-muted-foreground" role="alert">{nativeNote}@@ -685,6 +985,9 @@ export function joinPath(base: string, name: string): string {export function normalizeTypedPath(raw: string): string {let value = raw.trim();value = value.replace(/^cd(?:\s+\/d)?(?:\s+|$)/i, "").trim();+ // A prompt copied whole — `PS C:\Users\me>` — is the path with a shell's+ // decoration on both ends; the decoration is not part of the folder.+ value = value.replace(/^PS\s+/, "").replace(/\s*>$/, "").trim();const quoted = value.match(/^(["'])(.*)\1$/);if (quoted) value = quoted[2].trim();return value;@@ -695,6 +998,17 @@ export function isAbsolutePath(value: string): boolean {return /^(?:[a-zA-Z]:[\\/]|[\\/]|~)/.test(value);}+/**+ * Text that names a PLACE rather than a folder to look for.+ *+ * A root or a separator anywhere is the tell: nobody searches for a folder+ * called `Desktop\shop`, they mean the one at that path. A bare name stays a+ * search, which is what a search field is for.+ */+export function looksLikePath(value: string): boolean {+ return isAbsolutePath(value) || /[\\/]/.test(value);+}+/*** The folder a typed path means, given the folder on screen.*@@ -725,9 +1039,11 @@ export function resolveTypedPath(raw: string, base: string | null): string {*/function PathInput({base,+ showHidden,onUse,}: {base: string | null;+ showHidden: boolean;onUse: (value: string) => void;}) {const [value, setValue] = useState("");@@ -752,7 +1068,9 @@ function PathInput({}let cancelled = false;const handle = window.setTimeout(() => {- fetchFolders(lookupDir || null)+ // A dot-name completes against hidden folders whether or not they are+ // switched on: typing `.cl` is the request to see `.claude`.+ fetchFolders(lookupDir || null, showHidden || leaf.startsWith(".")).then((res) => {if (cancelled) return;const needle = leaf.toLowerCase();@@ -771,7 +1089,7 @@ function PathInput({cancelled = true;window.clearTimeout(handle);};- }, [lookupDir, leaf, value, base]);+ }, [lookupDir, leaf, value, base, showHidden]);/** Take a suggestion and leave the cursor ready for the next segment. */const complete = (item: FolderItem) => {@@ -860,7 +1178,7 @@ function PathInput({{open && options.length > 0 && (<uldata-testid="path-suggestions"- className="absolute bottom-full left-3 right-3 z-30 mb-1 max-h-48 overflow-y-auto scrollbar-jarvis rounded-control border border-border bg-popover shadow-xl"+ className="absolute bottom-full left-3 right-3 z-30 mb-1 max-h-48 overflow-y-auto scrollbar-jarvis rounded-control border border-border bg-popover">{options.slice(0, 40).map((item, index) => (<li key={item.path}>diff --git a/tests/unit/web/test_agentic_ide_grid.py b/tests/unit/web/test_agentic_ide_grid.pyindex a53d11ea76..4cab02e298 100644--- a/tests/unit/web/test_agentic_ide_grid.py+++ b/tests/unit/web/test_agentic_ide_grid.py@@ -139,7 +139,9 @@ async def test_terminals_stay_in_reading_order(tmp_path) -> None:await registry.add_terminal(anchor=first, direction="down")placed = grid(registry)- assert [(c, s) for _, c, s in placed] == [(0, 0), (0, 1), (1, 0), (1, 1)]+ # Across the top band, then across the bottom one — a 2×2 is read the way+ # a page is, not down one column and back up the next.+ assert [(c, s) for _, c, s in placed] == [(0, 0), (1, 0), (0, 1), (1, 1)]assert [t.index for t in registry.session.terminals] == [0, 1, 2, 3]diff --git a/tests/unit/web/test_agentic_ide_layout_tree.py b/tests/unit/web/test_agentic_ide_layout_tree.pyindex 5993cd7066..f2e7ff1419 100644--- a/tests/unit/web/test_agentic_ide_layout_tree.py+++ b/tests/unit/web/test_agentic_ide_layout_tree.py@@ -28,6 +28,41 @@ def check_canonical(node: lt.LayoutNode | None) -> None:check_canonical(child)+def boxes(+ node: lt.LayoutNode | None,+ box: tuple[float, float, float, float] = (0.0, 0.0, 1.0, 1.0),+) -> dict[str, tuple[float, float, float, float]]:+ """Every pane's rectangle as fractions of the workspace — the PICTURE.++ The frontend's ``treeLayout`` arithmetic, repeated here so a test can ask+ "does this tree draw what that tree drew?" without caring how the tree is+ shaped. That is exactly the question ``rows_outermost`` has to answer yes+ to: it moves boundaries between CONTAINERS, never on screen.+ """+ x, y, width, height = box+ if node is None:+ return {}+ if isinstance(node, Leaf):+ return {node.pane: (round(x, 9), round(y, 9), round(width, 9), round(height, 9))}+ weights = [lt._clean_weight(node.weights[i]) for i in range(len(node.children))]+ total = sum(weights) or 1.0+ along = width if node.direction == "row" else height+ cursor = x if node.direction == "row" else y+ drawn: dict[str, tuple[float, float, float, float]] = {}+ for child, weight in zip(node.children, weights, strict=True):+ share = (weight / total) * along+ drawn.update(+ boxes(+ child,+ (cursor, y, share, height)+ if node.direction == "row"+ else (x, cursor, width, share),+ )+ )+ cursor += share+ return drawn++# ------------------------------------------------------------ opening shapes@@ -37,8 +72,17 @@ def test_wizard_tree_of_one_is_a_bare_leaf() -> None:def test_wizard_tree_stacks_two_deep_before_opening_a_column() -> None:tree = lt.wizard_tree(["t1", "t2", "t3", "t4"], 2)- assert isinstance(tree, Split) and tree.direction == "row"- assert [lt.leaves(child) for child in tree.children] == [["t1", "t2"], ["t3", "t4"]]+ # Two columns of two, stood on their rows so each band owns its own+ # vertical seam — and seated in reading order, so the panes come out in+ # the sequence they were handed over in.+ assert boxes(tree) == {+ "t1": (0.0, 0.0, 0.5, 0.5),+ "t2": (0.5, 0.0, 0.5, 0.5),+ "t3": (0.0, 0.5, 0.5, 0.5),+ "t4": (0.5, 0.5, 0.5, 0.5),+ }+ assert isinstance(tree, Split) and tree.direction == "column"+ assert lt.leaves(tree) == ["t1", "t2", "t3", "t4"]check_canonical(tree)@@ -159,6 +203,190 @@ def test_appending_takes_an_even_share_of_a_dragged_row() -> None:assert tree.weights == [3.0, 1.0, 2.0]+# --------------------------------------------------------- a grid on rows+++def test_a_grid_reached_either_way_comes_out_the_same() -> None:+ """The 2026-08-25 report: split order decided how the seams behaved.++ Right-then-down-twice used to leave ``row[column, column]``, whose middle+ line runs the full height — drag it under the bottom pair and the top+ pair moves with it. Down-then-right-twice left the transpose, where each+ band resizes on its own. Same picture, two behaviours. Now both orders+ land on the second, so a workspace behaves the way it looks.+ """+ right_first = lt.split_pane(Leaf(pane="t1"), "t1", "t2", "right")+ right_first = lt.split_pane(right_first, "t1", "t3", "down")+ right_first = lt.split_pane(right_first, "t2", "t4", "down")++ down_first = lt.split_pane(Leaf(pane="t1"), "t1", "t3", "down")+ down_first = lt.split_pane(down_first, "t1", "t2", "right")+ down_first = lt.split_pane(down_first, "t3", "t4", "right")++ assert boxes(right_first) == boxes(down_first)+ assert lt.same_shape(right_first, down_first)+ assert isinstance(right_first, Split) and right_first.direction == "column"+ check_canonical(right_first)+++def test_standing_a_grid_on_its_rows_moves_nothing() -> None:+ """The whole promise: containers change hands, the picture does not."""+ columns = Split(+ direction="row",+ children=[+ Split(+ direction="column",+ children=[Leaf(pane="t1"), Leaf(pane="t2")],+ weights=[3.0, 1.0],+ ),+ Split(+ direction="column",+ children=[Leaf(pane="t3"), Leaf(pane="t4")],+ weights=[6.0, 2.0], # the same 3:1, said differently+ ),+ ],+ weights=[2.0, 1.0],+ )+ rows = lt.rows_outermost(columns)+ assert boxes(rows) == boxes(columns)+ assert isinstance(rows, Split) and rows.direction == "column"+ assert [lt.leaves(band) for band in rows.children] == [["t1", "t3"], ["t2", "t4"]]+ check_canonical(rows)+++def test_columns_cut_at_different_heights_are_left_alone() -> None:+ """No row structure can draw two bands that do not line up, so: hands off.++ This is also what keeps the rule off a hand-sized workspace — a column+ dragged out of line with its neighbour simply stops qualifying.+ """+ ragged = Split(+ direction="row",+ children=[+ Split(+ direction="column",+ children=[Leaf(pane="t1"), Leaf(pane="t2")],+ weights=[3.0, 1.0],+ ),+ Split(+ direction="column",+ children=[Leaf(pane="t3"), Leaf(pane="t4")],+ weights=[1.0, 3.0],+ ),+ ],+ weights=[1.0, 1.0],+ )+ stood = lt.rows_outermost(ragged)+ assert isinstance(stood, Split) and stood.direction == "row"+ assert boxes(stood) == boxes(ragged)+++def test_an_incomplete_grid_is_left_alone() -> None:+ """Two stacks and a full-height pane are not a rectangle — nothing to do."""+ tree = Split(+ direction="row",+ children=[+ Split(+ direction="column",+ children=[Leaf(pane="t1"), Leaf(pane="t2")],+ weights=[1.0, 1.0],+ ),+ Leaf(pane="t3"),+ ],+ weights=[1.0, 1.0],+ )+ stood = lt.rows_outermost(tree)+ assert isinstance(stood, Split) and stood.direction == "row"+ assert boxes(stood) == boxes(tree)+++def test_standing_a_grid_on_its_rows_settles_at_once() -> None:+ """Idempotent, so repeated edits cannot flip a workspace back and forth."""+ once = lt.rows_outermost(lt.wizard_tree(["t1", "t2", "t3", "t4", "t5", "t6"], 3))+ assert lt.rows_outermost(once) == once+++def test_a_hand_sized_grid_keeps_its_pin_on_the_bands() -> None:+ """The row's hand-set widths become each band's — the sizes were the WIDTHS."""+ columns = Split(+ direction="row",+ children=[+ Split(+ direction="column",+ children=[Leaf(pane="t1"), Leaf(pane="t2")],+ weights=[1.0, 1.0],+ ),+ Split(+ direction="column",+ children=[Leaf(pane="t3"), Leaf(pane="t4")],+ weights=[1.0, 1.0],+ ),+ ],+ weights=[3.0, 1.0],+ pinned=True,+ )+ rows = lt.rows_outermost(columns)+ assert isinstance(rows, Split)+ assert all(isinstance(band, Split) and band.pinned for band in rows.children)+ # And the pin does its job: an evening pass leaves those widths alone.+ assert boxes(lt.evened(rows)) == boxes(rows)++[email protected]("count", [1, 2, 3, 4, 5, 6, 7, 8, 9, 12])+def test_the_wizard_preview_seats_panes_where_the_backend_does(count: int) -> None:+ """The preview labels its tiles with the agents' names — so WHICH, not just where.++ `wizardPanes` (frontend ``layout.ts``) is the preview's half of this+ function, and the two now have a fill order to agree on as well as a+ shape: a full rectangle is read across its bands, a ragged count down its+ columns. This is the parity test that keeps them from drifting — the+ frontend's own copy is pinned in ``layout.test.ts``.+ """+ depth = 2 # WIZARD_COLUMN_HEIGHT+ keys = [f"t{index + 1}" for index in range(count)]+ hints = lt.grid_hints(lt.wizard_tree(keys, depth))++ across = -(-count // depth)+ rectangular = across > 0 and count == across * depth+ preview = [+ (index % across, index // across) if rectangular else (index // depth, index % depth)+ for index in range(count)+ ]+ assert [hints[key] for key in keys] == preview+++def test_a_grid_stands_on_its_rows_after_a_close_too() -> None:+ """A close can leave a rectangle behind; it gets the same treatment.++ Two stacks beside a full-height pane is not a grid, so nothing is stood on+ anything while t5 is there. Closing t5 makes it one, and the survivors get+ their per-band seams without the user having to split again.+ """+ tree = Split(+ direction="row",+ children=[+ Split(+ direction="column",+ children=[Leaf(pane="t1"), Leaf(pane="t3")],+ weights=[1.0, 1.0],+ ),+ Split(+ direction="column",+ children=[Leaf(pane="t2"), Leaf(pane="t4")],+ weights=[1.0, 1.0],+ ),+ Leaf(pane="t5"),+ ],+ weights=[1.0, 1.0, 1.0],+ )+ assert lt.rows_outermost(tree) == tree++ closed = lt.remove_pane(tree, "t5")+ assert isinstance(closed, Split) and closed.direction == "column"+ assert [lt.leaves(band) for band in closed.children] == [["t1", "t2"], ["t3", "t4"]]+ check_canonical(closed)++# ------------------------------------------------------------- evening out@@ -406,15 +634,14 @@ def test_dropping_left_of_a_pane_takes_that_panes_left_half() -> None:tree = lt.wizard_tree(["t1", "t2", "t3", "t4"], 2)moved = lt.move_pane(tree, "t1", "t4", "left")- assert isinstance(moved, Split) and moved.direction == "row"- first, second = moved.children- # The vacated half folds away: t2 stands alone, full height.- assert first == Leaf(pane="t2")- assert isinstance(second, Split) and second.direction == "column"- assert second.children[0] == Leaf(pane="t3")- cell = second.children[1]- assert isinstance(cell, Split) and cell.direction == "row"- assert lt.leaves(cell) == ["t1", "t4"]+ # t1 lands in t4's left half — an eighth of the workspace each — and the+ # top band closes over the hole t1 left, t2 taking the full width.+ assert boxes(moved) == {+ "t2": (0.0, 0.0, 1.0, 0.5),+ "t3": (0.0, 0.5, 0.5, 0.5),+ "t1": (0.5, 0.5, 0.25, 0.5),+ "t4": (0.75, 0.5, 0.25, 0.5),+ }check_canonical(moved)@@ -519,5 +746,6 @@ def test_grid_hints_are_exact_for_flat_shapes() -> None:def test_grid_hints_stay_coarse_but_ordered_for_nested_shapes() -> None:stack = lt.wizard_tree(["t1", "t2"], 2)tree = lt.split_pane(stack, "t1", "t3", "right")- # One top-level stack → one column; slots follow reading order.- assert lt.grid_hints(tree) == {"t1": (0, 0), "t3": (0, 1), "t2": (0, 2)}+ # A stack of bands: the band is the slot, reading across it the column.+ # t1 and t3 share the top band, t2 has the bottom one to itself.+ assert lt.grid_hints(tree) == {"t1": (0, 0), "t3": (1, 0), "t2": (0, 1)}