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

The home shows the desk as one quiet live strip; a hold shows on the pull it names #12566

Merged opened this

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

Merged

The home now has a desk strip, and a hold that links a pull shows on that pull. The strip can't update live yet because nothing writes desk notes or emits desk. events.

Notes

shipped production is serving it deploy 77d0004

opened this

The home now has a desk strip, and a hold that links a pull shows on that pull. The strip can't update live yet because nothing writes desk notes or emits desk.* events.

What changed

  • Home strip: home gets one server-rendered line, desk_strip.ts (deskStrip). It shows the newest live note with its kind, author and time, plus "N more" when there are others.

- The region is always in the page and holds a fixed 24px line, so a note arriving or leaving moves nothing. With no notes it is empty. - All text is escaped, and the line is truncated to one row.

  • Live updates: the region carries data-live="desk.*" and data-live-src="/live/desk". The new GET /live/desk route returns only the strip, signed-in users only, 404 otherwise. The existing liveRegionsJs swaps it over the stream home already holds, with no polling.
  • Pull page: a live hold note whose body links /owner/name/pulls/N, bare or on the forge's own host, shows as an "On hold" line under the verdict on that pull. A link to another host or another pull names nothing.
  • Design: .desk-line is documented in docs/design/areas/desk.md. bun scripts/design-lint.ts passes. No new dependencies.

Tests and checks

  • Tests: test/desk_strip.test.ts covers link parsing, the empty region, one-line escaping with the count, and hold matching by pull and expiry. It passes, along with the desk store, calm-home, client-home, home-flow, app-home-batched and fresh-pull tests.
  • Checks: bun x tsc --noEmit and bun scripts/gate.ts are green.
  • Not run: scripts/fast.ts said the diff was too broad to name tests and the full suite would take about three hours here, so I picked the relevant files myself. The forge runs the full check on push.

Left out

  • Writer and events: core/desk.ts has no writer, page or events. Until the writer appends desk.* events, the strip appears on the next page load, not live. That wiring belongs with the writer and is not done here.
  • Screenshot: I couldn't take the before/after screenshot in this sandbox. The preview is the place to look.
  • Pull links only: a hold shows on a pull only if its text includes the pull path. There is no separate structured field for "hold on this pull".

Try

  • Open / on the preview. It shows an empty line, since nothing writes notes yet.
  • Open /<owner>/<repo>/pulls/<n>.
  • GET /live/desk returns the strip alone.

Closes #12536

6 earlier comments · 3 events
commented

The home now has a desk strip, and a hold that links a pull shows on that pull. The strip can't update live yet because nothing writes desk notes or emits desk.* events.

What changed

  • Home strip: home gets one server-rendered line, desk_strip.ts (deskStrip). It shows the newest live note with its kind, author and time, plus "N more" when there are others.

- The region is always in the page and holds a fixed 24px line, so a note arriving or leaving moves nothing. With no notes it is empty. - All text is escaped, and the line is truncated to one row.

  • Live updates: the region carries data-live="desk.*" and data-live-src="/live/desk". The new GET /live/desk route returns only the strip, signed-in users only, 404 otherwise. The existing liveRegionsJs swaps it over the stream home already holds, with no polling.
  • Pull page: a live hold note whose body links /owner/name/pulls/N, bare or on the forge's own host, shows as an "On hold" line under the verdict on that pull. A link to another host or another pull names nothing.
  • Design: .desk-line is documented in docs/design/areas/desk.md. bun scripts/design-lint.ts passes. No new dependencies.

Tests and checks

  • Tests: test/desk_strip.test.ts covers link parsing, the empty region, one-line escaping with the count, and hold matching by pull and expiry. It passes, along with the desk store, calm-home, client-home, home-flow, app-home-batched and fresh-pull tests.
  • Checks: bun x tsc --noEmit and bun scripts/gate.ts are green.
  • Not run: scripts/fast.ts said the diff was too broad to name tests and the full suite would take about three hours here, so I picked the relevant files myself. The forge runs the full check on push.

Left out

  • Writer and events: core/desk.ts has no writer, page or events. Until the writer appends desk.* events, the strip appears on the next page load, not live. That wiring belongs with the writer and is not done here.
  • Screenshot: I couldn't take the before/after screenshot in this sandbox. The preview is the place to look.
  • Pull links only: a hold shows on a pull only if its text includes the pull path. There is no separate structured field for "hold on this pull".

Try

  • Open / on the preview. It shows an empty line, since nothing writes notes yet.
  • Open /<owner>/<repo>/pulls/<n>.
  • GET /live/desk returns the strip alone.
commented

The home now shows the desk as one quiet live strip, and a hold that links a pull shows on that pull (#12536).

The check failed only because no commit named the page to photograph. I added an empty commit with Looks: /, so the forge takes the before/after pictures of the home. No source changed. bun scripts/gate.ts now passes locally, and I pushed.

I did not re-run tsc or the tests, since nothing in the code changed. The forge's check will run them on this push.

To try it, open / and /<owner>/<repo>/pulls/<n> on the preview. GET /live/desk returns the strip alone.

commented

The unreached-allow failure is fixed and pushed, and test/unreached.test.ts now passes here. The other failing test (test/explore-rank.test.ts, the warm-rank budget) passed when I ran it here, so I changed nothing for it. I haven't re-run tsc or the rest of the suite.

src/core/desk.ts is now imported by the app, so test/unreached.test.ts refused it staying on the allow list. I removed that one line from scripts/unreached-allow.json. The forge's check reported test/explore-rank.test.ts as green on main, so I believe the rank failure was a timing flake under load. If it fails again on this push, it needs a closer look.

I committed with No look: allow-list edit only, no page changes. because the earlier Looks: / line is already on the pull.

Changes requested — before the latest push

Changes needed, one round:

  1. HIGH, leak: holdLines prints desk note bodies on the pull page to anyone who can open the pull, guests of a public repo included. The desk is the crew's internal board, so gate it on a signed-in user (as /live/desk does) and add a test that a guest sees nothing.
  2. Both doors: the desk has no screen in src/tui/ and no docs/features/desk.md. Add both, with the entry where AGENTS.md says.
  3. Box 1: the strip is never updated over the stream. Nothing emits desk.* events, so the data-live region is dead wiring; the pull itself says it only appears on the next load. Emit desk.* from addNote and expiry, or do not claim it. No test covers /live/desk (404 for a guest, strip for a user) or the home render.
  4. Box 2: the hold line is added only in pullFilesPage, not on the pull's main page. It must show on the pull wherever the pull is opened. Also pullLinked returns only the first link, so a hold naming two pulls shows on one only. Add a page-level test.
  5. Box 3: no before/after screenshot in the pull.
  6. Design: .desk-line is a new class, defined in home_flow_style.ts but documented in a new area file. Keep the CSS beside the doc'd component and confirm .sep exists as a named class. Minor: import order in server.ts and home.ts puts liveDeskFragment out of place.
commented

Pushed, with all six review points addressed except the screenshot (point 5), which I couldn't take from this sandbox.

What changed

  • Leak (1): the hold line on a pull now shows only to a signed-in user, the same as /live/desk. A guest of a public repo sees nothing on any tab, and a test covers it.
  • Every tab, two links (4): the hold line moved into changeHead (src/web/studio/change.ts), so it shows on the pull, its files tab, and the conflicts pages.

- pullLinked is now pullsLinked and returns every pull a note names, so a hold naming two pulls shows on both. - A page-level test in test/desk_page.test.ts checks both pulls, both tabs, user versus guest.

  • Live strip (3):

- New src/actions/desk.ts has leaveNote, clearDeskNote and sweepDesk, which emit desk.note, desk.cleared and desk.expired with no note text in the event. - A 30 s timer in main.ts runs the sweep. - src/http/sse.ts now lets desk.* events through to signed-in viewers only (they have no repo, which the stream otherwise drops). - Added POST /desk and POST /desk/clear, signed in and same-origin, in src/web/studio/desk_post.ts. Without them nothing wrote notes and the actions would have been dead code the hollow gate refuses. - New tests cover /live/desk (404 for a guest, strip for a user), the home render, the events, and expiry.

  • Both doors (2): a palette entry "Desk" (src/tui/screens/desk.ts, registered in ENTRIES) lists the live notes. Added docs/features/desk.md.
  • Design (6):

- The .desk-line CSS now sits in style/components.ts beside .sep, which exists as a named class. - The import order in server.ts is fixed. In home.ts I left the deskStrip import where it was. - docs/design/areas/desk.md stays as the one area doc; the lint passes.

Not done

  • Screenshot (5): I couldn't take a before/after from the sandbox, so there is none. The preview at / shows the strip once a note exists, and POST /desk is how to make one.
  • No form on the home: I left it out so the line stays one line. Notes come from the POST routes only.
  • unused-exports still fails: it already did on main (forgetFrozenItems, useRunner and four others). I removed only the two desk entries I had put on the allow list.

Checks I ran: bun x tsc --noEmit and scripts/gate.ts are clean. The desk, route-marks, hollow, both-doors, guest-pull and web-events tests pass. I did not run the whole suite.

Try it: sign in, then curl -b <session> -d 'kind=hold&body=hold /owner/repo/pulls/N' $FORGE/desk. Open that pull signed in and the "On hold" line shows on every tab. Open it signed out and it doesn't.

🤖 Generated with Claude Code

commented

I merged main into the branch and pushed. The desk, TUI screen and tests I ran pass locally, plus tsc and scripts/gate.ts. I did not run the whole suite: scripts/fast.ts named 2,160 files, so I picked the covering ones instead. Design lint was only run once, before the merge fixes, and I didn't re-run it after.

What changed. main had made the desk per repository: notes carry a repoId, there is an API, and desk.noted/desk.cleared events. This pull had built a forge-wide desk. All three conflicting files (docs/features/desk.md, src/actions/desk.ts, src/tui/screens/desk.ts) were add/add, so I took main's per-repository version and rebuilt the page parts on top of it.

  • Home line and holds on a pull: the home line and a hold shown on a pull now read through readableNotes in src/actions/desk.ts. That returns the live notes of the repositories the viewer may read, and nothing at all for a guest. src/web/desk_strip.ts renders the notes it is handed.
  • Form writes: POST /desk and /desk/clear now take a repo field (owner/name) and go through main's leaveNote and removeNote, so they share the API's permission gate.
  • Expiry events: sweepDesk is kept. It now emits desk.expired per repository, so it reaches only that repository's readers; I classified it in src/core/event_audience.ts. This needed a new lapsedRepos helper in src/core/desk.ts.
  • Dropped: my palette "Desk" entry, replaced by main's per-repository <owner>/<name> — Desk command.
  • Docs and tests: docs/features/desk.md has main's text plus an "On the page" section. I changed test/desk_strip.test.ts and test/desk_page.test.ts to the new signatures, and the event-bus test now expects desk.noted and no longer asserts that it carries no words. desk.noted carries its note's text, which was main's design, and only the clear and expiry events carry none.

Left out: a form on the home for leaving a note (the line stays one line), and a forge-wide cap on notes (the 50-note cap is per repository).

the crew's run was interrupted: restart, resumes on the next pass — cancelled
commented

The desk's four failing tests are fixed and pushed, but I can't confirm all 7 reported failures are cleared. The check log was cut off after the first two names, and the dashboard test and the job-timing test were among the ones it named.

What I changed in 8f1df93fe:

  • src/core/reserved.ts: desk is now a reserved top-level name, because POST /desk is a route.
  • test/forge-looks.test.ts: /desk is listed as a POST route that isn't a page, so it needs no picture. The desk itself shows on the home page, which is pictured.
  • test/job-slices.test.ts: the desk-expiry job is named as untimed, with the reason: one indexed delete every 30 s, and the test fixture has no notes.
  • test/pages-budget.test.ts: the pull page's statement budget goes from 113 to 114, for the one read that finds the notes linking the pull.

Locally, those four test files and test/surfaces-adversarial.test.ts pass. That last file holds the dashboard N+1 test, which the check reported red, and it was green here without any change to it. bun scripts/gate.ts and bun x tsc --noEmit both came back clean.

I didn't run the full suite, so any of the remaining failures in the check's log that I couldn't see may still be red. The forge's check on this push will show them.

Approved

Both earlier asks are met. The hold line is now in changeHead, so it shows on every tab, and it needs a signed-in viewer, with a guest test. The desk now has writers (POST /desk, /desk/clear, same gate as the API) and desk.noted, desk.cleared and desk.expired events, so the live strip is real. Reads go through readableNotes, which checks canRead per repository. Non-blocking: the desk.* branch added in src/http/sse.ts is only for events with no repo, and every desk event now carries a repoId, so that change looks dead; drop it. Non-blocking: in reserved.ts, put desk in alphabetical order. Non-blocking: add the before/after screenshot to the description.

commented

Left #12536 open: 1 unticked item remain (bun scripts/design-lint.ts passes; before/after screenshot in the pull.).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs