@@ -95,26 +95,39 @@ export const EXPANDED_ROW_COUNT = ORGANIZATION_USAGE_BREAKDOWN_MAX_LIMIT
9595export const DEFAULT_USAGE_PRESET = '30d' as const
9696export const DEFAULT_USAGE_TAB = USAGE_OVERVIEW_TAB
9797
98+ /**
99+ * The Insights chart palette, declared on each chart's root so a layer, its legend
100+ * dot, and its tooltip swatch resolve to one color. Each hue is its source's color
101+ * elsewhere in the app — Sim green for Chat, the Enrichment block's purple, the
102+ * Knowledge block's teal, the agent violet — stepped to the lightness a filled mark
103+ * needs in each mode; badge text tokens are too pale in dark mode to fill a bar.
104+ */
105+ export const USAGE_PALETTE_CLASS =
106+ '[--usage-chat:#1f9d63] [--usage-enrichment:#c026d3] [--usage-knowledge:#0e9f9f] [--usage-agent:#6f3dfa] [--usage-other:var(--text-secondary)] dark:[--usage-chat:#2dac72] dark:[--usage-enrichment:#d946ef] dark:[--usage-agent:#8b5cf6] dark:[--usage-other:#8a8a8a]'
107+
98108/** Sim Chat's color, shared by its credit layer and the chat-runs chart. */
99- export const USAGE_CHAT_COLOR = 'var(--badge-orange-text)'
109+ export const USAGE_CHAT_COLOR = 'var(--usage-chat)'
110+
111+ /** The neutral remainder, shared by the credit and outcome stacks. */
112+ export const USAGE_OTHER_COLOR = 'var(--usage-other)'
100113
101114/**
102115 * The credit chart's layers, bottom-up. Each one owns a fixed color, so a layer keeps
103116 * its color when a quieter period drops its neighbours — color follows the source,
104117 * never its rank.
105118 *
106119 * Five hues plus a neutral `Other`: the palette is validated for adjacent-pair
107- * separation (including color-vision deficiency) in exactly this order, so reorder
108- * or extend it only by re-running that validation. A sixth distinct source belongs
109- * in `Other`, not in a generated hue.
120+ * separation (including color-vision deficiency) in both modes in exactly this order,
121+ * so reorder or extend it only by re-running that validation. A sixth distinct source
122+ * belongs in `Other`, not in a generated hue.
110123 */
111124export const USAGE_SOURCE_CATEGORIES = [
112125 { id : 'workflow' , label : 'Workflows' , color : 'var(--brand-blue)' } ,
113126 { id : 'chat' , label : 'Sim Chat' , color : USAGE_CHAT_COLOR } ,
114- { id : 'agent ' , label : 'Agent block ' , color : 'var(--badge-purple-text )' } ,
115- { id : 'knowledge' , label : 'Knowledge Base' , color : 'var(--badge-amber-text )' } ,
116- { id : 'enrichment ' , label : 'Enrichment ' , color : 'var(--badge-pink-text )' } ,
117- { id : 'other' , label : 'Other' , color : 'var(--text-muted)' } ,
127+ { id : 'enrichment ' , label : 'Enrichment ' , color : 'var(--usage-enrichment )' } ,
128+ { id : 'knowledge' , label : 'Knowledge Base' , color : 'var(--usage-knowledge )' } ,
129+ { id : 'agent ' , label : 'Agent block ' , color : 'var(--usage-agent )' } ,
130+ { id : 'other' , label : 'Other' , color : USAGE_OTHER_COLOR } ,
118131] as const
119132
120133export type UsageSourceCategoryId = ( typeof USAGE_SOURCE_CATEGORIES ) [ number ] [ 'id' ]
0 commit comments