Files
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

37 lines
873 B
CSS

/*
* Page discussion and fact-check panel (components/portal/PageDiscussion.tsx).
*/
.page-discussion {
margin-top: 3rem;
padding-top: 2rem;
border-top: 1px solid var(--color-border-subtle);
}
.page-discussion-head {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
gap: 0.8rem;
margin-bottom: 0.8rem;
}
.page-discussion h2 {
font: 600 1.4rem var(--font-heading);
}
/* The thread and its box are chatkit's CommentThread (its styles.css); this
only places it under the fact-check panel. */
.page-discussion-thread {
margin-top: 1.2rem;
max-width: 40rem;
}
.factcheck-panel {
display: flex;
flex-direction: column;
gap: 0.5rem;
max-width: 40rem;
padding: 1rem;
border: 1px solid var(--color-border-subtle);
background: var(--color-surface-raised);
white-space: pre-wrap;
font-size: 0.9rem;
}