Repository navigation
Conversation
…d keep a row sheet's actions in reach (#3439) Items 1 and 2 of #3439, the follow-ups from the review of the compact sidebar rows (#3276). Agents list (Waiting first, one-line rows). While the pointer, the keyboard focus or a touch that just ended is in the list, the rows keep the order and the side of the "+N resting" line they were drawn on. A resting agent that started waiting for the reader meanwhile stayed hidden under the closed line until the hold ended, and a focus left on a row holds the list for as long as it stays. The row now shows through the closed line in the place it holds, as the selected row does, and moves up with the rest when the hold ends. The line counts the rows under it that do not wait (it read live states, so it could say "+4 resting" over two rows, or "+0 resting"), and is not drawn when none is left. Row menu sheet (screens up to 640px). The head (the name, the place, what a waiting agent waits for, its plugin tokens) had no height limit and could not shrink: on a 375x500 phone a long agent title or workspace path left the action list 0px and put Cancel off the screen. The head now takes at most three tenths of the screen (of what a keyboard leaves of it, --app-height) and scrolls as one box. The reason and the tokens had scroll boxes of their own inside it (20vh and 30vh); those go, so nothing scrolls inside a box that scrolls. The gap under the head is a margin, which stays where padding would scroll away with the words. Deliberate behaviour changes, in tests updated here: - src/components/AgentSidebar.test.tsx: a resting row that starts to wait during a hold is drawn under the line (was: not drawn until the hold ended), also in the second after a touch ends, and the line's count follows the rows under it while the list is held (was: live states). - scripts/sidebar-tokens-demo-regression.ts: long tokens and a long reason scroll with the sheet's head (was: each in a box of its own), and a new case opens the sheet on a 375x500 phone with a long name and asks for the actions and Cancel in reach.
…yboard scroll a row sheet's head (#3439) Two findings from the review of the first commit. The resting line is not drawn once no row under it rests. When it went with the keyboard focus on it (its last row started to wait), the focus fell to the page, and since nothing blurs for a control that is gone, the list stayed held: moving on to a button outside it did not end the hold, and the waiting agent stayed under the working ones. The focus now goes to the row that took the line's place (else to the Agents head), so leaving the list ends the hold as it always did. The capped head of a row menu's sheet scrolled under a finger and a wheel, and no key reached it: Tab went round the actions and Cancel alone. While the head scrolls it is now a region named by the sheet's title and a stop of Tab before the first action, with the rows' focus ring, and its own keys scroll it. The sheet still opens with the focus on its first action, and a head that fits is no stop. Tests: AgentSidebar.test.tsx focuses the line's button itself, and asks that the focus stays in the list and that a focus outside ends the hold. sidebar-tokens-demo-regression.ts tabs to the head on a 375x500 phone and asks that a key scrolls it.
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Owner
Author
|
Folded into #5092, which bundles this fix with two others to cut CI reruns; its description and screenshots are there unchanged. |
devswha
added a commit
that referenced
this pull request
Nov 30, 2026
…UI retries a failed terminal list, a newly waiting agent shows through the resting fold (#5092) Three bug fixes from the issue triage, bundled to cut CI reruns (each already passed its own review round on its own PR; this PR adds no code of its own). - #5056: an update check's tag fetch gets five minutes (was #5080) - #4493 item 6: the native TUI retries a failed terminal list read while Online (was #5083) - #3439 items 1-2: a newly waiting agent shows through the resting fold; a short phone's row sheet stays usable (was #5091) The combined diff is exactly the sum of the three branches: the same 16 files, each byte-identical to its original branch tip (checked file by file). Addresses #5056 (cause 2; cause 1 is kept as documented policy), items 1-2 of #3439 and item 6 of #4493; no closing keywords, since #4493 and #3439 keep other items open. #5056 is closed by hand after the merge. --- ## #5056: updater tag fetch timeout (was #5080) Fixes part of #5056 (cause 2: the tag fetch timeout). ### What happened A check for updates fetches the release tags with `git fetch --no-tags origin '+refs/tags/v*:refs/tags/v*'` through the updater's ordinary `git()`, which kills any command after 30 s. On a shallow source checkout the first such fetch brings every newer release's objects, which takes longer than that on a slow link, so the check failed with "git timed out" every time until the user ran the fetch by hand. The unshallow fetch already had its own 10-minute bound for the same reason (#1252); the tag fetch did not. ### Fix The tag fetch goes through its own `tagFetch` with a five-minute bound (`TAG_FETCH_TIMEOUT_MS`); every other git command keeps 30 s. Two test fixtures that paused or failed the tag fetch by matching its arguments in `git()` now override `tagFetch`. ### Not changed Cause 1 (a detached, shallow tag checkout of a standalone install is refused with "Switch the source checkout to main to update.") is the documented policy for a non-plugin checkout and is left as is; the issue's workaround (`git switch -c main`) remains the path. ### Verification - Real repro with a `git` wrapper on PATH that sleeps 35 s before every `fetch`, against a real upstream with a newer `v0.2.0` tag: - main: `check after 30 s: {"error":"git timed out","available":false}` - this branch: `check after 35 s: {"error":null,"available":true,"latest_version":"0.2.0"}` - New test "gives a check's tag fetch five minutes" fails on main, passes here; `server/updater.test.ts` 57/57. - `bun run check fast`: typecheck and build ok; unit tests had one failure in `tui/testing/entry-pty.test.ts` (a 15 s flood deadline under load, unrelated to this change), which passes 24/24 when run alone. ### Review round Review round (omo gate + Codex via axwith), fixed in the commit above: - MEDIUM (both reviewers): cancelling an install while its check's tag fetch is in flight left the fetch running for up to five minutes and then reported the git error. `cancel()` now ends a tag fetch in flight (its own abort signal, not the updater's shutdown one), the run reports `update_cancelled` and keeps the offered revision from installing by itself; a tag fetch that starts after the cancel keeps the ordinary 30 s bound. A cancel that comes before the fetch still lets the check finish, so the offer stays shown (the existing "stops an install cancelled while it still checks" test). - LOW (both): the timeout test now checks that the five-minute deadline is set by the tag fetch itself, not only that one exists somewhere. - New test "ends a check's tag fetch in flight when its install is cancelled" uses a git whose tag fetch never ends; it times out on the previous head and passes here. Not changed: a stalled fetch on the timer's own check still holds the next 5-minute tick (LOW, unchanged in kind from main's 30 s). The CI failure on the previous head was `key-bar-pinned-history-regression.ts`, the flake #5073 addresses, not this change. updater tests 58/58, typecheck ok. --- ## #4493 item 6: TUI terminal list retry (was #5083) Fixes item 6 of #4493 (`tui/core/world.ts`: retry a failed terminal list read while the link stays Online). The other items of #4493 are untouched. ### What happened In the native TUI, `CoreWorld` reads `terminal.list` once after a change. When that read failed while the link stayed Online, nothing asked again: the screen kept the old terminal list (a new terminal stayed missing) until another change, a snapshot or a reconnect. `world.test.ts` pinned that behavior. ### Fix - A failed read while Online is retried after 250 ms, 500 ms and 1 s (`TERMINAL_LIST_RETRY_MS` in `tui/model/deadlines.ts`), through the loop's one timer as a `terminal_list` deadline; after the last one the world waits for the next change, whose own read gets the same backoff again. - A snapshot, or the link leaving Online, drops the read in flight and any retry due; a newer read for a change replaces a retry due. - `readCore()` reads only while the link is Online. ### Verification - New `tui/loop-terminal-list.test.ts` (fake core, fake clock, no sleeps): a failed read shows the added terminal 250 ms later without another event; a persistently failing list backs off 0/250/750/1750 ms and stops, then a new change's failed read is retried at +250 ms; a newer read supersedes the retry; no read while Offline and none extra after reconnect. The first two fail on main (`0 pass, 4 fail` over two runs). Removing the Online guards makes the Offline test fail. 3 consecutive runs green. - `tui/core/world.test.ts` updated from pinning no retry to the retry. - `bun run check fast` at the second commit: unit: 1367 test files unit: 28059 pass, 0 fail, 276 skip in 1367 files, 8 at a time, 262.3s; typecheck, build and the other steps ok. ### Reviews omo gate and Codex (via axwith, gpt-6.2-sol-fast xhigh) on `aa5f96180c` both found the production change correct (no offline reads, no stale answers applied, no timer spin) and flagged the Offline test for checking the earliest timer of any kind (a repaint can be due first). Fixed in the second commit: it now checks list reads while Offline; the backoff test also covers a fresh read failing after the backoff (Codex LOW). --- ## #3439 items 1-2: sidebar waiting row and row sheet (was #5091) Fixes items 1 and 2 of #3439. Items 3-5 of that issue are done or already decided there. ### What happened 1. With "Waiting first", a resting agent that started waiting while focus was in the Agents section stayed hidden under the closed "+N resting" line, because the list holds its order while focus is there. 2. On a short phone (375x500), a long agent title or workspace path made the row menu sheet's header take the whole height: the actions got 0 px and Cancel sat off screen. ### Fix 1. While the order is held, a newly waiting row shows through the closed resting line in its held place (as the selected row already does), and "+N resting" counts the rows still folded. If the focused "+N resting" line disappears because its last row started waiting, focus moves to the row that takes its place (or the Agents heading), so the hold still ends when focus leaves. 2. `.row-sheet-head` is capped at 30vh and scrolls; the reason and token parts inside it no longer scroll on their own (no nested scrollers). When the header overflows it becomes a keyboard-focusable region (Tab reaches it, arrows scroll it); the sheet still opens on its first action. Changes what the sidebar shows (item 1), so the screenshots are below; DESIGN.md is updated. ### Before / after Row menu sheet, 375x500, a long agent title: | Before (main) | After | |---|---| |  |  | Keyboard: Tab now reaches the scrolling header (focus ring): | Before | After | |---|---| |  |  | Sidebar 1280x800: a resting agent starts waiting while focus is in Agents: | Before (main) | After | |---|---| |  |  | ### Verification - 375x500 measurement: before, header 393 px, actions 0 px, Cancel at 462-506 px (off screen); after, header 150 px, actions 96 px, Cancel at 435-479 px. - `AgentSidebar.test.tsx`: the old test that pinned the hidden row now expects it shown; a new test focuses the "+N resting" button itself and checks focus stays in the list and the hold ends when focus leaves (fails before). A touch test's held order and the "+N resting" count changed deliberately with item 1. - `scripts/sidebar-tokens-demo-regression.ts`: the 375x500 cases check the actions and Cancel are hit-testable, and that Tab reaches the header and ArrowDown scrolls it (fails on the first commit; `overflow-y: hidden` fails it too). - Sidebar and row menu tests 64/64 after merging main, typecheck ok; `bun run check fast` green on the first commit. ### Reviews omo gate and Codex (via axwith, gpt-6.2-sol-fast xhigh) on ec232a4: both confirmed the two fixes and flagged two keyboard regressions (focus lost with the disappearing "+N resting" line; the scrolling header unreachable by Tab), fixed in bdeacd8. Left as is: a 320x150 viewport (400% zoom) still leaves no room for the actions (it had none before either), and the demo regression does not check which element scrolls when a wheel starts over the reason or tokens. --------- Co-authored-by: sisyphus-dev-ai <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes items 1 and 2 of #3439. Items 3-5 of that issue are done or already decided there.
What happened
Fix
.row-sheet-headis capped at 30vh and scrolls; the reason and token parts inside it no longer scroll on their own (no nested scrollers). When the header overflows it becomes a keyboard-focusable region (Tab reaches it, arrows scroll it); the sheet still opens on its first action.Changes what the sidebar shows (item 1), so the screenshots are below; DESIGN.md is updated.
Before / after
Row menu sheet, 375x500, a long agent title:
Keyboard: Tab now reaches the scrolling header (focus ring):
Sidebar 1280x800: a resting agent starts waiting while focus is in Agents:
Verification
AgentSidebar.test.tsx: the old test that pinned the hidden row now expects it shown; a new test focuses the "+N resting" button itself and checks focus stays in the list and the hold ends when focus leaves (fails before). A touch test's held order and the "+N resting" count changed deliberately with item 1.scripts/sidebar-tokens-demo-regression.ts: the 375x500 cases check the actions and Cancel are hit-testable, and that Tab reaches the header and ArrowDown scrolls it (fails on the first commit;overflow-y: hiddenfails it too).bun run check fastgreen on the first commit.Reviews
omo gate and Codex (via axwith, gpt-6.2-sol-fast xhigh) on ec232a4: both confirmed the two fixes and flagged two keyboard regressions (focus lost with the disappearing "+N resting" line; the scrolling header unreachable by Tab), fixed in bdeacd8. Left as is: a 320x150 viewport (400% zoom) still leaves no room for the actions (it had none before either), and the demo regression does not check which element scrolls when a wheel starts over the reason or tokens.