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

/talk?about= names its subject: one line above the composer, only for what the viewer can read #10614

Merged opened this

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

Merged

`/talk?about=owner/repo` and `/talk?about=owner/repo#N` now show one line above the composer. It reads "About owner/repo" or "About owner/repo#N: <title>", with the title escaped. I ran gate, tsc, `test/talk-page.test.ts` (38 pass) and design-lint; all pass. I did not run the full suite; the forge runs the check on this push.

shipped production is serving it deploy 69e3c7b

opened this

/talk?about=owner/repo and /talk?about=owner/repo#N now show one line above the composer. It reads "About owner/repo" or "About owner/repo#N: <title>", with the title escaped. I ran gate, tsc, test/talk-page.test.ts (38 pass) and design-lint; all pass. I did not run the full suite; the forge runs the check on this push.

  • Parsing: parseAbout in src/web/pages/talk.ts is a small pure function. It takes a plain string and returns {owner, repo, number?} or null.
  • What shows the line: only a repository the viewer can read, plus an issue or pull number that exists in it. The page then looks up the repo and the issue.
  • What does not: a malformed value (../x, a/b#x, 300 characters), an unknown repo or number, or a private repo the viewer cannot read all get the same page as plain /talk. A signed-out viewer gets no line either.
  • Tests: test/talk-page.test.ts covers a readable issue showing its title, the private-repo case for another person and for a signed-out viewer, and the malformed values. The private-repo response equals the one for a repo that does not exist.

The earlier pull went red on two unrelated tests: test/child-quota.test.ts and scripts/unreached-allow.json. This branch carried its own fixes for both, which conflicted with main. I merged main and dropped my versions of both files, so the diff against main is only talk.ts and talk-page.test.ts.

I changed no links. Only the Talk page learns about, as the issue asks.

To try it, open /talk?about=mason/forge signed in and read the line above the composer.

🤖 Generated with Claude Code

Closes #10494

commented

/talk?about=owner/repo and /talk?about=owner/repo#N now show one line above the composer. It reads "About owner/repo" or "About owner/repo#N: <title>", with the title escaped. I ran gate, tsc, test/talk-page.test.ts (38 pass) and design-lint; all pass. I did not run the full suite; the forge runs the check on this push.

  • Parsing: parseAbout in src/web/pages/talk.ts is a small pure function. It takes a plain string and returns {owner, repo, number?} or null.
  • What shows the line: only a repository the viewer can read, plus an issue or pull number that exists in it. The page then looks up the repo and the issue.
  • What does not: a malformed value (../x, a/b#x, 300 characters), an unknown repo or number, or a private repo the viewer cannot read all get the same page as plain /talk. A signed-out viewer gets no line either.
  • Tests: test/talk-page.test.ts covers a readable issue showing its title, the private-repo case for another person and for a signed-out viewer, and the malformed values. The private-repo response equals the one for a repo that does not exist.

The earlier pull went red on two unrelated tests: test/child-quota.test.ts and scripts/unreached-allow.json. This branch carried its own fixes for both, which conflicted with main. I merged main and dropped my versions of both files, so the diff against main is only talk.ts and talk-page.test.ts.

I changed no links. Only the Talk page learns about, as the issue asks.

To try it, open /talk?about=mason/forge signed in and read the line above the composer.

🤖 Generated with Claude Code

Changes requested — before the latest push

The web half is sound: parseAbout is pure and strict, the repo and issue are checked with canRead and mayViewId, the title is escaped, and unreadable, unknown and malformed values all give the plain page. Four things to fix in one round:

  1. Both doors. /talk has a terminal twin (src/tui/ssh-talk.ts) and it gets no subject line. Give the terminal the same gated line, using the same lookup so a guest sees nothing private. Share the lookup (parseAbout plus the readable check) from one small core module, not from a page file. It needs a test.
  2. Docs. Add how to use ?about= to docs/features/talk.md.
  3. Design. The new class talk-about has no CSS rule and is not recorded. Either reuse an existing named component, or style it with tokens only and record it in docs/design/areas/<area>.md. Per principle 8 the line should read plainly.
  4. Tests. Box 3 asks for the signed-out case to equal the nonexistent-repo response. The test only checks the 303 to /signin. That is acceptable, but also assert the line is absent for the signed-in person who cannot read the repo when the about is for a pull, not only an issue.

The preview answers 303 to sign in for a bare curl, so I could not see the line rendered signed in.

commented

All four points from the review are addressed and pushed. bun x tsc --noEmit, bun scripts/gate.ts, bun scripts/design-lint.ts, test/talk-page.test.ts and test/conversation-talk.test.ts pass. I did not run the full suite; the forge runs the full check on this push. scripts/fast.ts found the diff too broad to name a smaller set.

  1. Both doors.

- parseAbout and the readable check now live in one core module, src/core/talk_about.ts. Its aboutLine(db, text, viewer) returns the plain line, or null when the value is malformed, unknown or unreadable. The web page's line is drawn from it. - The terminal gets ssh <forge> talk --about owner/repo[#N] [words] in src/tui/ssh-talk.ts. It prints the same gated line first, and with no words it prints only that line. - Nothing is printed for a guest or for another person on a private repo. Control characters are stripped from the printed line.

  1. Docs. docs/features/talk.md has a new section on ?about= and --about.
  2. Design. talk-about stays as a marker class with no rule of its own. The line is plain small muted text, like .talk-meta. I recorded it in docs/design/areas/talk.md and added no CSS.
  3. Tests.

- A pull of a private repo shows the signed-in non-reader nothing and gives a page identical to the one for a nonexistent repo. The owner does see its title. I made the "pull" by setting kind = 'pull' on an issue row rather than opening a real pull, which needs branches. The lookup does not branch on kind, so this exercises the same path. - aboutLine is tested for owner, other person, signed out and malformed values. - The talk --about terminal path is tested for owner, other person, signed out and malformed values. - The signed-out web test still checks only the 303 to /signin, which you accepted.

I did not make --about pass the subject to the agent. It only names the subject, as the page does, and passing it on would be a feature the issue doesn't ask for.

🤖 Generated with Claude Code

Approved

Earlier asks are met. (1) Both doors: parseAbout and aboutLine now live in src/core/talk_about.ts, and the page and talk --about both use it. (2) The how-to is in docs/features/talk.md, and README is untouched. (3) Design: .talk-about is a marker class on plain small muted text with no CSS of its own, and it is recorded in docs/design/areas/talk.md. (4) Tests cover the private pull, the core lookup and the terminal. The preview answers, and a signed-out request is sent to sign-in. I could not run the checks myself. Two things to do next. Non-blocking: the terminal test relies on alice/about-priv#1 left by an earlier test, so create its own issue instead of relying on order. Non-blocking: the preview showed me only the signed-out redirect, so open /talk?about= signed in once and check the line wraps cleanly at 360px.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs