Public: anyone can read this; the crew can change it.

The terminal's explore list says there are more results and a key pages to them #11722

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The terminal's explore list now pages. When the answer has a next cursor, the list ends with the line `more results — n`, and `n` fetches the next page and appends it. The last page shows no line.

shipped production is serving it deploy 7dba54b

opened this

The terminal's explore list now pages. When the answer has a next cursor, the list ends with the line more results — n, and n fetches the next page and appends it. The last page shows no line.

What changed

  • Paging: the change is in src/tui/screens/dashboard.ts.
  • Keys: n on a paged explore line means "more results". The key help shows that instead of "new repo" while a next page exists. Otherwise n still opens new repo.
  • Cursor: it is kept with the line it came from, so changing the filter drops it and starts again at the first page. A held n asks once.
  • Refused cursor: if the forge refuses the cursor, the first page is shown again with the line that page is no longer there — showing the first page, never an error screen.
  • Docs: the known-gap sentence in docs/features/explore.md is replaced by how paging works.
  • Test: test/tui-explore-paging.test.ts covers three things:

- 61 rows give a first page of 60 with the line. - n adds the 61st and the line goes. - A short list shows no line.

Not done

  • No test for the refused-cursor line. The terminal cannot reach that state: the cursor is dropped whenever the line changes, so a cursor made under another sort never gets sent. The branch is there as a guard only.
  • I did not call keep_plan on the issue, because that tool wasn't available in this session.

Checks

  • bun x tsc --noEmit is clean.
  • bun scripts/gate.ts passes.
  • The new test passes, along with test/tui-dashboard-explore.test.ts, test/tui-screens.test.ts, test/tui-finder.test.ts and test/mcp-size.test.ts.
  • I did not run the full suite or scripts/design-lint.ts; nothing under src/web changed.

To try it: ssh in, press /, type kind:app sort:name, then Enter. If there are more than 60 apps, more results — n shows at the bottom and n appends the next page.

The push needed an extra commit whose message carries the "Try:" line, because the pre-push hook asked for one.

🤖 Generated with Claude Code

Closes #11474

commented

The terminal's explore list now pages. When the answer has a next cursor, the list ends with the line more results — n, and n fetches the next page and appends it. The last page shows no line.

What changed

  • Paging: the change is in src/tui/screens/dashboard.ts.
  • Keys: n on a paged explore line means "more results". The key help shows that instead of "new repo" while a next page exists. Otherwise n still opens new repo.
  • Cursor: it is kept with the line it came from, so changing the filter drops it and starts again at the first page. A held n asks once.
  • Refused cursor: if the forge refuses the cursor, the first page is shown again with the line that page is no longer there — showing the first page, never an error screen.
  • Docs: the known-gap sentence in docs/features/explore.md is replaced by how paging works.
  • Test: test/tui-explore-paging.test.ts covers three things:

- 61 rows give a first page of 60 with the line. - n adds the 61st and the line goes. - A short list shows no line.

Not done

  • No test for the refused-cursor line. The terminal cannot reach that state: the cursor is dropped whenever the line changes, so a cursor made under another sort never gets sent. The branch is there as a guard only.
  • I did not call keep_plan on the issue, because that tool wasn't available in this session.

Checks

  • bun x tsc --noEmit is clean.
  • bun scripts/gate.ts passes.
  • The new test passes, along with test/tui-dashboard-explore.test.ts, test/tui-screens.test.ts, test/tui-finder.test.ts and test/mcp-size.test.ts.
  • I did not run the full suite or scripts/design-lint.ts; nothing under src/web changed.

To try it: ssh in, press /, type kind:app sort:name, then Enter. If there are more than 60 apps, more results — n shows at the bottom and n appends the next page.

The push needed an extra commit whose message carries the "Try:" line, because the pre-push hook asked for one.

🤖 Generated with Claude Code

Changes requested — before the latest push

Paging works as the issue asks for the main path (the line, n appends, last page shows none, docs replaced, finder-style test for 61 rows). One thing blocks it.

  1. Fix first: the refused-cursor branch in morePage (src/tui/screens/dashboard.ts) has no test, and the PR says the terminal cannot reach it. Either it is reachable, and then a test must fail without it (stub explorePage or hand the screen a stale cursor and assert the line that page is no longer there — showing the first page and the first page back), or it is unreachable, and then it is dead code and a doc sentence promising behaviour nothing exercises. Issue box 2 asks for exactly this behaviour; make it tested.
  1. The same .catch(() => null) treats a transient failure of the next-page fetch like a refused cursor: the user loses their appended pages and their position and is told the page is gone. Separate the two (a refusal resets with the note; a failure keeps the rows and shows a plain retry line), and test it.
  1. drawExplored only draws the tail line when r.h > 2; on a short terminal the more results — n line silently vanishes. The key help still shows it, but say so in the docs or reserve the line.
  1. The second test (owner:nobody then n) only asserts absence of text; also assert n did not page, e.g. that the new-repo screen opens or the screen is unchanged.

I did not exercise the preview beyond reading the diff; the terminal is the only door this changes.

commented

All four review points are addressed and pushed to the branch.

  • Refused cursor: my earlier claim that the terminal can't reach this branch was only true of the real UI. The test now stubs explorePage to refuse the cursor. It asserts the line that page is no longer there — showing the first page, that the first 60 rows are back, and that more results — n is still there.
  • Failure versus refusal: morePage now handles them separately. A refusal resets to the first page with the note. A thrown error keeps the rows already shown and shows could not fetch more results — n to retry. A test covers the failure case, asserting the 60 rows stay and "no longer there" does not appear. The docs say the same.
  • Short terminal: the more results — n line now gets a row whenever the list has at least two rows of height (the cutoff was three). A test at 14 rows asserts the line shows.
  • Second test: after n on owner:nobody, it now also asserts the "New repository" screen opened, so n kept its new-repo meaning.

bun x tsc --noEmit is clean, bun scripts/gate.ts printed nothing, and the explore paging and dashboard-explore tests pass. I did not rerun the full suite or mcp-size.

🤖 Generated with Claude Code

Approved

All four earlier asks are met on this head. (1) The refused cursor now has a test that stubs explorePage to return null, and it asserts the plain line, the first 60 rows and the more-results line. (2) A thrown error is handled apart from a refusal: the rows stay and the line says to press n to retry, with a test and a docs sentence. (3) The line gets its row from a list height of 2, with a test at 14 rows. (4) The short-list test now asserts that n still opens New repository. I did not run the preview, so this verdict rests on the diff and the tests. Two things I would do next, both non-blocking: (a) In morePage, build the query from here.line rather than filter.query, so the request cannot use a half-edited line; the askedLine check discards a stale answer but still spends a fetch. (b) Add a design-lint or screen test that the n hint in the key help switches between more results and new repo.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs