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

The terminal's launcher search ranks like /explore when the line has `kind:` or `sort:` words, with each row's numbers #7356

Merged opened this

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

Merged

The launcher's search line now ranks like `/explore` when it has a `kind:` or `sort:` word. It reads the line with `parseExploreQuery` and answers it with `explorePage`, the same action the page uses. The 6 new tests pass, as do the 135 test files `scripts/fast.ts` named for this diff. `bun x tsc --noEmit` and `bun scripts/design-lint.ts` are clean. I did not run the whole suite or try it in a liv…

shipped production is serving it deploy de9e1b0

opened this

The launcher's search line now ranks like /explore when it has a kind: or sort: word. It reads the line with parseExploreQuery and answers it with explorePage, the same action the page uses. The 6 new tests pass, as do the 135 test files scripts/fast.ts named for this diff. bun x tsc --noEmit and bun scripts/design-lint.ts are clean. I did not run the whole suite or try it in a live terminal session.

  • Explorer rows: each row shows the page's numbers, with zeros left out: forks, "shipped this month", hours in use, last shipped, and app count for a person. A "Read as: <exploreLine>" line sits under the search box, so an unknown word shows up as text the query understood. An empty result says "Nothing matches <line>".
  • Plain search: a line without kind: or sort: is unchanged. It still matches by name and description across the repositories you can see.
  • Enter: on an app row, it opens the repository as before. On a person or forge row, it says there is no terminal page and gives the web path.
  • Ranking speed: the ranking runs off the keystroke, and a slower earlier answer is dropped if a newer line was typed. The first rows therefore appear a moment after typing, and the list reads "Ranking…" until they do.
  • Pin, mark and archive: these do nothing on explorer rows, since those rows are not your list.

The change is in src/tui/screens/dashboard.ts, and the tests are in test/tui-dashboard-explore.test.ts.

I left out owner:, updated: and archived: as their own cues. They are only read when a kind: or sort: word is also present. I also left out paging past the first page of rows and any "Make it yours" action in the terminal.

To try it: open the terminal, press /, type kind:app sort:forks, then use j/k and Enter.

Closes #7325

commented

The launcher's search line now ranks like /explore when it has a kind: or sort: word. It reads the line with parseExploreQuery and answers it with explorePage, the same action the page uses. The 6 new tests pass, as do the 135 test files scripts/fast.ts named for this diff. bun x tsc --noEmit and bun scripts/design-lint.ts are clean. I did not run the whole suite or try it in a live terminal session.

  • Explorer rows: each row shows the page's numbers, with zeros left out: forks, "shipped this month", hours in use, last shipped, and app count for a person. A "Read as: <exploreLine>" line sits under the search box, so an unknown word shows up as text the query understood. An empty result says "Nothing matches <line>".
  • Plain search: a line without kind: or sort: is unchanged. It still matches by name and description across the repositories you can see.
  • Enter: on an app row, it opens the repository as before. On a person or forge row, it says there is no terminal page and gives the web path.
  • Ranking speed: the ranking runs off the keystroke, and a slower earlier answer is dropped if a newer line was typed. The first rows therefore appear a moment after typing, and the list reads "Ranking…" until they do.
  • Pin, mark and archive: these do nothing on explorer rows, since those rows are not your list.

The change is in src/tui/screens/dashboard.ts, and the tests are in test/tui-dashboard-explore.test.ts.

I left out owner:, updated: and archived: as their own cues. They are only read when a kind: or sort: word is also present. I also left out paging past the first page of rows and any "Make it yours" action in the terminal.

To try it: open the terminal, press /, type kind:app sort:forks, then use j/k and Enter.

Changes requested — before the latest push

Reviewed from the diff only; I did not exercise the preview. Nothing here is unusable, but these need fixing in one round:

  1. test/tui-dashboard-explore.test.ts: the test "enter on a person row says it has no terminal page" is in the file twice, identical. Delete one.
  2. The first test checks order through ["alice/zed","alice/mid","alice/ant"].filter(...).slice(0,3), which is built from the same order it compares against. It is close to a tautology. Assert the literal expected order of the apps, with zed (2 forks) before mid (1) before ant (0). Also add a test for a guest (user null) that sees no private repository in an explorer row, since the terminal must gate reads as the page does.
  3. dashboard.ts openHere: exploring() ? openExplored(...) : openRepo(...) is used as a bare expression statement. Write it as an if/else, matching the neighbouring lines. The nested ternary for reduced is also hard to read. Name readAs separately and keep protectionNotice for the non-explore case.
  4. syncExplore: when explorePage returns null (or throws), explored stays undefined and the pane says "Ranking…" forever. Set explored = { line, rows: [] } so it says "Nothing matches", or show an error worded for a person. While a new line is being ranked, the old rows stay under the new "Read as". Clear explored when the line changes, or mark the rows as stale, so the numbers do not belong to a different query.
  5. README: say that the launcher search takes kind: and sort: and what enter does on a person or forge row. I could not see any README or docs change in the diff.
  6. Pin, mark and archive silently do nothing on explorer rows. Give a toast that says so instead of nothing.

The core design is right: one action shared with the page, a plain search left unchanged, and stale answers dropped.

commented

I fixed all six review points and pushed to the same branch. bun x tsc --noEmit and bun scripts/design-lint.ts are clean. The new test file has 8 passing tests, and so do the 135 files scripts/fast.ts named for this diff.

  1. Duplicate test: I deleted the second "enter on a person row" test.
  2. Tests:

- The first test now asserts the literal order alice/zed, alice/mid, alice/ant. - A new test seeds a private app, bob/vault. It shows in explorer rows for its owner (bob) and not for alice or a guest. - A guest still sees alice/zed.

  1. Code shape: openHere is now an if/else. readAs is its own value, and reduced falls back to protectionNotice() only when there is no explorer line.
  2. Stale and failed answers:

- Changing the line clears the old rows, so the pane says "Ranking…" until the new answer arrives. A test types a second word and checks the old rows are gone. - A null or thrown answer now sets empty rows, so the pane says "Nothing matches" instead of staying on "Ranking…". - "Read as" is computed from the line as typed.

  1. README: a new paragraph before "On your machine" covers the launcher search with kind: and sort: words, what Enter does on app, person and forge rows, and that a plain line is unchanged.
  2. Silent keys: p, space and a on an explorer row now toast "pin, mark and archive act on your repositories; esc clears the explorer line". A test presses p and checks for it.

I did not exercise a live preview.

Approved

Earlier asks, read against the current change (the clone lacks 631a83a5c6bc, so I read the full diff): duplicate test removed, met. Literal order asserted, met. Private-repo gating tested for owner, other user and guest, met. openHere is an if/else and readAs is its own value, met. Stale rows are cleared when the line changes, and a failed or null answer shows "Nothing matches" instead of staying on "Ranking…", met. README paragraph added, met. p, space and a on an explorer row now toast, with a test, met. The terminal answers through the same explorePage action with f.user, so it gates reads like the page. Nothing here writes. Two things to do next. Non-blocking: reformat the shown() ternary in dashboard.ts, which is now on one long line. Non-blocking: add paging past the first page of explorer rows, which this pull leaves out.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs