Three things that said one thing and did another
All three shipped in the last two commits, and all three are the same kind of mistake: an interface that looks right and is not. The folder settings page could not be scrolled. `.main` is a flex column with `min-height: 0`, so a `.page` dropped straight into it overflows the viewport with nothing to scroll -- Save and Back end up below the bottom of the window, reachable by zooming out or by dragging the prompt textarea up out of the way. Every other page of this shape already wraps its content in `.admin-scroll`; this one did not. The two class names that scroll are one rule in admin.css precisely so this is a wrapper somebody forgot rather than a value they got wrong, and now it is noted. The project directory was a text box, on the one screen that asks for an absolute path on another machine. It is the same button-and-hidden-field the new-chat screen uses, wired by `[data-dir-field]` in ui.js -- scoped to that attribute so this and the composer's own handler cannot both answer one click and open two dialogs. The composer keeps its own because it does more: it follows the selected profile's default directory until somebody picks their own, which only means something while a chat is being created. With no connection chosen it says so rather than opening onto nothing, and Clear is always there, because browsing somewhere and changing your mind before saving needs a way back to "no opinion" as much as clearing a saved one does. And "New chat" did not follow the Chat/Agent switch. The button sits above the scroll area rather than inside the tree the switch swaps, so it went on saying "New chat" over a list of agent chats. It moves to its own partial and arrives out of band, the way the chat title already does. Renaming it to something neutral would have hidden the bug rather than fixed it, and would have cost the `?kind=agent` preselection the label is there to explain. The tests that existed asserted a page load, which re-renders the button anyway -- which is exactly why nobody saw it. The new ones assert the fragment. The directory field was driven under a DOM stub first. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
fd4db76c64
commit
a56ee16ee3
@@ -0,0 +1,40 @@
|
||||
{% from "_macros.html" import icon %}
|
||||
{#
|
||||
New chat, and New folder.
|
||||
|
||||
Its own partial because "New chat" changes with the Chat/Agent switch and this
|
||||
row sits *outside* the tree the switch swaps -- above the scroll area, so it
|
||||
does not scroll away. It arrives out of band instead, the move the `done`
|
||||
frame already makes for the chat title.
|
||||
|
||||
It was not a partial to begin with, and the button went on saying "New chat"
|
||||
after the switch moved to Agents while the tree beneath it showed agent chats.
|
||||
Whether it worked was not the question: it said one thing and did another,
|
||||
which is exactly the shape of failure the switch itself was arranged to avoid.
|
||||
#}
|
||||
{% if can.get("chat.create") or can.get("folder.manage") %}
|
||||
<div class="sidebar__actions" id="sidebar-actions"
|
||||
{% if oob %}hx-swap-oob="true"{% endif %}>
|
||||
{% if can.get("chat.create") %}
|
||||
{# Carries the side the switch is on, so this opens the new-chat screen
|
||||
already on the right fork. #}
|
||||
<a class="btn btn--primary btn--grow"
|
||||
href="/chat{{ '?kind=agent' if sidebar_kind == 'agent' else '' }}">
|
||||
{{ icon("plus", "icon--sm") }}
|
||||
{{ "New agent chat" if sidebar_kind == "agent" else "New chat" }}
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if can.get("folder.manage") %}
|
||||
{# Asks for the name rather than making "New folder" and leaving somebody to
|
||||
find the rename. `data-prompt` writes the answer into hx-vals before the
|
||||
request goes out; see ui.js for why this is not htmx's own hx-prompt. #}
|
||||
<button class="btn btn--icon" hx-post="/api/folders" hx-swap="none"
|
||||
data-prompt="What should this folder be called?"
|
||||
data-prompt-title="New folder" data-prompt-field="name"
|
||||
data-prompt-label="Create"
|
||||
aria-label="New folder" title="New folder">
|
||||
{{ icon("folder") }}
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -46,6 +46,19 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{#
|
||||
"New chat" becomes "New agent chat" with the switch, and it lives above the
|
||||
scroll area rather than inside this fragment -- so it comes along out of
|
||||
band. Only when this is the fragment response: on a full page load the row
|
||||
is already rendered in its own place, and a second copy marked
|
||||
`hx-swap-oob` would be a stray element sitting in the tree.
|
||||
#}
|
||||
{% if oob %}
|
||||
{% with oob = true %}
|
||||
{% include "partials/_sidebar_actions.html" %}
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
|
||||
{% if folders %}
|
||||
<div class="nav-group">
|
||||
<div class="nav-group__label">Folders</div>
|
||||
|
||||
@@ -11,31 +11,7 @@
|
||||
{{ brand(uid="side") }}
|
||||
</div>
|
||||
|
||||
{% if can.get("chat.create") or can.get("folder.manage") %}
|
||||
<div class="sidebar__actions">
|
||||
{% if can.get("chat.create") %}
|
||||
{# Carries the side the switch is on, so "New chat" on the Agent side opens
|
||||
the new-chat screen already set to an agent chat. #}
|
||||
<a class="btn btn--primary btn--grow"
|
||||
href="/chat{{ '?kind=agent' if sidebar_kind == 'agent' else '' }}">
|
||||
{{ icon("plus", "icon--sm") }}
|
||||
{{ "New agent chat" if sidebar_kind == "agent" else "New chat" }}
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if can.get("folder.manage") %}
|
||||
{# Asks for the name rather than making "New folder" and leaving somebody to
|
||||
find the rename. `data-prompt` writes the answer into hx-vals before the
|
||||
request goes out; see ui.js for why this is not htmx's own hx-prompt. #}
|
||||
<button class="btn btn--icon" hx-post="/api/folders" hx-swap="none"
|
||||
data-prompt="What should this folder be called?"
|
||||
data-prompt-title="New folder" data-prompt-field="name"
|
||||
data-prompt-label="Create"
|
||||
aria-label="New folder" title="New folder">
|
||||
{{ icon("folder") }}
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% include "partials/_sidebar_actions.html" %}
|
||||
|
||||
{# Every 10s, refresh the unread dots and announce anything that finished
|
||||
while this page was showing something else. Out-of-band spans only, so the
|
||||
|
||||
Reference in New Issue
Block a user