Task: Fix gray badge misuses; orange fallback; account detail dialog badges

Table of Contents

This page documents a task in the Badge colour semantics: reserve gray for inactive states story. It captures the goal, current status, acceptance, and any notes or results.

Goal

Apply the gray-is-inactive rule across the badge system. Audit findings:

  • account_type_service shipped gray in PR #1038 — recolour teal #14b8a6.
  • account_unlocked (positive) and state_done (completed) were gray — recolour green #22c55e.
  • Every badge resolver fell back to gray when no definition resolves, conflating "definition missing" with "inactive" — introduce color_constants::badge_fallback (orange #f97316) and use it in the 8 MDI-window resolvers, TenantMdiWindow, AccountItemDelegate and DatasetItemDelegate. Semantic grays (No/disabled/Pending/Unsent and the inactive=/=login_never=/=fsm_draft=/=treatment_raw definitions) stay.
  • Account detail dialog showed Online/Locked as plain text — add BadgeLabelUtils (widget counterpart of the delegate badge painter) and render both as DB-driven badges; new account_online code domain reuses login_online=/=inactive definitions.

Status

Field Value
State DONE
Parent story Badge colour semantics: reserve gray for inactive states
Now Nothing.
Waiting on Nothing.
Next Nothing — task closed.
Last touched 2026-06-04

Acceptance

  • Recoloured definitions live in dq_badge_system_populate.sql with comments stating the rule.
  • color_constants::badge_fallback / badge_fallback_text defined and used by every fallback site; no QColor(0x6B, 0x72, 0x80) fallbacks remain in badge resolvers.
  • Account detail dialog renders Online and Locked as badges via BadgeLabelUtils with the badge cache injected through DetailDialogBase::setBadgeCache.
  • Full build green.

Plan

(Transient implementation strategy. Written when work starts; distilled into the parent story's * Decisions and cleared when the task closes. Plans do not outlive their task.)

Notes

PRs

PR Title
#1044 [dq,qt,lisp] Badge colour semantics: gray means inactive; site subscript fix

Review

# Comment summary File Decision Notes
1 :with-sub-superscript should be plural ores-build-site.el Declined Verified against org in Emacs 30.2: property is singular; plural is only the variable name.
2 Validate DB colours before building stylesheet BadgeLabelUtils.cpp Fixed in 04c0aa7af Invalid colour now keeps the orange fallback.

Result

Delivered in PR #1044. Seed data recoloured (service teal, unlocked and done green) with rule-stating comments; orange missing-definition fallback (color_constants::badge_fallback) across all 12 badge resolver sites; BadgeLabelUtils + DetailDialogBase::setBadgeCache with Online/Locked rendered as DB-driven badges in the account detail dialog via the new account_online code domain. Review round 1: colour validation added (invalid DB colour keeps the fallback); the :with-sub-superscript plural suggestion declined with empirical evidence. Full build green twice; site build green after fixing a broken parent link in the UX doc task.

Emacs 29.1 (Org mode 9.6.6)