Surface hidden (unpublished) sector & category tags to admins#1708
Merged
Conversation
Admins browse the same tags pages as the public, but had no way to tell at a glance which tags the public can't see. Render unpublished sector and category chips as a muted grey chip with a closed-eye icon (the same "hidden" cue used by the password-visibility toggle) so the hidden-from-public state reads instantly. The chips stay admin-only via the existing :taggable policy scope; the public never sees them. Also adds admin "Edit sector/category" shortcuts on the filtered taggings header, and seeds a few unpublished sectors and categories with taggings in the dev sample data so the hidden state is exercised locally. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
maebeale
commented
Jun 17, 2026
| puts "Creating unpublished sectors with taggings…" | ||
| workshop_pool = Workshop.all.to_a | ||
| [ "Animal-Assisted Therapy", "School Counseling", "Youth Mentorship" ].each do |sector_name| | ||
| sector = Sector.where("LOWER(name) = LOWER(?)", sector_name).first_or_create!(name: sector_name) |
Collaborator
Author
There was a problem hiding this comment.
🤖 From Claude: Inline case-insensitive first_or_create! rather than the find_or_create_by_name! helper in seeds.rb — this dev file is meant to be runnable standalone (rake db:seed:workshops), where that helper isn't loaded.
maebeale
commented
Jun 17, 2026
| # attached to an existing type so they group correctly on the tags page, and stay | ||
| # unpublished (they're not on any canonical list). | ||
| puts "Creating unpublished categories with taggings…" | ||
| art_type = CategoryType.where("LOWER(name) = LOWER(?)", "ArtType").first_or_create!(name: "ArtType", published: true) |
Collaborator
Author
There was a problem hiding this comment.
🤖 From Claude: These names are deliberately non-canonical, so base db/seeds.rb never republishes them and they stay hidden. Dev seeds run after base seed, so the unpublished state sticks.
maebeale
commented
Jun 17, 2026
|
|
||
| <% border_hover_class = DomainTheme.border_class_for(:sectors, intensity: 500) %> | ||
|
|
||
| <% if is_hidden |
Collaborator
Author
There was a problem hiding this comment.
🤖 From Claude: The grey hidden treatment intentionally overrides any explicit bg_color/border passed in (e.g. the bg-white chips on /tags), so hidden always reads as hidden regardless of caller styling.
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.
Closes [link an issue or remove this line]
What is the goal of this PR and why is this important?
/tagsand taggings pages as the public, but had no way to tell which tags are hidden from the public (unpublished).How did you approach the change?
shared/_hidden_tag_icon) — the same "hidden" glyph used by the password-visibility toggle on login. The grey treatment wins even when an explicitbg_coloris passed.:taggablepolicy scope (has_taggingsfor admins,published.has_published_taggingsfor everyone else) — the public never sees hidden tags.Sector.sector_names_allscope mirroringCategory.category_names_allso the header can resolve the active filter to records.db/seeds/dev/workshops.rb) so the hidden state is exercised locally. Basedb/seeds.rbremains the canonical list only.UI Testing Checklist
/tags— unpublished sectors/categories appear as grey chips with a closed-eye icon, sized inline at normal chip height.Anything else to add?
db:seed) stay canonical-only.