A directory chip that stopped eating the row

The project directory showed its whole path, which on anything real filled the
chip's 16rem basis and pushed the Manual/Edit/Auto/Plan select off the end of
the composer. It shows the directory's own name now, with the full path in the
tooltip -- the leading directories are the part nobody reads, since what you
check before sending is that you are in `myproject` rather than `myproject-old`.

The hidden field still submits the whole path. Shortening a label must never
shorten a value, and there is a test on the row rather than on the markup for
exactly that.

Three CSS rules hold the row together, and none of them is visible from the
markup. `.composer__agent` needed `min-width: 0`: a flex item will not shrink
below its content without it, so the group refused to give and the *last* child
was what fell off -- which is why the mode select was the thing being cut rather
than the path that was too long. `.composer__dir` is capped, being the only
child here whose content is unbounded; a connection name and a mode are both
short and known. And the mode select is `flex: none`, because it is read and
changed constantly and should never be the thing that scrolls out of reach.

`baseName` driven under node against ten paths, trailing slashes and `/`
included. The topbar's copy of the same path was already capped and truncating,
so it is left alone.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jaroslav Beneš
2026-08-04 13:17:56 +02:00
parent 48a66a4037
commit c0d6056ec4
4 changed files with 117 additions and 8 deletions
+16 -1
View File
@@ -20,7 +20,7 @@ lembas info # paths + counts, useful when confused
lembas secret-key # generate LEMBAS_SECRET_KEY
lembas create-admin # create or promote an admin
pytest # 1417 tests, ~88s
pytest # 1420 tests, ~88s
# PLAN.md tracks what is and is not built
ruff check . # lint (line length 100)
python scripts/build_artwork.py # regenerate artwork (SVG + PWA icons;
@@ -777,6 +777,21 @@ pins that each one has a row in `SHORTCUTS` — `/help` reads that list, so a ke
missing from it is a key nobody can discover, and that is the direction this
actually rots.
**The directory chip shows a name, not a path.** A real project path is long
enough that showing it whole filled the chip's 16rem basis and pushed the mode
select off the end of the row -- and the leading directories are the part nobody
reads: what you check before sending is that you are in `myproject` rather than
`myproject-old`. `setDir` shows `baseName(path)` and puts the whole thing in the
tooltip; the hidden field still submits the full path, because shortening a
label must never shorten a value, and there is a test on the row for that. Three
CSS rules hold the row together and none of them is visible from the markup:
`.composer__agent` needs `min-width: 0` or the group will not shrink below its
content and the *last* child is what falls off, `.composer__dir` is capped
because it is the only child here whose content is unbounded, and the mode
select is `flex: none` because it is the control being read and changed
constantly. The topbar's copy of the same path was already bounded and
truncating, and is left alone.
**The composer's toolbar is one row, always.** It used to wrap, and
`.composer__actions` is last in the DOM with `margin-left: auto` — so the moment
an agent chat added a connection, a directory and a mode, Send and the