feat: replies on every article, in the board's own chrome

A message base is a thing people answer, and until now this one could only be
read. The site already calls its articles messages in areas, so replies are the
feature the metaphor was asking for rather than a comment box bolted onto it.

Talks to the comment server's API directly instead of loading its widget. The
widget is a React app in an iframe and would arrive with its own fonts, spacing
and avatars; an iframe cannot inherit the page's font in any case. Rules are
drawn the way the guestbook draws them, padded to exactly 80 cells, so a reply
is indistinguishable from any other row on the board. All five pre elements in
the section measure 80 in a real browser.

Two things this surfaced, both verified by driving a browser rather than curl:

The command handler took every letter key as a command, which was harmless when
there was nothing on the board to type into. With a message box, typing `i`
navigated to the index mid-sentence. It now ignores keys aimed at an input or
textarea.

bbs.js already says the bracket chrome is a promise rather than decoration, and
[P]ost was drawn without wiring P to anything. P now focuses the message box.

Handles are checked here as well as at the server, since remark42 wants three
or more characters and only letters, numbers, underscores and spaces; failing
in the page is better than a refusal with no explanation.

Without JS the section is simply absent, which is honest, and the capsule never
sees it since Gemini has no way to render it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
randogoth 2026-10-06 18:10:23 +03:00
parent 0fc11795f7
commit 4f77f16191
3 changed files with 189 additions and 0 deletions

View file

@ -98,3 +98,9 @@ MARKDOWN = {
DELETE_OUTPUT_DIRECTORY = True
CACHE_CONTENT = False
# The comment server. One instance serves three sites, keyed on COMMENTS_SITE,
# so this is the id rather than the hostname. Unset it and the replies section
# disappears from every article, which is the off switch.
COMMENTS_HOST = 'https://comments.randogoth.com'
COMMENTS_SITE = 'randogoth'