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
@@ -0,0 +1,69 @@
{% from "_macros.html" import icon %}
{#
One directory on the far side, inside the composer's directory dialog.
Swapped in whole on every step rather than filtered in the browser: a
directory listing is a round trip to somebody else's machine, and there is no
local copy to filter. `here` is what the Use button submits, so it is carried
on the container rather than recomputed from whatever row was last clicked.
Everything here is a name from a remote filesystem, so everything is escaped
by Jinja's autoescaping and none of it is ever marked safe.
#}
<div id="dir-results" data-here="{{ here }}">
<p class="dialog__where">
{{ icon("folder-open", "icon--sm") }}
<span class="mono">{{ here }}</span>
</p>
{% if error %}
<div class="alert alert--danger">{{ error }}</div>
{% else %}
<ul class="picker__list">
{% if parent %}
<li>
<button class="picker__option" type="button" data-dir-open="{{ parent }}">
{{ icon("chevron-left", "icon--sm") }}
<span class="picker__option-body">
<span class="picker__option-name">Up a level</span>
<span class="picker__option-note mono">{{ parent }}</span>
</span>
</button>
</li>
{% endif %}
{% for entry in entries %}
{# Files are listed but not selectable. Hiding them would make a directory
of only files look empty, which is worse than showing what is there and
not letting it be chosen. #}
<li>
{% if entry.is_dir %}
<button class="picker__option" type="button"
data-dir-open="{{ (here.rstrip('/') ~ '/' ~ entry.name) if here != '/' else '/' ~ entry.name }}">
{{ icon("folder", "icon--sm") }}
<span class="picker__option-body">
<span class="picker__option-name">{{ entry.name }}</span>
</span>
{{ icon("chevron-right", "icon--sm") }}
</button>
{% else %}
<span class="picker__option is-inert">
{{ icon("file-text", "icon--sm") }}
<span class="picker__option-body">
<span class="picker__option-name">{{ entry.name }}</span>
</span>
</span>
{% endif %}
</li>
{% endfor %}
{% if not entries %}
<li>
<p class="muted text-sm" style="padding: var(--sp-3)">
Nothing here.
</p>
</li>
{% endif %}
</ul>
{% endif %}
</div>