Skip to content

Studio: four root causes behind nine QA bugs (press, hints, focus, failures, Esc, top bar, untrusted text) #1036

Done
7 of 7 issues completed

Description

@danielrispler

Problem Statement

A QA pass of main at 29d974c found nine bugs that Daniel hits in ordinary use. It drove a real plotkeeper on an isolated home folder, with real hook events and real mouse and key input in Chrome; the evidence is in local-evidence/2026-12-01-qa-root-causes/reports/qa-report.md. Every bug was re-checked against the code by a second reviewer, and none was rejected.

What Daniel sees:

  • A permission card in the dock asks "Allow Bash?" over a command it does not show whole. A line break shows as a space, so echo "done" followed by a second command on the next line reads as one command. A long command runs past the card's edge, so its tail (for example && rm -rf ~/Documents) appears only if he scrolls the card sideways, and Allow sits right under it.
  • Pressing a History row with the mouse closes the left panel instead of opening that session's story. Ended sessions cannot be opened with the mouse at all; Enter on the row works.
  • After that press, the row's hint stays open in the window's top-left corner, over the top bar, until Esc.
  • With a session badge's list open from the keyboard, when that badge goes away (its session starts a turn that has changed no file yet) the focus falls to the page's body. Tab starts again from the top.
  • Pre-flight says "No open issues." when gh failed to list them (not logged in, offline). A failure reads as a fact.
  • While plotkeeper is down, an action fails with a raw "select: Failed to fetch" under the top bar's own "Lost connection to plotkeeper — retrying".
  • In a wide window, Esc does nothing the first time while the pointer rests on the session list. A second Esc closes the left panel.
  • In a narrow window (about 640 px and below) the top bar pushes Needs you and Settings past its right edge, where they cannot be reached.
  • A session name has no length limit. A 4,800-character name is stored, and the Delete dialog becomes a screen-tall wall of it.

These look like nine bugs, but they come from four root causes:

  1. An interaction that outlives its element. One press or hover both changes the page and is then read against it. Three places read the interaction after the element it named has left the page:
    • the left panel's outside-press check, which runs after the History row was replaced;
    • a hint, whose trigger left the page while it was open;
    • the badge list, whose badge left the page while the focus was inside it.
  2. A failure drawn as a result, or in transport words. The page has no shared shape for a failed read or an unreachable server. Pre-flight turns a failure into an empty list, and the transport lets the browser's network error through unchanged.
  3. State that does not match the layout. The page keys behaviour or layout on something that is not what shows:
    • Esc reads the list's peek class, which is on the body at every width but is drawn only when the list is a strip.
    • The top bar's items are all fixed-size inside a bar that clips, so text cannot give way to buttons.
  4. Text the page does not bound. Text from an agent or from Daniel is drawn with no rule for its length or its line breaks: a permission's command in an inline code span that never wraps, and a session name stored at any length.

Solution

Each root cause gets one rule, applied everywhere it holds, not only at the place the QA pass hit.

  1. An interaction is judged where its element was when it happened, and lost state falls back to the nearest owner still on the page.
    • The left panel's outside-press check reads where the press landed at the moment it landed, so a press inside the panel never closes it, even when that press redraws the panel.
    • A hint whose trigger has left the page closes.
    • A badge list whose badge is gone gives the focus to that part's open button (or the zone's), as a redraw already does for a focused badge.
  2. A failed read says it failed, in plain words; an unreachable plotkeeper has one message.
    • The transport turns the browser's network failure into one plain error, "plotkeeper is not reachable".
    • While the top bar shows its connection line, that error is not repeated in the notice line.
    • Pre-flight says it could not read the open issues, with the reason, and its text box and Pick parts by hand stay usable.
  3. Behaviour and layout follow what shows.
    • Esc closes the list only when the list is drawn over the map. In the full layout the list is a column, so Esc goes straight to the map's layers.
    • The top bar's text gives way and buttons never do: the project name, the install hint and the connection line shrink and end in "…", and Needs you, Settings and the bar's own buttons keep their size, inside the window at every width down to 390 px.
  4. Untrusted text has a bound fitted to what it is for.
    • A permission's command, what Allow approves, is shown whole: a block that keeps its line breaks and wraps long lines. Past about twelve lines the block scrolls on its own, with the decision buttons always under it.
    • A session name is capped at 200 characters, in the rename field and on the server. A name already longer in an old log wraps and scrolls in the rename and Delete dialogs, never past the window.

User Stories

  1. As Daniel, I want a permission card to show its command whole, with its line breaks, so that I never approve a second command I could not see.
  2. As Daniel, I want a long command in a permission card to wrap inside the card, so that I never scroll sideways to read what I am about to allow.
  3. As Daniel, I want a very long command to scroll inside its own box with Allow and Deny always under it, so that the dock stays usable however long the command is.
  4. As Daniel, I want the command's description to stay under the command, so that I read the agent's reason after what it runs.
  5. As Daniel, I want pressing a History row with the mouse to open that session's story, so that I can read an ended session.
  6. As Daniel, I want the mouse and Enter to do the same thing on a History row, so that the row does not behave differently by input.
  7. As Daniel, I want a press anywhere inside the left panel never to close it, even when the press changes what the panel shows, so that the panel's own rows and buttons are safe to press.
  8. As Daniel, I want a press outside the left panel to keep closing it as today, so that light dismiss still works.
  9. As Daniel, I want a hint to close when the thing it describes leaves the page, so that no hint stays stuck over the top bar.
  10. As Daniel, I want a hint whose trigger the page only set aside for a moment to keep working when the trigger comes back, so that redraws do not lose hints.
  11. As a keyboard user, I want the focus to land on the part's button when a badge list closes because its badge went away, so that I keep my place on the map.
  12. As a keyboard user, I want the same fallback for a closed zone's badge, so that zones and parts behave alike.
  13. As Daniel, I want Pre-flight to say it could not read the open issues, and why, so that I don't think the repository has none.
  14. As Daniel, I want Pre-flight's text box and Pick parts by hand to work when issues could not be read, so that a gh problem never blocks a pre-flight.
  15. As Daniel, I want an action taken while plotkeeper is down to fail with "plotkeeper is not reachable", so that I read plain words, not browser jargon.
  16. As Daniel, I want that message not to be repeated in the notice line while the top bar already says the connection is lost, so that one problem is said once.
  17. As Daniel, I want a server refusal (an HTTP error with a reason) to keep its own reason, so that real errors stay specific.
  18. As Daniel, I want Esc to close the left panel at the first press wherever my pointer rests, so that Esc is predictable.
  19. As Daniel, I want Esc to keep closing the list first when the list is drawn over the map (the strip layout), so that narrow windows keep their layering.
  20. As Daniel, I want a hint open under the pointer to keep taking the first Esc alone, as spec Studio: one hint for every hover, a page-wide tooltip in place of native titles #582 says, so that hint behaviour is unchanged.
  21. As Daniel, I want Needs you and Settings inside the window at every width down to 390 px, so that I can always reach them.
  22. As Daniel, I want the project name, the install hint and the connection line to shorten with "…" in a narrow window, so that text gives way to buttons.
  23. As Daniel, I want the top bar's buttons (Install, its ×, Reload, Needs you, Settings) never to shrink or clip, so that each stays pressable.
  24. As Daniel, I want a session name capped at 200 characters, so that a paste accident cannot flood the list, the story and the dialogs.
  25. As Daniel, I want the rename dialog to disable Save and say the limit once a name passes the cap, so that I see it before saving.
  26. As Daniel, I want the server to refuse a longer name sent to it, so that the cap holds whatever the client.
  27. As Daniel, I want a name already longer than the cap in an old log to stay readable and inside the window in the rename and Delete dialogs, so that old data never breaks a dialog.
  28. As Daniel, I want Hebrew, emoji and other multi-byte names counted by characters, so that a name is never cut mid-character.

Implementation Decisions

Root cause 1: an interaction judged where its element was

  • The left panel's outside press. The panel's document-level pointerdown check decides from the event's propagation path, captured when the event was dispatched, not from the target's ancestors read later. The path still holds the panel, even after a handler earlier in the dispatch replaced the panel's body. The keep list and its pure decision in the map model stay as they are; only what the within(selector) callback reads changes. History rows keep selecting on pointerdown (Studio map: research note for the Go extractor (#537) #570's press-time selection), and nothing calls stopPropagation, because other window-level pointerdown listeners rely on the event.
  • A hint whose trigger left the page. The hint module's prune closes an open hint that no trigger on the page names. That is the same "wired" set the prune already builds from the page's interestfor and data-hint attributes. It does not read whether the hint's recorded owner or openTrigger is connected: hint() records each newly made trigger as the owner before patch() may keep the older node, so the recorded owner can be a discarded node while the live trigger is on the page.
    • Closing the hint runs the existing toggle handler, which clears the open pair.
    • A trigger kept off the page keeps its hint node in #hints, as today; only its open state goes while it is off the page.
    • Today a prune is queued only by hint() and unhint() calls. Closing the left panel clears its body without either. So opening a hint now queues a prune, and the prune keeps re-queueing itself while any hint is open. A stranded hint therefore closes within one tick (300 ms) without waiting for a redraw. The cost is one cheap pass every 300 ms while a hint shows, none otherwise.
    • Reason: the listener path's trigger (a <span>, <summary>, input or SVG mark) gets no pointerleave when it is removed, and openTrigger keeps the detached node alive. Today's prune therefore treats the hint as owned and never reaches its open-state check.
  • The badge list's lost badge. When the badge list closes and its part's badge is gone, a focus that was in the list (or on the body because the list closed) moves to the plate's open button: the part's, or the closed zone's sheet button. This is the fallback paint() already uses for a focused badge that a spotlit chip replaced. It applies only while the list's project is still the shown one; after a project switch the focus is left alone.

Root cause 2: one shape for failure

  • Transport. The page's one post function catches the browser's network rejection (the fetch promise rejecting, as against an HTTP error reply) and throws the transport's existing error type with the message "plotkeeper is not reachable". HTTP refusals keep their reason, as today.
  • Notice line. While the top bar's connection line shows (retrying, or restarted with Reload), the page's failure reporter still logs an unreachable error but does not draw it in the notice line. Other errors draw as today.
  • Pre-flight. Pre-flight's start phase carries an issues outcome with three states: loading, the list, or failed with its reason. A failure draws "Couldn't read the open issues: ", where the reason is the server's first line (for gh not logged in: its own "To get started with GitHub CLI…"). The free-text box and Pick parts by hand show and work as in the other two states.

Root cause 3: behaviour and layout follow what shows

  • Esc and the list. The Dismiss action treats the list as overlaid only when the list is drawn over the map: list-open or list-peek is on the body and the layout is not the full one. That is the same condition the stylesheet uses to draw the overlay. The decision moves into a small pure function beside the existing layout or key helpers, so it is unit-testable. The hover callback still toggles list-peek at every width; it is not suppressed, so it never fights the class sync that watches the body.
  • The top bar. The bar keeps clipping its overflow and keeping one line. Its text items (the project name, the install hint's sentence, the connection line, the port line) may shrink to nothing and end in "…". Its buttons (Install and its ×, Reload, Needs you, Settings) never shrink. Nothing moves to a second line or a menu; this is the smallest change that keeps every button reachable.

Root cause 4: untrusted text with a bound

  • A permission's command. The decision card draws its command as a block code element with the .step code treatment that already exists: it keeps line breaks, wraps anywhere, and has its own top margin. Its height is capped at about twelve lines, past which the block scrolls vertically. The description follows on its own line. The command's text stays plain textContent, never markup.
  • The rule for <code>. The global inline code rule stays one-line for inline uses (paths and short commands in prose). A whole command shown as a decision's subject uses the block treatment. That covers the dock's permission card and the decision history's entries, which draw the same command. The history's entries get no height cap, since an entry approves nothing.
  • A session name's cap. The cap is 200 characters, counted in Unicode scalar values, and the server's rename is its one authority. The rename field gets no maxlength, which counts UTF-16 code units and would stop at 100 emoji. Instead the dialog counts characters the same way as the server, and past 200 it disables Save with a short note saying the limit. The server refuses a longer name with a reason, not truncating it silently. It already trims, and an empty name still resets to the folder's name. The rename and Delete dialogs wrap long words and hold a maximum height with their own scroll, so names in logs written before the cap stay inside the window. No stored data is rewritten.

Docs. The behaviour docs change in the same work:

  • Map view's left panel: the outside press judged at dispatch.
  • Map view's Esc and keyboard: the list's overlay only when drawn; the badge list's focus fallback.
  • Pre-flight: the failed-issues state.
  • Cards: the permission's command shown whole.
  • Sessions: History rows open by mouse and keyboard; the rename cap.
  • Sessions (where spec Studio: one hint for every hover, a page-wide tooltip in place of native titles #582's hints are documented) and Map view: a hint closes when no trigger on the page names it.

system-map.json changes only if a part's described behaviour changes. These fixes sit inside the Window part and the Server part (the rename check), and no part's purpose, links or laws change, so no map edit is expected; system-map check confirms it.

Made without Daniel

  • The path read at dispatch (composedPath) was chosen over moving History's selection to click. Click would undo Studio map: research note for the Go extractor (#537) #570's select-on-press and add a visible delay.
  • Esc is gated in Dismiss, not by suppressing list-peek at full width: the class is synced by an observer, which suppressing would fight.
  • The transport's message is "plotkeeper is not reachable", and the notice is quiet while the connection line shows, because the connection line already names the problem.
  • The top bar shrinks its text rather than wrapping or adding an overflow menu, as the smallest change that keeps buttons reachable.

Testing Decisions

A good test here drives the page as Daniel does and checks what he sees or where his focus is, never which function ran. The highest seam is the snap harness: the real page in headless Chrome with fixtures for commands and the event stream, real mouse input (realPointer) and real keys (realKeys), and snap:fail on any failed check, uncaught exception or unhandled rejection. Prior art: the panel fixtures with realPointer, and the field-hints fixture with realKeys and realPointer, which already checks that Esc closes a hint.

  • Snap fixtures (the main seam), one per root cause where it can show:

    • History press. Open History; press an ended session's row with the real pointer after its hint has opened. The story shows in the left panel, the session is selected, and no hint is open afterwards, nor any hint positioned outside its trigger's box. (Root cause 1: H2 and the stranded hint.)
    • Badge focus. Open a part's badge list with Enter, then __snapEmit a sessions update in which that badge is gone. The focus is on that part's open button. Repeat for a closed zone's badge. (Root cause 1.)
    • Esc over the list. In the full layout, open a story from a list row, leave the real pointer on the list, and press Esc once: the panel is closed. In the strip layout, the first Esc closes the list overlay, as today. (Root cause 3.)
    • Top bar widths. With the install hint and Needs you showing, at 390, 640 and 1000 px wide, every top-bar button lies wholly inside the window and the element at its centre is that button. (Root cause 3.)
    • Rename cap. Type 201 emoji in the rename dialog: Save is disabled and the note shows. With 200 emoji, Save is enabled.
    • Permission command. A dock with a two-line command and a 300-character one, and a decision history entry with the two-line command. The command's box lies inside the card's width; its rendered text keeps the line break (the box is two or more lines tall for the two-line command); and Allow lies below the box. A screenshot of each joins the snap set. (Root cause 4.)
    • Pre-flight issues fail. pre_flight_issues fixed to __throw a gh reason: the overlay shows the failure line with that reason, not "No open issues.", and its text box and Pick parts by hand are present and enabled. (Root cause 2.)
  • Node tests (pure seams the snap harness cannot reach):

    • Transport. With a stubbed fetch that rejects with a TypeError, the page's command call rejects with the transport's error type and the message "plotkeeper is not reachable"; with a stubbed HTTP 500 and a reason, the reason is kept. The transport already reads fetch when used so that tests can stub it.
    • Dismiss decision. The new pure overlay function as a table: classes by layout, giving whether Esc closes the list.
    • Notice quieting. The existing notice tests gain rows: an unreachable error while the connection line shows draws nothing; any other error draws.
    • Hints. hint-redraw.test.mjs gains rows:
      • an open listener-path hint whose trigger is removed, with no further hint() call, closes within one prune tick;
      • an open hint whose trigger patch() kept across a redraw stays open;
      • a trigger set aside and put back keeps its hint node. Per the repo's rule, a new case of a behaviour that already has a test is a new row in it.
  • Rust test: the rename's name check, as a table:

    • 200 characters of Hebrew and emoji is accepted;
    • 201 characters is refused with a reason;
    • whitespace-only still gives the empty name that resets the row.

    No rename test exists today: rename appends to the event log through a free function. The check is therefore a pure function the rename calls before it appends, and the table tests that function. Prior art: the server's other table tests of pure helpers.

  • npm run check runs the node and Rust tests. The snap fixtures run in snap.yml's shards, since ui/ and scripts/snap/ change.

Out of Scope

  • The UI consistency audit's findings (Esc and open ⋯ menus, Esc and the focused layer, the general failed-read and stale states, button variants, focus restore on overlays, and the rest). They overlap at three points but are their own work. This spec fixes only the nine reproduced bugs and their four root causes.
  • Moving Open in Herdr/Jump, Send to terminal, PR and writer flows, or API keys under test: the QA pass left them unexercised on purpose.
  • A narrow-window or phone redesign of the top bar beyond keeping its buttons reachable.
  • Rewriting stored names longer than the cap.
  • Validation status codes: the API answers a refused argument with 500 and a reason, which the page already shows.

Further Notes

  • Evidence:
    • the QA report and screenshots: local-evidence/2026-12-01-qa-root-causes/
    • the second opinion's line-by-line confirmation is folded into reports/qa-report.md (L1's deeper cause, L5's wider scope)
  • All file and line references were read at main 29d974c.
  • A hint stranded after answering a permission card was seen once and not reproduced on demand. Root cause 1's hint rule covers it, since that trigger was also replaced while open.

Sub-issues

Sub-issues

7 of 7 Issues completed
Loading 7 sub-issues

Activity

  1. added
    ready-for-agent
    on Dec 1, 2026
  2. danielrispler commented on Dec 1, 2026

    @danielrispler
    OwnerAuthor

    Route draft: #1044 strong·high → strong·high — unchanged
    Route draft: #1045 strong·high → strong·high — unchanged
    Route draft: #1046 medium·medium → medium·medium — unchanged
    Route draft: #1047 medium·medium → medium·medium — unchanged
    Route draft: #1048 (none) → cheap·medium — breakdown critic finding 8: the server's name check split out of the untrusted-text ticket
    Route draft: #1049 medium·medium → medium·medium — unchanged (lost its Rust check to #1048)
    Route draft: #1050 (none) → cheap·medium — breakdown critic finding 3: map.md moved to one closing doc ticket (Shared docs)

  3. added a commit that references this issue on Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions