Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 5 additions & 16 deletions app/views/admin/users/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,7 @@
<%= t(".table.trial_ends_at") %>: <%= sub.trial_ends_at&.to_fs(:long) || t(".not_available") %>
</span>
<% elsif sub %>
<span class="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium
<%= sub.active? ? "bg-success/10 text-success" : "bg-surface text-secondary" %>">
<%= sub.status.humanize %>
</span>
<%= render DS::Pill.new(label: sub.status.humanize, tone: sub.active? ? :success : :neutral) %>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Render pills in badge mode for role/status labels

DS::Pill defaults to marker mode (marker: true) with a visible dot (show_dot: true), but these replacements are for plain badges that previously rendered normal-case text without a dot. As written, labels like subscription status and role names now render as marker chips (uppercase styling + dot), which is a visible regression from the prior UI and inconsistent with existing badge usages that pass marker: false (and often show_dot: false).

Useful? React with 👍 / 👎.

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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Use badge mode for these pills (marker: false) to avoid marker/chip styling regression.

At Line 77 and Lines 191-203, DS::Pill is rendered with defaults, which means marker: true (uppercase, rounded-md, sub-12px marker chrome). These are status/role badges and should use badge mode.

Proposed patch
-<%= render DS::Pill.new(label: sub.status.humanize, tone: sub.active? ? :success : :neutral) %>
+<%= render DS::Pill.new(label: sub.status.humanize, tone: sub.active? ? :success : :neutral, marker: false, size: :sm) %>

-<%= render DS::Pill.new(label: t(".roles.guest"), tone: :neutral) %>
+<%= render DS::Pill.new(label: t(".roles.guest"), tone: :neutral, marker: false, size: :sm) %>

-<%= render DS::Pill.new(label: t(".roles.member"), tone: :neutral) %>
+<%= render DS::Pill.new(label: t(".roles.member"), tone: :neutral, marker: false, size: :sm) %>

-<%= render DS::Pill.new(label: t(".roles.admin"), tone: :neutral) %>
+<%= render DS::Pill.new(label: t(".roles.admin"), tone: :neutral, marker: false, size: :sm) %>

-<%= render DS::Pill.new(label: t(".roles.super_admin"), tone: :success) %>
+<%= render DS::Pill.new(label: t(".roles.super_admin"), tone: :success, marker: false, size: :sm) %>

Also applies to: 191-191, 195-195, 199-199, 203-203

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/views/admin/users/index.html.erb` at line 77, DS::Pill instances used for
status/role badges are rendered with the default marker=true causing marker/chip
styling; update each render of DS::Pill (e.g., render DS::Pill.new(label:
sub.status.humanize, tone: sub.active? ? :success : :neutral) and the similar
role/status pill renders later) to pass marker: false so they use badge mode
(e.g., DS::Pill.new(..., marker: false)); keep other props (label, tone)
unchanged.

<% else %>
<span class="text-xs text-secondary"><%= t(".no_subscription") %></span>
<% end %>
Expand Down Expand Up @@ -191,27 +188,19 @@
<%= settings_section title: t(".role_descriptions_title"), collapsible: true, open: true do %>
<div class="space-y-3 text-sm">
<div class="flex items-start gap-3">
<span class="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-surface text-primary shrink-0">
<%= t(".roles.guest") %>
</span>
<%= render DS::Pill.new(label: t(".roles.guest"), tone: :neutral) %>
<p class="text-secondary"><%= t(".role_descriptions.guest") %></p>
</div>
<div class="flex items-start gap-3">
<span class="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-surface text-primary shrink-0">
<%= t(".roles.member") %>
</span>
<%= render DS::Pill.new(label: t(".roles.member"), tone: :neutral) %>
<p class="text-secondary"><%= t(".role_descriptions.member") %></p>
</div>
<div class="flex items-start gap-3">
<span class="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-surface text-primary shrink-0">
<%= t(".roles.admin") %>
</span>
<%= render DS::Pill.new(label: t(".roles.admin"), tone: :neutral) %>
<p class="text-secondary"><%= t(".role_descriptions.admin") %></p>
</div>
<div class="flex items-start gap-3">
<span class="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-success/10 text-success shrink-0">
<%= t(".roles.super_admin") %>
</span>
<%= render DS::Pill.new(label: t(".roles.super_admin"), tone: :success) %>
<p class="text-secondary"><%= t(".role_descriptions.super_admin") %></p>
</div>
</div>
Expand Down
Loading