The composer decides what a chat is, and the topbar stops trying

The mode select in the topbar posted with hx-post against a route that only
answers PATCH, so every change returned 405 and the mode never moved. htmx
shows nothing when a request fails, so the control looked like it worked: the
select stayed where you put it and the server ignored you. It has never worked.

Two more of the same kind. A mode could not be chosen at all until the chat
existed, so reaching Plan meant sending something in Manual first and letting
the model answer under the wrong rules. And the project directory box was real
and submitted, but unlabelled and squeezed to a few characters by the select
beside it, so it read as broken -- which is how it was reported.

So the kind, the connection, the directory and the mode move out of the strip
above the text and into one toolbar row beneath it, where attach and send
already are. The directory becomes a button that opens a browser over SFTP,
because a path is something you would rather find than spell. `scan_dir` is new
beside `list_dir`: a picker has to tell a directory from a file before it can
draw the row, and `list_dir` backs a tool whose contract is a list of names and
must not change under a model mid-conversation.

Browsing is a person clicking, not a model calling, so it does not pass through
policy.py -- the same argument the terminal panel rests on. It does mean Manual
mode has a second exception now.

Also: .chip was two components with one name, and the attachment card won, so
the Chat/Agent pills silently wore its padding. --radius-md was used twice and
declared nowhere, so both fell back to 0. .btn.is-active has been set by
syncToggles since the terminal landed and styled by nothing. Enter-to-send
ignored isComposing, so committing an IME candidate sent the message. The
terminal had five colours of a sixteen-colour palette, with fallbacks from a
palette that no longer exists.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jaroslav Beneš
2026-08-02 16:44:57 +02:00
parent cab8025346
commit a7e59a00f8
22 changed files with 1449 additions and 276 deletions
+31 -7
View File
@@ -40,18 +40,39 @@
}
/* --- Theme -------------------------------------------------------------- */
/* The sixteen ANSI slots, in the order xterm names them. A shell chooses
these itself -- `ls --color`, a git diff, htop's meters -- so without them
the panel rendered a foreign palette inside the application, and switching
to Shire left dark-theme colours on parchment. */
var ANSI = [
"black", "red", "green", "yellow", "blue", "magenta", "cyan", "white",
"brightBlack", "brightRed", "brightGreen", "brightYellow",
"brightBlue", "brightMagenta", "brightCyan", "brightWhite"
];
function readTheme() {
var style = getComputedStyle(document.documentElement);
function token(name, fallback) {
return (style.getPropertyValue(name) || "").trim() || fallback;
}
return {
var theme = {
background: token("--code-bg", "#0C0F13"),
foreground: token("--ink", "#E8E2D4"),
cursor: token("--accent", "#C9A227"),
foreground: token("--ink", "#E4E8EC"),
cursor: token("--accent", "#8FB3CC"),
cursorAccent: token("--code-bg", "#0C0F13"),
selectionBackground: token("--accent-soft", "rgba(201, 162, 39, 0.3)")
selectionBackground: token("--accent-soft", "rgba(143, 179, 204, 0.3)")
};
/* camelCase to --kebab-case: brightBlack -> --ansi-bright-black. A slot
with no token is left off the object entirely rather than set to
undefined, which xterm treats as a colour and renders as black. */
ANSI.forEach(function (name) {
var value = token(
"--ansi-" + name.replace(/[A-Z]/g, function (c) { return "-" + c.toLowerCase(); }),
""
);
if (value) theme[name] = value;
});
return theme;
}
/* --- Sizing ------------------------------------------------------------- */
@@ -163,13 +184,16 @@
return false;
}
var style = getComputedStyle(document.documentElement);
term = new Terminal({
allowProposedApi: true,
convertEol: false,
cursorBlink: true,
fontFamily: getComputedStyle(document.documentElement)
.getPropertyValue("--font-mono").trim() || "monospace",
fontSize: 13,
fontFamily: style.getPropertyValue("--font-mono").trim() || "monospace",
/* xterm wants a number, so the token has to be a plain pixel value and
is parsed back out here. Reading it rather than repeating 13 is what
keeps it adjustable in one place with everything else. */
fontSize: parseFloat(style.getPropertyValue("--terminal-font-size")) || 13,
scrollback: 5000,
theme: readTheme()
});