Repository navigation
Dumbcourse: let a new topic have tags - #356
Merged
Merged
Conversation
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
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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
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.
{id, name}, the form Discourse now asks for.The boot data now carries each category's
minimum_required_tagsandrequired_tag_groups, and whether the member can tag topics and make tags./session/current.jsondoesn'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 thanmax_tag_search_results(default 5) gets a 400, so the forum's setting decides.Affected module(s)
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#tcladds 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 lintclean (types, ESLint, Prettier, Dumbcourse check and tests, languages); rubocop and stree clean.Checklist
pnpm lintis cleanbundle exec rubocopis cleanconfig/locales/server.en.ymlorclient.en.yml(no settings changed)Generated by Claude Code