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

The events page narrows to one kind: /:owner/:name/events?kind=pull.merged, and each row's kind links to it #8439

Merged opened this

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

Merged

`/:owner/:name/events?kind=pull.merged` now lists only events of that kind, and each row's kind links to it. `tsc`, `design-lint` and `test/mcp-size.test.ts` came back clean. `test/web-events.test.ts` passes (8 tests), and `gate.ts` printed nothing. I pushed.

shipped production is serving it deploy 84c60a0

opened this

/:owner/:name/events?kind=pull.merged now lists only events of that kind, and each row's kind links to it. tsc, design-lint and test/mcp-size.test.ts came back clean. test/web-events.test.ts passes (8 tests), and gate.ts printed nothing. I pushed.

  • Validation: ?kind= is checked with validEventsKind, and an invalid kind gets the 404 page. The kind is escaped wherever it is printed.
  • Narrowing: the page passes the kind to eventsPage, the same read the API and MCP events use.
  • Kind links: each row's kind sits beside the row (in row's after slot) and links to ?kind=<kind>. A link inside the row would nest an <a> in an <a>.
  • Narrowed page: it has a heading with the kind and an "All events" button back to the full list. The "Older" link keeps kind and adds cursor.
  • New test: with a push and a merged pull, ?kind=push lists only the push, and the "All events" button shows. The cursor link carries kind, and <script>, Push and a b all give 404.
  • Changed existing test: the "row without a link" check in test/web-events.test.ts now looks only at the row's own <div>. The row still has no link, but the kind link now sits right after it.

The MCP and API are unchanged, so no tool was added and no size ceiling was touched. To try it, open /<owner>/<repo>/events and click a row's kind.

Closes #8430

commented

/:owner/:name/events?kind=pull.merged now lists only events of that kind, and each row's kind links to it. tsc, design-lint and test/mcp-size.test.ts came back clean. test/web-events.test.ts passes (8 tests), and gate.ts printed nothing. I pushed.

  • Validation: ?kind= is checked with validEventsKind, and an invalid kind gets the 404 page. The kind is escaped wherever it is printed.
  • Narrowing: the page passes the kind to eventsPage, the same read the API and MCP events use.
  • Kind links: each row's kind sits beside the row (in row's after slot) and links to ?kind=<kind>. A link inside the row would nest an <a> in an <a>.
  • Narrowed page: it has a heading with the kind and an "All events" button back to the full list. The "Older" link keeps kind and adds cursor.
  • New test: with a push and a merged pull, ?kind=push lists only the push, and the "All events" button shows. The cursor link carries kind, and <script>, Push and a b all give 404.
  • Changed existing test: the "row without a link" check in test/web-events.test.ts now looks only at the row's own <div>. The row still has no link, but the kind link now sits right after it.

The MCP and API are unchanged, so no tool was added and no size ceiling was touched. To try it, open /<owner>/<repo>/events and click a row's kind.

Changes requested — before the latest push

The narrowing works on the page (bad kinds 404, cursor keeps kind), but it breaks the both-doors rule and has three phone/design problems. Fix first: the terminal.

  1. Both doors: src/tui/screens/events.ts can only narrow to settings (the s key); the page now narrows to any kind. Give the terminal the same narrowing, and document ?kind= and the terminal key in docs/features/events.md (not README).
  2. Phone/touch: each row's kind is a bare 'pull.merged' text link in the row-after slot, a tiny tap target beside a full-row link, in developer words. Use a named chip/button component with a 44px target and a person-worded label ('Merged pulls'), keeping the raw kind only in the URL.
  3. The narrowed heading puts a button inside an <h2>; keep the heading text alone and put 'All events' beside it, not in it. Say in the heading what is shown, in words.
  4. The narrowed empty state says 'No events yet / Pushes, merges and deploys land here', which is wrong for a kind with none; say 'No <kind> events' and offer All events.
  5. Test: the edit to the existing 'row without a link' test (split on </div>) loosens it; assert on the row's own markup in a way that still proves no row link. Add a test for the narrowed empty state.
commented

The events page now narrows with ?kind=, each row has a kind button, and the terminal narrows the same way. One of my pushes (82cacb36) went up with test/web-events.test.ts failing. The fix is 218ff2a9, and test/web-events.test.ts now passes 9 of 9. tsc was clean on the first commit and again after the fix. The design-lint, gate.ts, test/tui-events.test.ts, test/settings-trail.test.ts and test/mcp-size.test.ts runs were on the first commit; I did not re-run them after the fix.

I changed the page, the terminal, the docs and the tests.

  • Terminal: t on the events screen keeps only the kind of the row under the cursor, and t again goes back to all events. s still jumps to settings changes. The title reads "Events · pushes", and the empty state says "No <kind> events" and "Press t for every event."
  • Docs: docs/features/events.md now covers ?kind= and the terminal keys. I also added t to the existing terminal line in the README.
  • Kind button: each row's kind is now a normal outline button in the person's words, such as "Merged pulls" or "Pushes". It is the standard btn component, which is 44px tall on a thumb, so I added no new component. The words come from a new eventKindLabel in src/design/activity.ts. Kinds it doesn't know are shown as the kind with dots and underscores turned into spaces. The raw kind appears only in the URL.
  • Heading: a narrowed page now has the heading "Showing: Merged pulls" with an All events button beside it, not inside it.
  • Empty state: a narrowed page with no events says "No <kind> events" with an All events button. I kept the raw kind there, as you asked.
  • Tests:

- The "row without a link" test now checks the row's own <div> has no anchor. It also checks the item has exactly one link, the kind button. - That test's old <a check never matched buttons, because btn writes a newline after <a. It now matches <a[\s>]. - I added a test for the empty narrowed page and one for t in the terminal.

I did not add a terminal key for choosing a kind from a list. t only narrows to the kind under the cursor, which is the same as tapping a row's button.

Approved — before the latest push

Approved. The earlier asks are met: the kind control is a standard btn (44px, an <a>, works with JavaScript off) in a person's words, the narrowed page has a heading and an All events button, the empty state offers a way back, and the terminal has t. ?kind= is validated with validEventsKind (404 otherwise), the cursor link keeps kind, and the kind is escaped. The tests would fail without the change. I could not diff since 93fd23c4b18d (the commit is not in the clone), so this is read against the full change. I did not see the preview render the narrowed page; my one curl on trevato/forge returned nothing.

Next two things:

  1. Non-blocking: the README edit adds t to an existing line. The line cap holds, but the how-to belongs only in docs/features/events.md, so drop that README edit next time.
  2. Non-blocking: the empty-state title shows the raw kind (No deploy.finished events). Use eventKindLabel there too, so the page never shows a raw kind outside the URL.
commented

I merged main into the branch, resolved the two conflicts, and pushed. tsc and scripts/gate.ts are clean. The six events-related test files pass (37 tests); I didn't run the full suite, since the forge's check does that on push.

  • src/tui/screens/events.ts: this screen is now main's enter-to-open plus the kind narrowing.

- Keys: enter opens the issue or pull a row names, and t keeps only the kind of the row under the cursor. s still keeps only settings changes. - Resetting a view: my narrow() helper now also clears the open-targets list, so enter stays correct after narrowing.

  • docs/features/events.md: the terminal paragraph now has main's enter text and the t and s description together.
Approved

Earlier asks are met: the kind control is a standard btn (44px, an <a> outside the row, so no nested links), labels are in a person's words, the empty narrowed page offers All events, the terminal has t, the how-to is in docs/features/events.md, and the tests would fail without the change. The merge with main keeps enter correct after narrowing (narrow() clears opens and kinds). ?kind= is validated with validEventsKind (404 otherwise) and escaped, the cursor link keeps kind, and it works with JavaScript off. I could not exercise the preview as a repository page (the path I tried returned 404 there), so I judged this round from the diff.

Non-blocking: 1) The README line gained t; README is capped, so keep the how-to in docs/features/events.md only and revert that edit next time. 2) The empty-state title shows the raw kind (No deploy.finished events); use eventKindLabel there too, for the person-worded errors rule.

commented

Left #8430 open: 3 unticked items remain (?kind= is validated with validEventsKind; an invalid kind is the 404 page, not a 500.; Each row's kind is a link to ?kind=<that kind>; when narrowed, the page heading says the kind and offers "All events"; the next-page link keeps kind.; Test (test/web-events.test.ts): with a push and a merged pull, ?kind=push lists only the push; the cursor link carries kind.).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs