Per-topic prompt: Statement/Checklist modes, frequency, TL cap#18
Merged
Conversation
Extend the per-topic Prompt Checklist with three new knobs and migrate the legacy per-topic before-reply prompt out of the Moderator Actions modal: - mode: "statement" (single Markdown-cooked message + accept button — replaces the legacy per-topic reply prompt) or "checklist" (existing multi-item flow). - frequency: "once" (default — per-user version-tracked acceptance) or "every_reply" (always prompt; no acceptance recorded). - max_tl: 0-4 trust-level cap, mirroring the global checklist; staff always see the prompt regardless of cap. The user-facing modal now renders both modes. The Moderator Actions modal no longer shows the Before-reply prompt textarea or audience combo-box; the per-topic prompt lives exclusively under the dedicated Prompt Checklist editor. Legacy migration: opening the Prompt Checklist editor on a topic that still has mod_topic_reply_prompt set (and no new prompt-checklist config) pre-fills the editor in Statement mode with the legacy text and legacy mod_topic_reply_prompt_max_tl as the new max_tl, with a notice. Saving writes the new config and clears the two legacy custom fields. The legacy fields remain registered and the legacy gate still runs for any unmigrated topic. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Two follow-ups from CI: - firstPostChecklistFor treated an empty items[] as inactive, which is the right behaviour for checklist mode but skipped statement mode (where items is empty by design). Branch on the mode: statement mode is gated when statement is non-blank, other modes still require at least one item. Adds unit tests covering both branches. - The gallery_expansion tests that exercise the statement-mode editor now first switch the mode combo-box to "statement" before filling the textarea; the editor defaults to checklist mode for a topic with no existing config. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Adds two specs that cover the statement-mode flow more directly: - A request spec asserts that the owed_checklist_for helper returns the full payload — kind/id/version/mode/statement/items/button_label/ updated_at — when only a non-blank statement is set (items: []). Catches a regression where the owed gate treated armed strictly as items.length > 0. - A system spec drives the full editor-to-user round trip: staff open the per-topic Prompt Checklist editor, switch the Mode combo-box to Statement, type the statement, save, then a user replies. The user-facing modal opens with the statement rendered, no checkboxes, and the accept button enabled immediately; accepting posts the reply. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extend the per-topic Prompt Checklist (PR #17) with three new knobs and
migrate the legacy per-topic before-reply prompt out of the Moderator
Actions modal.
New per-topic config fields
statement(single Markdown-cooked message + accept button)or
checklist(the existing multi-item flow). Statement mode replacesthe legacy per-topic before-reply prompt as the supported way to set it.
once(default — per-user version-tracked acceptance)or
every_reply(always prompt; no acceptance recorded).max_tl. Staff always see the prompt regardless of cap. Targetedchecklists still take priority.
Editor (Prompt Checklist modal)
max_tl.User-facing modal
mod-first-post-checklistrenders both modes:is enabled immediately.
all ticked).
Removed from "Moderator Actions"
The legacy Before-reply prompt textarea + audience combo-box are
gone from
mod-topic-messages-modal. Staff now configure the per-topicprompt exclusively through the dedicated Prompt Checklist entry.
Legacy migration
The legacy
mod_topic_reply_promptandmod_topic_reply_prompt_max_tltopic custom fields stay registered. When the Prompt Checklist editor
loads for a topic that still has the legacy reply prompt set (and no
new prompt-checklist config), the editor pre-fills itself in Statement
mode with the legacy text and the legacy
mod_topic_reply_prompt_max_tlas
max_tl, and shows a migration notice. Saving the new config writesthe new structure AND clears the two legacy fields, so the new flow is
the sole source of truth from then on. Any unmigrated topic continues
to use the legacy composer gate.
Tests + docs
spec/requests/topic_prompt_checklist_spec.rb(statementmode payloads,
frequency: every_replyalways returns,max_tlcapfilters non-staff above the cap, legacy pre-fill + migration).
spec/system/topic_prompt_checklist_spec.rb(statement-modemodal renders without checkboxes;
every_replyre-prompts on thesecond reply;
max_tl=1skips a TL2 user; Moderator Actions modalno longer carries the Before-reply prompt section). Screenshots
181–186.
.mod-reply-input/
.mod-reply-audience-inputselectors to either use the new PromptChecklist modal or assert the legacy section is gone.
docs/topic-prompt-checklist.md,docs/topic-reply-prompt.md(marked superseded with migration notes),
docs/features.md,README.md,docs/testing.md, andCHANGELOG.md.🤖 Generated with Claude Code