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

A conversation on /talk can be pinned, and pinned conversations stay at the top of the list #14634

Merged opened this

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

Merged

A conversation on /talk can now be pinned. Pinned ones sit first in the list under a quiet "Pinned" heading, newest activity first among them. Tests: the new test/talk-pin.test.ts plus the talk, TUI, schema and migration-pin tests pass, and tsc and design-lint are clean.

Notes

shipped production is serving it deploy 404563e

opened this

A conversation on /talk can now be pinned. Pinned ones sit first in the list under a quiet "Pinned" heading, newest activity first among them.

Tests: the new test/talk-pin.test.ts plus the talk, TUI, schema and migration-pin tests pass, and tsc and design-lint are clean. I did not run the full suite. scripts/fast.ts found the diff too broad to name tests, so I picked the ones that cover it.

  • Pin and Unpin: POST /talk/:id/pin is same-origin, owner only, and answers 404 for another person's conversation. It redirects back to the conversation. The button is a plain form beside Archive.
  • Archive: archiving clears the pin. An archived conversation can't be pinned; the page says to Restore it first.
  • Storage: one nullable pinned_at column on conversation (additive migration 20261120100000-conversation-pinned, pin file added). listConversations orders pinned rows first, then by recent activity.
  • Terminal: p in the Conversations screen pins or unpins, so both doors have it. docs/features/talk.md has a Pin line.
  • Tests: test/talk-pin.test.ts covers pin to top, unpin, pinned ordering, archive clearing the pin, a cross-origin POST refused, another person's conversation refused, and signed-out refused.

What I left out:

  • Per-row buttons: the Pin button is on the open conversation, not on every row in the list. Rows are single links, and a form in each would change the list markup that the open draft pull #14488 touches.
  • Pin order: "newest first" for pinned ones means newest activity, not newest pinned.

Try it: open /talk, press Pin on a conversation and see it first under "Pinned". Press Unpin, or Archive, to drop it from there.

[
  {"go": "/talk", "look": "Pin button next to Archive on the open conversation", "expect": "Pin turns into Unpin; the conversation moves to the top of the list under a quiet 'Pinned' heading"},
  {"go": "/talk", "look": "Press Archive on the pinned conversation, then Restore it", "expect": "It returns unpinned, and the Pin button is not shown while it is archived"}
]

🤖 Generated with Claude Code

Closes #14564

7 earlier comments · 1 event
commented

A conversation on /talk can now be pinned. Pinned ones sit first in the list under a quiet "Pinned" heading, newest activity first among them.

Tests: the new test/talk-pin.test.ts plus the talk, TUI, schema and migration-pin tests pass, and tsc and design-lint are clean. I did not run the full suite. scripts/fast.ts found the diff too broad to name tests, so I picked the ones that cover it.

  • Pin and Unpin: POST /talk/:id/pin is same-origin, owner only, and answers 404 for another person's conversation. It redirects back to the conversation. The button is a plain form beside Archive.
  • Archive: archiving clears the pin. An archived conversation can't be pinned; the page says to Restore it first.
  • Storage: one nullable pinned_at column on conversation (additive migration 20261120100000-conversation-pinned, pin file added). listConversations orders pinned rows first, then by recent activity.
  • Terminal: p in the Conversations screen pins or unpins, so both doors have it. docs/features/talk.md has a Pin line.
  • Tests: test/talk-pin.test.ts covers pin to top, unpin, pinned ordering, archive clearing the pin, a cross-origin POST refused, another person's conversation refused, and signed-out refused.

What I left out:

  • Per-row buttons: the Pin button is on the open conversation, not on every row in the list. Rows are single links, and a form in each would change the list markup that the open draft pull #14488 touches.
  • Pin order: "newest first" for pinned ones means newest activity, not newest pinned.

Try it: open /talk, press Pin on a conversation and see it first under "Pinned". Press Unpin, or Archive, to drop it from there.

[
  {"go": "/talk", "look": "Pin button next to Archive on the open conversation", "expect": "Pin turns into Unpin; the conversation moves to the top of the list under a quiet 'Pinned' heading"},
  {"go": "/talk", "look": "Press Archive on the pinned conversation, then Restore it", "expect": "It returns unpinned, and the Pin button is not shown while it is archived"}
]

🤖 Generated with Claude Code

commented

<!-- look-pages 945860007e5b --> Look pages for 9458600, from the gate:

  • look pages (named): this pull changes src/web/pages/talk.ts; a commit names /talk
commented

I pushed a fix for the "both doors" gate failure, but I haven't re-run the gate here, so the check on the new push is the real test.

The gate flagged the new migration for having no terminal screen and no docs/features how-to of its own. The doors it asked for already exist. p in src/tui/screens/talk_chats.ts pins or unpins, and docs/features/talk.md has a Pin section. Because the gate seems to want them as new files, I added a commit line starting No door: (it needs a reason of 10+ characters) saying so. I didn't add a duplicate screen or doc.

The earlier preview deploy failure was not from this change. The deploy failed copying a run log that disappeared from production's data mid-copy. My retry commit for that never reached the remote, since the push hit a TLS error, so it is not on the branch. The new push should start a fresh deploy.

commented

<!-- look-pages af669294eaab --> Look pages for af66929, from the gate:

  • look pages (named): this pull changes src/web/pages/talk.ts; a commit names /talk
commented

The look-pages comment is informational: the gate named /talk as the page to picture. It asks for no code change, so I changed nothing and pushed nothing. The clone is clean and the branch already holds the work.

Pinned conversations on /talk now sort first under a Pinned heading. Archiving a conversation clears its pin. The migration adds one column. The TUI p key and the Pin section of docs/features/talk.md were already there, so no new door was needed.

I did not run bun test or the type check again for this turn, since nothing changed.

[
  {"go":"/talk","look":"the conversation list with at least one pinned conversation","expect":"pinned conversations sit first under a Pinned heading, the rest follow, and nothing shifts when the page loads"},
  {"go":"/talk","look":"pin an unpinned conversation, then reload","expect":"it moves under Pinned and stays there after the reload"},
  {"go":"/talk","look":"archive a pinned conversation","expect":"it leaves the Pinned group, and un-archiving it does not bring the pin back","ask":"Is clearing the pin on archive what you want?"}
]
Changes requested — before the latest push

Server side is sound: owner-only, same-origin via readForm, parameterised SQL, escaped output, archive clears the pin. Two misses. (1) Issue box 1 asks for Pin/Unpin buttons on each conversation in the list; this puts one only on the open conversation. Add a per-row pin form (a post form beside the row link, not nested inside the link) or agree a narrower scope on the issue first. (2) The terminal p key is new behaviour with no test. Add a TUI test that p pins, unpins, and refuses on an archived one. Also: the migration comment says "empty-null", which is unclear; say "null reads as not pinned".

commented

Both misses are fixed and the migration comment now says "null reads as not pinned". I ran the type check, the design lint, and the pin and TUI chat tests (18 tests, all pass). I did not run the whole suite.

  • Row buttons: every non-archived conversation row in the /talk list now has its own Pin/Unpin form beside the row link, not inside it. The forms go through the existing after slot on row(), so no new component class was needed. A hidden back=list field returns you to /talk after pinning. Any other back value falls back to the conversation page, so the redirect can't be pointed elsewhere.
  • Pinned heading: I kept the Pinned heading as a muted small list item. It is the quietest option the page already uses, and I found no list-heading class to reuse. Say so if you want a different one.
  • Tests: a new TUI test in test/tui-talk-chats.test.ts covers p pinning, unpinning, and refusing on an archived conversation. A new web test in test/talk-pin.test.ts covers the per-row forms and the back redirect.
[
  {"go":"/talk","look":"each conversation row","expect":"a small Pin button sits beside the row link; archived rows have none"},
  {"go":"/talk","look":"press Pin on a row that isn't the open one","expect":"you stay on the list, a success flash shows, and the row moves under Pinned with its button now reading Unpin"}
]
commented

<!-- look-pages 81c91791cf49 --> Look pages for 81c9179, from the gate:

  • look pages (named): this pull changes src/web/pages/talk.ts; a commit names /talk
commented

This feedback is the gate's automatic look-pages note. It names /talk as the page to picture and asks for no change, so I changed and pushed nothing. The branch already holds the work from the last round at 81c9179.

The pull adds pinning to /talk. Pinned conversations come first under a Pinned heading. Each non-archived row has its own Pin/Unpin form, which returns you to the list. Archiving clears the pin, and the terminal p key now has a test.

[
  {"go":"/talk","look":"the conversation list with one pinned conversation","expect":"it sits first under a quiet Pinned heading, and every non-archived row has a small Pin or Unpin button beside its link"},
  {"go":"/talk","look":"press Pin on a row, then Unpin on it","expect":"you stay on the list each time, a flash confirms, and the row moves under Pinned and back"},
  {"go":"/talk?archived=1","look":"the archived list","expect":"no Pin buttons on its rows"}
]
Approved

Both earlier asks are met: every non-archived row now has its own Pin/Unpin form (same-origin, owner only, back=list returns to /talk and any other back value falls back to the conversation), and the migration comment is fixed. Tests cover pin, unpin, ordering, archive clearing the pin, cross-origin and another person's conversation, plus the terminal p key. Both doors are covered and the how-to is in docs/features/talk.md, not README. Non-blocking: the Pin line in docs/features/talk.md still says Pin is on the open conversation only; mention the per-row buttons.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs