Skip to content

Dumbcourse: let a new topic have tags - #356

Merged
TripleU613 merged 1 commit into
mainfrom
claude/remove-disqualified-ballot-h5nhiv
Oct 25, 2026
Merged

TripleU613 merged 1 commit into
mainfrom
claude/remove-disqualified-ballot-h5nhiv

Conversation

@TripleU613

Copy link
Copy Markdown
Owner

Summary

Creating a topic in Dumbcourse in a category that needs tags failed with "You must select at least 1 tag", and the composer had no way to add one. Now, when tagging is on and the member can tag topics, a new topic gets a Tags field.

  • Add tag lists the category's tags, most used first, through Discourse's tag search, which knows the category's allowed and required tags. A Search item finds the rest.
  • New tags: someone allowed to make tags can use a new one.
  • Requirement: the field says how many tags the category needs. Sending without enough opens the list with that reason instead of failing.
  • Drafts: chosen tags are saved in the draft. They're sent as {id, name}, the form Discourse now asks for.

The boot data now carries each category's minimum_required_tags and required_tag_groups, and whether the member can tag topics and make tags. /session/current.json doesn't have those, so a session refresh keeps the boot values (signing in reloads the page).

The tag search sends no limit: asking for more than max_tag_search_results (default 5) gets a 400, so the forum's setting decides.

Affected module(s)

  • Moderator tools
  • Mini-mod
  • Dislike
  • Disteleplus
  • REQ-PM
  • Mod elections
  • Dumbcourse
  • Smart search
  • Pop-ups
  • Another SMTP
  • Translator tweaks
  • JTech theme
  • Shared (plugin.rb, settings, locales, docs, lint/CI)

Test plan

  • bin/rspec plugins/jtech-tools/spec/system/dumbcourse_spec.rb --tag ~mobile: 36 examples, 0 failures. That includes a new one: in a category needing a tag, the field says so, Create opens the tag list with the reason, picking #tcl adds it, and the topic is created with that tag. The mobile example wasn't run (it hangs in my container).
  • bin/rspec plugins/jtech-tools/spec/requests/dumbcourse_app_spec.rb: 18 examples, 0 failures, including a new one for the categories' tag rules and the member's tagging permissions in the boot data.
  • pnpm lint clean (types, ESLint, Prettier, Dumbcourse check and tests, languages); rubocop and stree clean.

Checklist

  • pnpm lint is clean
  • bundle exec rubocop is clean
  • New / changed settings have entries in config/locales/server.en.yml or client.en.yml (no settings changed)
  • New / changed behavior has a spec (a bug fix has one that fails without it)
  • Follows the repository rules: no access past core, visibility checked, nothing core already does
  • No Ruby file references a non-existent setting name

Generated by Claude Code

Creating a topic in a category that needs tags failed with "You must
select at least 1 tag", and Dumbcourse's composer had no way to add one.
Now a new topic gets a Tags field when tagging is on and the member can
tag topics. Add tag lists the category's tags, most used first (Discourse's
tag search, which knows the category's allowed and required tags), with a
Search item for the rest; someone allowed to make tags can use a new one.
The field says how many the category needs, and sending without enough
opens the list with that reason instead of failing. Chosen tags go in the
draft and are sent as {id, name}, the form Discourse now asks for.

The boot data carries each category's minimum_required_tags and
required_tag_groups, and whether the member can tag topics and make tags;
/session/current.json doesn't have those, so a refresh keeps them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FGn9A1EjvUZh9u1zSaCHPh
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-25T00:21:08.715318Z f47ce5e PR opened
🔒 Security Review ✅ Completed 2026-10-25T00:24:41.087847Z f47ce5e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@TripleU613
TripleU613 merged commit fbf141c into main Oct 25, 2026
10 checks passed
@TripleU613
TripleU613 deleted the claude/remove-disqualified-ballot-h5nhiv branch October 25, 2026 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants