Files
substrata/docs
CatoandClaude 116e9537d0 feat(comments): page discussion is chatkit's CommentThread (#387)
* feat(comments): page discussion is chatkit's CommentThread

The discussion under notes, learn, resources and profile pages was a
hand-rolled list and a bare <textarea> with no microphone. The fleet rule
is that comments are chatkit's CommentThread and that anywhere a person
types words there is a microphone, so:

- Bump @bitbaum/chatkit ^0.22.1 -> ^0.25.0 (CommentThread arrived in 0.23).
  Ask (ResearchChat, AskBox) type-checks and renders unchanged.
- PageDiscussion renders CommentThread: the box is chatkit's Composer with
  the microphone (/api/transcribe), Enter-to-send, and a refused post keeps
  the draft. Posting still goes to /api/comments, where threadkit's
  canWrite decides who may write; a signed-out reader (from /api/me) sees
  "Sign in to comment" linking to sign-in and back to the page instead of
  a box that only fails on submit. Dates keep the YYYY-MM-DD form and
  authors keep "Reader" / "Substrata". Fact-check stays Substrata's and
  re-mounts the thread with its new comment.
- Drop the CSS the package now owns (.page-comments, .comment-meta,
  .comment-form); bind PageDiscussion under the chat block of
  package-plan.json; note it in docs/IMPLEMENTATION-PLAN.md.

Claude-Session: https://claude.ai/code/session_019MDtmuvTGrpo3VChP3skH8

* fix(comments): a refused comment says why, and no sign-in link where sign-in is off

The route's refusals (too short, the hourly limit, sign in) are thrown as
chatkit's CommentRefused, so the thread shows them instead of a generic
"try again" that would fail the same way forever; a comment under the
route's 3-character floor is refused before it is sent. The sign-in link
shows only once /api/me says sign-in exists on this deployment.

Needs @bitbaum/chatkit 0.28.0 (CommentRefused); the bump follows.

Claude-Session: https://claude.ai/code/session_019MDtmuvTGrpo3VChP3skH8

* chore(deps): @bitbaum/chatkit ^0.28.0 (CommentRefused)

Claude-Session: https://claude.ai/code/session_019MDtmuvTGrpo3VChP3skH8

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-12 12:48:41 +01:00
..