Skip to content

Consolidate status badges onto a shared/_badge partial - #2099

Merged
maebeale merged 2 commits into
mainfrom
extract-badge-partial
Aug 6, 2026
Merged

Consolidate status badges onto a shared/_badge partial#2099
maebeale merged 2 commits into
mainfrom
extract-badge-partial

Conversation

@maebeale

@maebeale maebeale commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

🤖 suggested review level: 5 Inspect 🔬 ~40 view files across many admin pages; subtle behavior (link jump icons, new-tab target/rel, normalized spacing)

What is the goal of this PR and why is this important?

The pill/badge recipe (inline-flex … rounded-full border text-xs …) was copy-pasted across ~40 views with drifted spacing/border/hover. This consolidates the genuine status badges onto one partial so badges are consistent and centrally styled.

How did you approach the change?

  • Add shared/_badge partial + badge_classes helper (the single source of the pill recipe, padding unified at px-2).
  • Partial locals: label, classes (theme bg/text/border), icon, icon_html (non-FA markers like status dots), href (→ link + trailing jump icon), extra (shrink-0/positioning passthrough), title, target/rel (keep "edit in admin" links opening in a new tab), data.
  • Convert ~30 call sites (static + link/jump pills). Normalize = the drifted spacing/border/hover become uniform; every link chip shows the jump icon; borderless pills gain a border.

Deliberately left alone

  • Interactive <select> pills (_attendance_status_badge, chip_select) — different interaction model.
  • Single-letter status circles (program_status_badge).
  • The 7 title_display_helper badges — a text-sm title-header family; normalizing would shrink them.

Verification

  • New partial + helper specs; ~1,000 request/view/decorator examples across every converted page pass; rubocop clean.

Notes for the reviewer

  • Visual change is intentional normalization (mostly gap/padding/border); a Current-vs-Normalize preview gallery was used to vet each family.
  • Link pills that had no jump icon (onboarding action links, dashboard nav chips, org "status by event") now show one — this was an explicit decision.

The pill recipe (inline-flex ... rounded-full border text-xs ...) was
copy-pasted across ~40 views. Extract the static (case 1) and link
(case 2) variants — same icon+label content model, differing only by an
optional link wrapper — into shared/_badge plus a badge_classes helper
that owns the class token. Convert _ce_status_badge, which was already
this exact span-vs-link branch, as the first adopter; other sites can
adopt incrementally.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 5, 2026 12:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@maebeale
maebeale marked this pull request as ready for review August 5, 2026 12:53
Convert ~30 hand-written pill/badge call sites (static and link/jump
variants) to render "shared/badge", collapsing the copy-pasted recipe
onto one partial + badge_classes helper. Normalizing unifies the drifted
spacing/border/hover and links all show the jump icon.

Partial gained icon_html (non-FA markers like status dots), extra
(shrink-0 / positioning passthrough), title, and target/rel so the
"edit in admin" links keep opening in a new tab. Padding unified at px-2.

Left alone: interactive <select> pills, single-letter status circles,
and the text-sm title_display_helper badges (a different size family).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 5, 2026 13:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@maebeale maebeale changed the title Extract shared badge partial for static + link pills Consolidate status badges onto a shared/_badge partial Aug 5, 2026
@maebeale
maebeale merged commit 823664e into main Aug 6, 2026
3 checks passed
@maebeale
maebeale deleted the extract-badge-partial branch August 6, 2026 15:59
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