Visibility UI: selector, badges, and filtering #35

Open
opened 2026-06-08 03:21:08 +00:00 by ldraney · 0 comments
Owner

Type

Feature

Lineage

Follow-up from spike #17 (docs/visibility.md — Implementation Tickets). Depends on #30 (visibility column) and #32 (users + OmniAuth).

Repo

ldraney/palinks

User Story

As Lucas
I want to see and control link visibility from the dashboard
So that I can manage what each audience sees

Context

The visibility column exists (from #30) but isn't wired into the UI. This ticket adds: a dropdown on the link form, visibility badges on cards (superadmin only), and visible_to(current_role) filtering in the controller. Anonymous users see public links only, members see public+member, superadmin sees all.

File Targets

  • app/controllers/links_controller.rb — wire visible_to(current_role) into index, permit visibility param
  • app/views/links/_form.html.erb — add visibility dropdown (superadmin only)
  • app/views/links/_link.html.erb — add visibility badge (superadmin only)
  • CSS for badges and dropdown

Feature Flag

Flag: visibility_badges
Type: role-scoped
Default: disabled
Visibility: superadmin only
Removal: after visibility system is proven stable (2+ weeks)

The filtering itself (which links you see) is NOT flagged — that's core behavior. Only the badge display is flagged for gradual rollout.

Acceptance Criteria

  • Link form has visibility dropdown (public/member/superadmin) — superadmin only
  • Dashboard filters links by visible_to(current_role)
  • Superadmin sees all links with visibility badges
  • Members see public + member links (no badges)
  • Anonymous users see public links only
  • Changing visibility takes effect immediately

Test Expectations

  • Integration test: index returns only visible links per role
  • Unit test: form includes visibility field for superadmin
  • Run: bundle exec rails test

Constraints

  • Visibility dropdown only shown to superadmin
  • Badges are behind visibility_badges feature flag
  • Do not change link card layout significantly

Checklist

  • PR opened
  • Tests pass
  • No unrelated changes
  • project-palinks — project page
  • docs/visibility.md — tier definitions and inventory
  • #30 — visibility column (dependency)
  • #32 — users + OmniAuth (dependency for current_role)
### Type Feature ### Lineage Follow-up from spike #17 (`docs/visibility.md` — Implementation Tickets). Depends on #30 (visibility column) and #32 (users + OmniAuth). ### Repo `ldraney/palinks` ### User Story As Lucas I want to see and control link visibility from the dashboard So that I can manage what each audience sees ### Context The visibility column exists (from #30) but isn't wired into the UI. This ticket adds: a dropdown on the link form, visibility badges on cards (superadmin only), and `visible_to(current_role)` filtering in the controller. Anonymous users see public links only, members see public+member, superadmin sees all. ### File Targets - `app/controllers/links_controller.rb` — wire `visible_to(current_role)` into index, permit visibility param - `app/views/links/_form.html.erb` — add visibility dropdown (superadmin only) - `app/views/links/_link.html.erb` — add visibility badge (superadmin only) - CSS for badges and dropdown ### Feature Flag Flag: `visibility_badges` Type: role-scoped Default: disabled Visibility: superadmin only Removal: after visibility system is proven stable (2+ weeks) The filtering itself (which links you see) is NOT flagged — that's core behavior. Only the badge display is flagged for gradual rollout. ### Acceptance Criteria - [ ] Link form has visibility dropdown (public/member/superadmin) — superadmin only - [ ] Dashboard filters links by `visible_to(current_role)` - [ ] Superadmin sees all links with visibility badges - [ ] Members see public + member links (no badges) - [ ] Anonymous users see public links only - [ ] Changing visibility takes effect immediately ### Test Expectations - [ ] Integration test: index returns only visible links per role - [ ] Unit test: form includes visibility field for superadmin - Run: `bundle exec rails test` ### Constraints - Visibility dropdown only shown to superadmin - Badges are behind `visibility_badges` feature flag - Do not change link card layout significantly ### Checklist - [ ] PR opened - [ ] Tests pass - [ ] No unrelated changes ### Related - `project-palinks` — project page - `docs/visibility.md` — tier definitions and inventory - #30 — visibility column (dependency) - #32 — users + OmniAuth (dependency for current_role)
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ldraney/palinks#35
No description provided.