panel: show membership state as one short pill; drop the extended caption

The co-op's panels do not put text under the pills. Replace the long
state-reason caption (and the over-long pill tooltip) with a single short
pill (in_grace -> 'grace') whose tooltip is one short line, matching the
existing pill vocabulary.
This commit is contained in:
inference-bot committed 2026-11-04 18:54:58 +00:00
1 parent db59f0d48e
commit 852be80c41
1 file changed
+9 -9
+9 -9
View File
@@ -272,7 +272,6 @@ PAGE_HTML = """<!DOCTYPE html>
.pill.manual { background: #f1e8da; color: #a97a4a; } .pill.manual { background: #f1e8da; color: #a97a4a; }
.pill.org { background: #e7edf5; color: #4a6a8a; } .pill.org { background: #e7edf5; color: #4a6a8a; }
.pill.grace { background: #fdf3e3; color: #a97a2a; } .pill.grace { background: #fdf3e3; color: #a97a2a; }
.state-reason { color: var(--muted); font-size: 11px; margin-top: 2px; }
/* Trends tab (charts). Colours come from the same vars as the rest of the /* Trends tab (charts). Colours come from the same vars as the rest of the
panel; the SVG is inline so there is no chart library and no CDN. */ panel; the SVG is inline so there is no chart library and no CDN. */
.trend-controls { display: flex; gap: 22px; flex-wrap: wrap; margin: 14px 0 0; } .trend-controls { display: flex; gap: 22px; flex-wrap: wrap; margin: 14px 0 0; }
@@ -753,17 +752,18 @@ function renderMembers() {
const reset = m.reset_at ? m.reset_at.slice(0,10) : '—'; const reset = m.reset_at ? m.reset_at.slice(0,10) : '—';
// Membership state is computed by the PORTAL (the source of truth) and // Membership state is computed by the PORTAL (the source of truth) and
// carried on the overview row — the panel only renders it. Non-active // carried on the overview row — the panel only renders it. Non-active
// states (in grace / awaiting contribution) still keep the member's access; // states (in grace / awaiting contribution) still keep the member's access.
// the reason is shown beneath the pill. // ONE short pill, matching the panel's pill vocabulary; no caption line.
const state = m.state || (m.active ? 'active' : 'inactive'); const state = m.state || (m.active ? 'active' : 'inactive');
const stateLabel = { active: 'active', in_grace: 'in grace', const stateLabel = { active: 'active', in_grace: 'grace',
awaiting_contribution: 'awaiting', inactive: 'inactive' }[state] || state; awaiting_contribution: 'awaiting', inactive: 'inactive' }[state] || state;
const stateClass = state === 'active' ? 'active' : (state === 'inactive' ? 'inactive' : 'grace'); const stateClass = state === 'active' ? 'active' : (state === 'inactive' ? 'inactive' : 'grace');
const stateReason = m.state_reason || ''; const stateTitle = { active: '', in_grace: 'Payment due — access continues during grace',
const statusCell = '<span class="pill ' + stateClass + '" title="' + esc(stateReason) + '">' + awaiting_contribution: 'Awaiting contribution',
esc(stateLabel) + '</span>' + inactive: 'Membership deactivated' }[state] || '';
(stateReason && state !== 'active' const statusCell = '<span class="pill ' + stateClass + '"' +
? '<div class="state-reason">' + esc(stateReason) + '</div>' : ''); (stateTitle ? ' title="' + esc(stateTitle) + '"' : '') + '>' +
esc(stateLabel) + '</span>';
const act = m.activated const act = m.activated
? '<span class="pill active">yes</span>' ? '<span class="pill active">yes</span>'
: '<span class="pill inactive">pending</span>'; : '<span class="pill inactive">pending</span>';