codex-copilot-dx 1.2.9 → 1.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,7 +17,8 @@ html { scrollbar-gutter: stable; }
17
17
  button { border: 1px solid var(--button-border); border-radius: 2px; background: var(--button-bg); color: var(--button-fg); padding: 8px 13px; font: inherit; font-size: 11px; font-weight: 700; text-transform: uppercase; cursor: pointer; }
18
18
  button:hover { background: var(--button-hover); }
19
19
  button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
20
- button:disabled { opacity: .55; cursor: wait; }
20
+ button:disabled { opacity: .55; cursor: default; }
21
+ button[aria-busy="true"] { cursor: progress; }
21
22
  .icon-button { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 6px; border: 0; background: transparent; }
22
23
  .icon-button:hover { background: transparent; color: var(--accent); }
23
24
  .icon-button svg { width: 18px; height: 18px; }
@@ -55,10 +56,9 @@ h1 { margin: 0; font-size: clamp(20px, 3vw, 27px); font-weight: 650; letter-spac
55
56
  .heading-actions { display: flex; align-items: center; gap: 16px; }
56
57
  .heading-actions button { padding: 5px 9px; }
57
58
  .animation-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
58
- .theme-option { display: grid; grid-template-columns: 18px 76px minmax(0, 1fr); align-items: center; gap: 8px; min-width: 0; width: 100%; border: 1px solid var(--border); padding: 10px; background: transparent; color: var(--text); text-align: left; text-transform: none; font-size: 11px; cursor: pointer; }
59
- .theme-option::before { content: "○"; color: var(--subtle); font-size: 17px; line-height: 1; }
60
- .theme-option[aria-pressed="true"] { border-color: var(--accent-soft); background: var(--selected-bg); }
61
- .theme-option[aria-pressed="true"]::before { content: "●"; color: var(--accent-soft); }
59
+ .theme-option { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 8px; min-width: 0; width: 100%; border: 1px solid var(--border); padding: 10px; background: transparent; color: var(--text); text-align: center; text-transform: none; font-size: 12px; cursor: pointer; }
60
+ .theme-option[aria-pressed="true"], .theme-option[aria-pressed="true"]:hover { border-color: var(--accent); background: var(--accent); color: var(--page); }
61
+ .theme-option[aria-pressed="true"] .theme-name, .theme-option[aria-pressed="true"] small, .theme-option[aria-pressed="true"] .theme-preview, .theme-option[aria-pressed="true"] .theme-preview span { color: var(--page); }
62
62
  .theme-option:hover { background: var(--option-hover); }
63
63
  .theme-name { color: var(--text); font-size: 11px; white-space: nowrap; }
64
64
  .theme-name small { display: block; color: var(--subtle); font-size: 9px; margin-top: 2px; }
@@ -80,6 +80,7 @@ table { width: 100%; border-collapse: collapse; font-size: 11px; }
80
80
  th { color: var(--heading); text-align: left; font-weight: 700; letter-spacing: .05em; }
81
81
  th, td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--border); white-space: nowrap; }
82
82
  th:last-child, td:last-child { padding-right: 0; }
83
+ tbody tr:last-child td { border-bottom: 0; }
83
84
  td { color: var(--table-text); }
84
85
  .usage-table th:not(:first-child), .usage-table td:not(:first-child) { text-align: right; }
85
86
  .usage-table tr.total-row td { color: var(--accent); font-weight: 700; }
@@ -105,7 +106,10 @@ details[open] > summary::before { content: "−"; }
105
106
  .analytics-section { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
106
107
  .analytics-controls { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 18px; }
107
108
  .analytics-controls label { color: var(--muted); font-size: 11px; }
108
- select { max-width: 260px; padding: 5px; font: inherit; color: var(--text); background: var(--page); border: 1px solid var(--border); }
109
+ select { appearance: none; -webkit-appearance: none; max-width: 260px; min-height: 36px; padding: 7px 30px 7px 10px; font: inherit; color: var(--text); background-color: var(--surface); border: 1px solid var(--button-border); border-radius: 0; box-shadow: none; background-image: linear-gradient(45deg, transparent 50%, var(--text) 50%), linear-gradient(135deg, var(--text) 50%, transparent 50%); background-position: calc(100% - 13px) 15px, calc(100% - 9px) 15px; background-size: 4px 4px; background-repeat: no-repeat; }
110
+ select:focus { border-color: var(--accent); border-radius: 0; box-shadow: none; }
111
+ select:focus:not(:focus-visible) { outline: none; }
112
+ select option { color: var(--text); background: var(--surface); }
109
113
  .chart-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin: 22px 0 10px; }
110
114
  .chart-heading h3 { margin: 0; color: var(--heading); font-size: 11px; }
111
115
  .chart-heading span, .chart-legend { color: var(--muted); font-size: 10px; }
@@ -153,7 +157,15 @@ footer { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; color:
153
157
  .timing-stats dt { white-space: nowrap; }
154
158
 
155
159
  .provider-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
156
- .provider-tabs [aria-selected="true"] { color: var(--accent); border-color: var(--accent-soft); background: var(--selected-bg); }
160
+ .provider-tabs button, .install-platforms button { text-align: center; }
161
+ .provider-tabs [aria-selected="true"], .provider-tabs [aria-selected="true"]:hover, .install-platforms [aria-pressed="true"], .install-platforms [aria-pressed="true"]:hover { color: var(--page); border-color: var(--accent); background: var(--accent); }
162
+ .model-catalog table, .model-catalog td { color: var(--text); font-size: 13px; background: var(--surface); }
163
+ .model-catalog th { color: var(--text); font-size: 12px; }
164
+ .model-catalog > summary h2 { color: var(--strong); }
165
+ .model-catalog .model-name { color: var(--strong); font-weight: 600; }
166
+ .model-catalog td:last-child { white-space: normal; }
167
+ .model-catalog td details { margin: 0; }
168
+ .model-catalog .failure-detail { min-width: 200px; }
157
169
  #provider-auth td, #provider-clients td { overflow-wrap: anywhere; }
158
170
  .details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
159
171
  @media (max-width: 700px) { .details { grid-template-columns: 1fr; } }
@@ -176,15 +188,15 @@ footer { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; color:
176
188
  .topbar-actions { gap: 12px; flex-wrap: nowrap; }
177
189
  .topbar-actions #connection { width: 154px; flex: none; }
178
190
  .topbar-actions #auto-refresh { width: 164px; flex: none; }
179
- .intro { display: block; padding: 32px 0 26px; min-height: 132px; }
180
- .intro .page-description { margin-top: 14px; line-height: 1.7; }
191
+ .intro { display: block; padding: 32px 0 26px; min-height: 98px; }
181
192
  main { align-self: start; }
193
+ #main-content:focus { outline: none; }
182
194
  .section-link { display: inline-block; color: var(--accent); font-size: 12px; text-underline-offset: 3px; }
183
195
  .section-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
184
196
  .model-summary strong { color: var(--strong); }
185
197
  .panel h3 { color: var(--heading); font-size: 12px; font-weight: 650; margin: 0; }
186
198
  .setting-row + .tool-details { border-top: 0; padding-top: 0; }
187
- .diagnostic-section + .diagnostic-section { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); }
199
+ .diagnostic-section + .diagnostic-section { margin-top: 26px; }
188
200
  .diagnostic-section > strong { display: block; color: var(--strong); font-size: 23px; margin-top: 16px; }
189
201
  .usage-source-controls { margin: 0 0 20px; }
190
202
  .chart-heading { flex-wrap: wrap; align-items: end; }
@@ -204,7 +216,7 @@ main { align-self: start; }
204
216
  .section-actions label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; max-width: 100%; }
205
217
  .section-actions input, .section-actions select { max-width: 100%; min-height: 36px; }
206
218
  input[type="number"] { width: 120px; font: inherit; color: var(--text); background: var(--page); border: 1px solid var(--border); padding: 7px; }
207
- .setting-row { display: grid; grid-template-columns: minmax(160px, 1fr) 44px minmax(0, 1.4fr); align-items: center; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
219
+ .setting-row { display: grid; grid-template-columns: minmax(160px, 1fr) 44px minmax(0, 1.4fr); align-items: center; gap: 16px; padding: 20px 0; font-size: 13px; }
208
220
  .setting-row .hint { margin: 0; }
209
221
  input[role="switch"] { appearance: none; width: 38px; height: 22px; border: 1px solid var(--button-border); border-radius: 20px; background: var(--border); cursor: pointer; margin: 0; position: relative; }
210
222
  input[role="switch"]::before { content: ""; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; border-radius: 50%; background: var(--muted); }
@@ -260,9 +272,9 @@ input[role="switch"]:disabled { opacity: .5; cursor: wait; }
260
272
  .appearance-label { min-width:0; }
261
273
  .appearance-label label { display:block; font-size:13px; color:var(--text); line-height:1.65; }
262
274
  .appearance-label p { margin:4px 0 0; font-size:12px; color:var(--subtle); line-height:1.7; }
263
- .appearance-select { width:100%; max-width:100%; min-width:0; height:36px; box-sizing:border-box; border-radius:2px; padding:0 10px; font-size:12px; }
275
+ .appearance-select { width:100%; max-width:100%; min-width:0; height:36px; box-sizing:border-box; border-radius:0; padding:0 30px 0 10px; font-size:12px; }
264
276
  .appearance-note { color:var(--subtle); margin:17px 0 0; font-size:12px; line-height:1.7; }
265
- .appearance-animation { margin-top:22px; border-top:1px solid var(--border); padding-top:18px; }
277
+ .appearance-animation { margin-top:22px; }
266
278
  .terminal-animation-toggle { border-bottom:0; }
267
279
  .sidebar nav a { display:flex; align-items:center; gap:10px; }
268
280
  .nav-icon { width:17px; height:17px; flex:none; fill:none; stroke:currentColor; stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; }
@@ -271,6 +283,7 @@ input[role="switch"]:disabled { opacity: .5; cursor: wait; }
271
283
  .version-heading h2 { margin:0; }
272
284
  .version-list { margin:18px 0 0; }
273
285
  .version-list > div { display:grid; grid-template-columns:minmax(110px,1fr) auto minmax(150px,1fr); align-items:baseline; gap:16px; padding:14px 0; border-bottom:1px solid var(--border); }
286
+ .version-list > div:last-child { border-bottom:0; }
274
287
  .version-list dt { font-size:12px; }
275
288
  .version-list dd { margin:0; }
276
289
  .version-list dd:nth-child(2) { font-size:18px; font-weight:650; color:var(--strong); }
@@ -366,12 +379,11 @@ input[role="switch"]:disabled { opacity: .5; cursor: wait; }
366
379
  .state-label.state-unavailable, .state-label.state-unknown { color:var(--muted); }
367
380
  .state-label > span { color:inherit; white-space:normal; }
368
381
  .badge:has(.state-label)::before { display:none; }
369
- .source-browse-note { margin:12px 0 20px; }
370
- .account-name { margin:18px 0 6px; font-size:19px; color:var(--strong); font-weight:650; }
382
+ .account-name { margin:18px 0 6px; font-size:19px; color:var(--strong); font-weight:650; overflow-wrap:anywhere; }
371
383
  .account-fields { display:grid; grid-template-columns:minmax(110px,150px) minmax(0,1fr); gap:10px 18px; margin:20px 0; font-size:12px; line-height:1.7; }
372
384
  .account-fields dt { color:var(--muted); }
373
385
  .account-fields dd { margin:0; min-width:0; }
374
- .tool-details, .tool-flow { margin-top:18px; padding-top:16px; border-top:1px solid var(--border); }
386
+ .tool-details, .tool-flow { margin-top:22px; }
375
387
  .tool-details summary, .tool-flow h3 { color:var(--heading); font-size:12px; }
376
388
  .device-code { display:block; color:var(--accent); font-size:23px; letter-spacing:.1em; margin:16px 0; }
377
389
  .tool-link { display:inline-flex; min-height:36px; align-items:center; color:var(--accent); margin-right:16px; }
@@ -381,3 +393,55 @@ input[role="switch"]:disabled { opacity: .5; cursor: wait; }
381
393
  .checks-table th:nth-child(2) { width:21%; }
382
394
  .checks-table details p { margin:8px 0; }
383
395
  @media(max-width:640px) { .account-fields { grid-template-columns:100px minmax(0,1fr); gap:10px; } .checks-table { min-width:530px; } }
396
+
397
+ .account-summary { margin: 20px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 20px; }
398
+ .account-summary div { min-width: 0; }
399
+ .account-summary dt { color: var(--muted); font-size: 11px; margin-bottom: 7px; }
400
+ .account-summary dd { margin: 0; font-size: 12px; }
401
+ .account-summary .state-label { gap: 6px; }
402
+ .source-account-actions { margin-top: 18px; }
403
+ @media(max-width:640px) { .account-summary { grid-template-columns:1fr; } }
404
+
405
+ .flow-network { position:relative;display:grid;grid-template-columns:minmax(130px,1fr) 100px minmax(170px,1.2fr);column-gap:clamp(36px,6vw,92px);align-items:center;min-height:216px;margin:26px 0 18px;padding:4px 0; }
406
+ .flow-wires { position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible; }
407
+ .flow-column,.flow-hub-column { position:relative;min-width:0; }
408
+ .flow-column-title { margin:0 0 20px;color:var(--muted);font-size:11px; }
409
+ .flow-node { display:grid;grid-template-columns:minmax(0,max-content) auto;align-items:center;gap:4px 10px;min-height:65px; }
410
+ .flow-choice { justify-self:start;max-width:100%;min-height:34px;padding:7px 9px;border-color:transparent;background:transparent;color:var(--text);font-size:12px;font-weight:600;text-transform:none;text-align:left;overflow-wrap:anywhere; }
411
+ .flow-choice:hover { background:var(--option-hover); }
412
+ .flow-choice[aria-pressed="true"],.flow-choice[aria-pressed="true"]:hover { color:var(--page);background:var(--accent);border-color:var(--accent); }
413
+ .flow-count { justify-self:end;color:var(--strong);font-size:12px;font-variant-numeric:tabular-nums; }
414
+ .flow-note { grid-column:1/-1;margin:0 0 14px 9px;color:var(--muted);font-size:10px; }
415
+ .flow-source { color:var(--muted);font-size:10px;margin:14px 0 10px 9px; }
416
+ .flow-source:first-child { margin-top:0; }
417
+ .flow-node[data-related="false"] { opacity:.5; }
418
+ #flow-hub { display:flex;flex-direction:column;align-items:center;gap:9px;width:100%;border:0;background:var(--surface);color:var(--text);padding:10px 0;text-transform:none; }
419
+ #flow-hub:hover { color:var(--accent); }
420
+ .flow-logo { width:34px;height:34px;color:var(--accent); }
421
+ #flow-hub small { font-size:10px;font-weight:400;color:var(--muted);white-space:normal; }
422
+ .flow-caption { display:flex;align-items:center;flex-wrap:wrap;gap:10px 16px;min-height:30px;font-size:11px;color:var(--muted); }
423
+ .flow-caption button { padding:5px 9px; }
424
+ .flow-wire { fill:none;stroke:var(--border);stroke-width:1;stroke-linecap:round;stroke-linejoin:round; }
425
+ .flow-live { stroke:var(--accent);opacity:.55; }
426
+ .flow-dim { opacity:.35; }
427
+ .flow-packet,.flow-wait { fill:var(--accent); }
428
+ .flow-packet { offset-distance:100%;animation:flow-travel 2.4s linear infinite; }
429
+ #request-flow[data-paused="true"] .flow-packet,#request-flow[data-paused="true"] #flow-state::before { animation-play-state:paused; }
430
+ #request-flow[data-state="idle"] #flow-state { display:inline-flex;align-items:center;gap:9px; }
431
+ #request-flow[data-state="idle"] #flow-state::before { content:"";width:4px;height:4px;border-radius:50%;background:var(--accent);box-shadow:0 0 10px 3px color-mix(in srgb,var(--accent) 25%,transparent);animation:flow-breathe 3.2s ease-in-out infinite; }
432
+ @keyframes flow-travel { from { offset-distance:100%; } to { offset-distance:0%; } }
433
+ @keyframes flow-breathe { 0%,100% { opacity:.45; } 50% { opacity:1; } }
434
+ @media(max-width:760px) {
435
+ .flow-network { grid-template-columns:minmax(105px,1fr) 66px minmax(120px,1fr);column-gap:18px; }
436
+ .flow-choice { font-size:11px;padding-inline:4px; }
437
+ .flow-node { column-gap:4px; }
438
+ .flow-source,.flow-note { margin-left:4px; }
439
+ }
440
+ @media(max-width:460px) {
441
+ .flow-network { grid-template-columns:minmax(80px,1fr) 48px minmax(100px,1fr);column-gap:12px; }
442
+ .flow-column-title,.flow-source,.flow-note,#flow-hub small { font-size:9px; }
443
+ .flow-node { grid-template-columns:minmax(0,1fr) auto; }
444
+ .flow-count { font-size:10px; }
445
+ .flow-logo { width:26px;height:26px; }
446
+ }
447
+ @media(prefers-reduced-motion:reduce) { .flow-packet,#request-flow[data-state="idle"] #flow-state::before { animation:none; } }
@@ -15,8 +15,9 @@ const text = (id, key, values) => { localize(element(id), key, values); };
15
15
  const finite = (value) => value !== null && value !== undefined && Number.isFinite(Number(value));
16
16
  const number = (value) => finite(value) ? Math.max(0, Math.round(Number(value))).toLocaleString() : "—";
17
17
  const mib = (value) => finite(value) ? `${(Number(value) / 1048576).toFixed(1)} MiB` : "—";
18
- const viewHelpers = { element, phrase, localize, text, finite, number, mib, tableRow, emptyTable, document, navigator: globalThis.navigator,
19
- motionAllowed: () => !reducedMotion.matches && document.visibilityState === "visible" && element("usage-analytics").open && element("model-usage").open && !element("model-usage").closest("[hidden]") };
18
+ const time = (value, options) => globalThis.ccdxTime?.format(value, options) ?? (value ? new Date(value).toLocaleTimeString() : "—");
19
+ const viewHelpers = { time, element, phrase, localize, text, finite, number, mib, tableRow, emptyTable, document, navigator: globalThis.navigator,
20
+ motionAllowed: () => !reducedMotion.matches && document.visibilityState === "visible" && element("usage-analytics").open && !element("usage-analytics").closest("[hidden]") };
20
21
  const { render, renderProviders, renderFailures, renderContext } = globalThis.ccdxDashboardStatus.create(viewHelpers);
21
22
  const usageView = globalThis.ccdxDashboardUsage.create(viewHelpers);
22
23
  const { applyUsage, renderUsageState, renderAnalytics, renderUsageTable, selectUsageDay } = usageView;
@@ -36,186 +37,14 @@ element("refresh").addEventListener("click", () => {
36
37
  dashboardRefresh.refreshVisible({ force: true });
37
38
  });
38
39
 
39
- const animationRows = new Map();
40
- let animationTimelines = [];
41
- let savedAnimation = "";
42
- let selectedAnimation = "";
43
- let previewDisabledByEnvironment = false;
44
- let previewVisible = false;
45
- let previewTimer = null;
46
- let previewStarted = 0;
47
- let animationSaving = false;
48
- let animationFramesLoaded = false;
49
40
  const reducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)");
50
-
51
- function renderAnsiFrame(target, frame) {
52
- const fragments = String(frame).split(/\u001b\[([0-9;]+)m/);
53
- const content = document.createDocumentFragment();
54
- let color = "";
55
- for (let index = 0; index < fragments.length; index += 2) {
56
- if (fragments[index]) {
57
- const span = document.createElement("span");
58
- span.className = color;
59
- span.textContent = fragments[index];
60
- content.append(span);
61
- }
62
- const code = fragments[index + 1];
63
- color = code === "97" ? "ansi-white"
64
- : /^38;5;(159|123|87|51|45|39|33)$/.test(code || "") ? `ansi-${code.slice(5)}` : "";
65
- }
66
- target.replaceChildren(content);
67
- }
68
-
69
- function renderAnimationFrames(elapsed) {
70
- for (const timeline of animationTimelines) {
71
- const position = timeline.id === selectedAnimation ? elapsed % timeline.duration : 0;
72
- const frameIndex = timeline.frames.findIndex(({ until }) => position < until);
73
- if (frameIndex === timeline.lastFrame) continue;
74
- timeline.lastFrame = frameIndex;
75
- renderAnsiFrame(timeline.target, frameIndex < 0 ? `[${" ".repeat(20)}]` : timeline.frames[frameIndex].ansi);
76
- }
77
- }
78
-
79
- function stopAnimationPreview() {
80
- if (previewTimer !== null) clearTimeout(previewTimer);
81
- previewTimer = null;
82
- }
83
-
84
- function tickAnimationPreview() {
85
- previewTimer = null;
86
- if (!animationTimelines.length || !element("animation-settings").open || element("animation-settings").closest("[hidden]") || !previewVisible || document.visibilityState !== "visible" || reducedMotion.matches || previewDisabledByEnvironment) return;
87
- renderAnimationFrames(performance.now() - previewStarted);
88
- previewTimer = setTimeout(tickAnimationPreview, 32);
89
- }
90
-
91
- function syncAnimationPreview() {
92
- stopAnimationPreview();
93
- if (!animationTimelines.length || !element("animation-settings").open || element("animation-settings").closest("[hidden]") || !previewVisible || document.visibilityState !== "visible" || reducedMotion.matches || previewDisabledByEnvironment) {
94
- for (const timeline of animationTimelines) timeline.lastFrame = -2;
95
- renderAnimationFrames(0);
96
- return;
97
- }
98
- previewStarted = performance.now();
99
- tickAnimationPreview();
100
- }
101
-
102
- new IntersectionObserver(([entry]) => {
103
- previewVisible = entry.isIntersecting;
104
- syncAnimationPreview();
105
- }).observe(element("animation-options"));
106
- document.addEventListener("visibilitychange", syncAnimationPreview);
107
- reducedMotion.addEventListener("change", syncAnimationPreview);
41
+ const animationView = globalThis.ccdxDashboardAnimation.create({ element, phrase, localize, text, reducedMotion,
42
+ getRefresh: () => dashboardRefresh, document });
43
+ const { apply: applyAnimation, load: loadAnimation, save: saveAnimation, sync: syncAnimationPreview, stop: stopAnimationPreview } = animationView;
108
44
  reducedMotion.addEventListener("change", () => { if (reducedMotion.matches) usageView.stopMotion(); });
109
45
  document.addEventListener("visibilitychange", () => { if (document.visibilityState !== "visible") usageView.stopMotion(); });
110
46
  new IntersectionObserver(([entry]) => usageView.setChartVisible(entry.isIntersecting)).observe(element("daily-bars"));
111
47
 
112
- function buildAnimationOptions(data) {
113
- const container = element("animation-options");
114
- container.replaceChildren();
115
- animationRows.clear();
116
- animationTimelines = [];
117
- savedAnimation = data.theme;
118
- selectedAnimation = data.theme;
119
- previewDisabledByEnvironment = data.disabled_by_environment === true;
120
- for (const [index, theme] of data.themes.entries()) {
121
- const option = document.createElement("button");
122
- option.type = "button";
123
- option.className = "theme-option";
124
- option.setAttribute("aria-pressed", String(theme.id === data.theme));
125
- option.addEventListener("click", () => {
126
- selectedAnimation = theme.id;
127
- for (const [id, row] of animationRows) row.setAttribute("aria-pressed", String(id === theme.id));
128
- element("save-animation").disabled = selectedAnimation === savedAnimation;
129
- updateAnimationState();
130
- syncAnimationPreview();
131
- });
132
- const name = document.createElement("span");
133
- name.className = "theme-name";
134
- const label = document.createElement("span");
135
- localize(label, "index_theme", { index: String(index + 1).padStart(2, "0"), theme: phrase(theme.label) });
136
- name.append(label);
137
- if (theme.default) {
138
- const marker = document.createElement("small");
139
- localize(marker, "default");
140
- name.append(marker);
141
- }
142
- const preview = document.createElement("span");
143
- preview.className = "theme-preview";
144
- preview.setAttribute("aria-hidden", "true");
145
- option.append(name, preview);
146
- container.append(option);
147
- animationRows.set(theme.id, option);
148
- let until = 0;
149
- const frames = theme.frames.map((frame) => {
150
- until += frame.delay_ms;
151
- return { ansi: frame.ansi, until };
152
- });
153
- animationTimelines.push({ id: theme.id, target: preview, frames, duration: until + theme.loop_pause_ms, lastFrame: -2 });
154
- }
155
- element("save-animation").disabled = true;
156
- syncAnimationPreview();
157
- }
158
-
159
- function animationNote(data) {
160
- return data.disabled_by_environment
161
- ? "disabled_by_ccdx_terminal_animation_saved_choice_applies_after_o"
162
- : "saved_choice_applies_to_the_running_terminal";
163
- }
164
-
165
- function loadAnimation(options) {
166
- if (!animationSaving) return dashboardRefresh.refresh("animation", options);
167
- }
168
-
169
- function applyAnimation(data, { changed } = {}) {
170
- if (changed === false) { updateAnimationState(); return; }
171
- if (!animationFramesLoaded && data.themes.some(theme => theme.frames)) {
172
- buildAnimationOptions(data);
173
- animationFramesLoaded = true;
174
- } else {
175
- const dirty = selectedAnimation && selectedAnimation !== savedAnimation;
176
- savedAnimation = data.theme;
177
- if (!dirty) selectedAnimation = data.theme;
178
- previewDisabledByEnvironment = data.disabled_by_environment === true;
179
- for (const [id, row] of animationRows) row.setAttribute("aria-pressed", String(id === selectedAnimation));
180
- element("save-animation").disabled = selectedAnimation === savedAnimation;
181
- syncAnimationPreview();
182
- }
183
- updateAnimationState();
184
- text("animation-note", animationNote(data));
185
- }
186
-
187
- function updateAnimationState() {
188
- text("animation-state", "current_theme_unsaved", { theme: phrase(savedAnimation.toUpperCase()), unsaved: selectedAnimation !== savedAnimation ? phrase("unsaved") : "" });
189
- }
190
-
191
- async function saveAnimation() {
192
- const button = element("save-animation");
193
- if (!selectedAnimation || selectedAnimation === savedAnimation) return;
194
- animationSaving = true;
195
- dashboardRefresh.invalidate("animation");
196
- button.disabled = true;
197
- text("animation-note", "saving");
198
- try {
199
- const response = await fetch("/_ccdx/ui/animation", {
200
- method: "POST",
201
- headers: { "Content-Type": "application/json", "X-CCDX-Dashboard": "1" },
202
- body: JSON.stringify({ theme: selectedAnimation }),
203
- signal: AbortSignal.timeout(8000),
204
- });
205
- const data = await response.json();
206
- if (!response.ok) throw new Error(data.error || `HTTP ${response.status}`);
207
- savedAnimation = data.theme;
208
- updateAnimationState();
209
- text("animation-note", animationNote(data));
210
- } catch (error) {
211
- text("animation-note", "not_saved_error", { error: String(error.message || error).slice(0, 150) });
212
- } finally {
213
- animationSaving = false;
214
- button.disabled = selectedAnimation === savedAnimation;
215
- loadAnimation({ force: true });
216
- }
217
- }
218
-
219
48
  function emptyTable(bodyId, columns, message) {
220
49
  const body = element(bodyId);
221
50
  body.replaceChildren();
@@ -268,10 +97,10 @@ function chooseProvider(id) {
268
97
  dashboardRefresh.invalidate("models", { clear: true });
269
98
  const previous = modelSnapshots.get(id);
270
99
  if (previous) applyModels(previous, { changed: true });
271
- else { emptyTable("live-models-body", 6, "reading_provider_catalog");text("models-note", "reading_provider_catalog"); }
100
+ else { emptyTable("live-models-body", 3, "reading_provider_catalog");text("models-note", "reading_provider_catalog"); }
272
101
  element("live-models-body").setAttribute("aria-labelledby", `model-provider-${id}`);
273
102
  window.dispatchEvent(new CustomEvent("ccdx:source-view"));
274
- void loadModels();
103
+ if (!element("upstream-models").closest("[hidden]")) void loadModels();
275
104
  }
276
105
 
277
106
  function syncProviderDetails() {
@@ -285,18 +114,18 @@ function applyProviders(data, { changed }) {
285
114
  let reloadModels = false;
286
115
  const previous = new Map(providerEntries.map(entry => [entry.id, JSON.stringify([entry.generation, entry.auth?.account])]));
287
116
  providerEntries = data.providers;
288
- if (sourceChoicesChanged) window.dispatchEvent(new CustomEvent("ccdx:providers"));
289
117
  for (const [id] of modelSnapshots) {
290
118
  const provider = providerEntries.find(entry => entry.id === id);
291
119
  if (!provider) {
292
120
  modelSnapshots.delete(id);
293
- if (id === selectedProvider) { reloadModels = true;dashboardRefresh.invalidate("models", { clear: true });emptyTable("live-models-body", 6, "reading_provider_catalog"); }
121
+ if (id === selectedProvider) { reloadModels = true;dashboardRefresh.invalidate("models", { clear: true });emptyTable("live-models-body", 3, "reading_provider_catalog"); }
294
122
  }
295
123
  }
296
124
  for (const provider of providerEntries) {
297
125
  if (previous.has(provider.id) && previous.get(provider.id) !== JSON.stringify([provider.generation, provider.auth?.account])) {
298
126
  modelSnapshots.delete(provider.id);
299
- if (provider.id === selectedProvider) { reloadModels = true;dashboardRefresh.invalidate("models", { clear: true });emptyTable("live-models-body", 6, "reading_provider_catalog"); }
127
+ if (dashboardRefresh.state("models").attemptVariant === provider.id) dashboardRefresh.invalidate("models", { clear: true });
128
+ if (provider.id === selectedProvider) { reloadModels = true;dashboardRefresh.invalidate("models", { clear: true });emptyTable("live-models-body", 3, "reading_provider_catalog"); }
300
129
  }
301
130
  }
302
131
  if (changed || dashboardRefresh.state("auth").error) renderProviders(data);
@@ -324,25 +153,52 @@ function applyProviders(data, { changed }) {
324
153
  button.textContent = provider.name;button.setAttribute("aria-selected", String(provider.id === selectedProvider));button.tabIndex = provider.id === selectedProvider ? 0 : -1;
325
154
  }
326
155
  element("live-models-body").setAttribute("aria-labelledby", `model-provider-${selectedProvider}`);
327
- if (wasInitialized && (reloadModels || selectedProvider !== previousSelection)) { dashboardRefresh.invalidate("models", { clear: true });void loadModels(); }
156
+ if (sourceChoicesChanged) window.dispatchEvent(new CustomEvent("ccdx:providers"));
157
+ if ((!wasInitialized || reloadModels || selectedProvider !== previousSelection) && !element("upstream-models").closest("[hidden]")) { dashboardRefresh.invalidate("models", { clear: true });void loadModels(); }
328
158
  }
329
159
 
330
- async function loadModels() { return dashboardRefresh.refresh("models", { force: true }); }
160
+ function catalogProvider() {
161
+ return element("source-provider").closest('[data-view="codex"]')?.hidden === false ? element("source-provider").value : selectedProvider;
162
+ }
163
+ function refreshCatalog({ force = false } = {}) {
164
+ const entry = dashboardRefresh.state("models");
165
+ if (entry.attemptVariant && entry.attemptVariant !== catalogProvider()) dashboardRefresh.invalidate("models", { clear: true });
166
+ return dashboardRefresh.refresh("models", { force });
167
+ }
168
+ async function readModelCatalog(provider) {
169
+ const data = await refreshCatalog();
170
+ const entry = dashboardRefresh.state("models");
171
+ if (entry.attemptVariant === provider && entry.error) throw entry.error;
172
+ if (!data || data.provider !== provider) throw new Error("Model list unavailable");
173
+ return data;
174
+ }
175
+ async function loadModels() { return refreshCatalog({ force: true }); }
331
176
 
332
177
  function applyModels(data, { changed }) {
178
+ modelSnapshots.set(data.provider || selectedProvider, data);
333
179
  if (data.provider && data.provider !== selectedProvider) return;
334
- modelSnapshots.set(selectedProvider, data);
335
180
  if (changed) {
336
- const body = element("live-models-body");body.replaceChildren();
181
+ const body = element("live-models-body");
182
+ const expanded = new Set([...body.querySelectorAll("details[open]")].map(node => node.dataset.model));
183
+ body.replaceChildren();
337
184
  for (const model of data.models) {
338
185
  const clients = (model.clients || []).map(id => ({ codex: "Codex App", claude_app: "Claude App", claude_code: "Claude Code" })[id] || id).join(" / ") || "—";
339
- body.append(tableRow([model.id, model.vendor, model.endpoints.join(" / "), clients,
340
- model.reasoning_efforts === null || model.reasoning_efforts === undefined ? "—" : model.reasoning_efforts.join(" / ") || "—",
341
- model.preview ? "preview" : model.state || "listed"], { labels: [5] }));
186
+ const row = tableRow([model.id, clients, ""]);row.children[0].className = "model-name";
187
+ const details = document.createElement("details"), summary = document.createElement("summary"), fields = document.createElement("dl");
188
+ details.dataset.model = model.id;details.open = expanded.has(model.id);fields.className = "failure-detail";
189
+ localize(summary, "model_details");details.append(summary, fields);
190
+ for (const [key, value, translated] of [["vendor", model.vendor || "—"], ["api", model.endpoints.join(" / ") || "—"],
191
+ ["reasoning", model.reasoning_efforts?.join(" / ") || "—"], ["state", model.preview ? "preview" : model.state || "listed", true],
192
+ ["model_window", number(model.context_window)]]) {
193
+ const term = document.createElement("dt"), detail = document.createElement("dd");localize(term, key);
194
+ if (translated) localize(detail, value);else detail.textContent = value;
195
+ fields.append(term, detail);
196
+ }
197
+ row.children[2].append(details);body.append(row);
342
198
  }
343
- if (!data.models.length) emptyTable("live-models-body", 6, "no_models_advertised");
199
+ if (!data.models.length) emptyTable("live-models-body", 3, "no_models_advertised");
344
200
  }
345
- text("models-note", "selectable_selectable_advertised_advertised_host_time", { selectable: number(data.selectable), advertised: number(data.advertised), host: data.upstream_host, time: data.checked_at ? new Date(data.checked_at).toLocaleTimeString() : phrase("unknown") });
201
+ text("models-note", "selectable_selectable_advertised_advertised_host_time", { selectable: number(data.selectable), advertised: number(data.advertised), host: data.upstream_host, time: data.checked_at ? time(data.checked_at) : phrase("unknown") });
346
202
  }
347
203
 
348
204
  async function loadUsage() { return dashboardRefresh.refresh("usage", { force: true }); }
@@ -358,9 +214,9 @@ async function readDashboard(url, { signal, timeout = 15000, source } = {}) {
358
214
  }
359
215
 
360
216
  function refreshTime(target, state) {
361
- const time = state.updatedAt === null ? null : new Date(state.updatedAt).toLocaleTimeString();
362
- if (state.error) localize(target, time ? "update_failed_last_time" : "update_failed", { time });
363
- else if (time) localize(target, "updated_time", { time });
217
+ const updated = state.updatedAt === null ? null : time(state.updatedAt);
218
+ if (state.error) localize(target, updated ? "update_failed_last_time" : "update_failed", { time: updated });
219
+ else if (updated) localize(target, "updated_time", { time: updated });
364
220
  }
365
221
 
366
222
  const timestamps = new Map();
@@ -399,6 +255,7 @@ const dashboardRefresh = globalThis.ccdxRefresh.createController({
399
255
  apply: render,
400
256
  state: state => {
401
257
  if (state.error || !state.value) globalThis.ccdxDashboardActivity?.unavailable();
258
+ if (state.error || !state.value) globalThis.ccdxDashboardFlow?.unavailable();
402
259
  text("connection", state.pending && !state.value ? "reading" : state.error ? "unavailable_eb0be" : "service_reachable");
403
260
  element("connection").className = `badge ${state.pending ? "neutral" : state.error ? "bad" : "good"}`;
404
261
  globalThis.ccdxIcons?.set(element("connection"), state.pending && !state.value ? "reading" : state.error ? "unavailable_eb0be" : "service_reachable",
@@ -413,15 +270,15 @@ const dashboardRefresh = globalThis.ccdxRefresh.createController({
413
270
  apply: applyProviders,
414
271
  state: state => {
415
272
  if (state.error) {
416
- if (state.value) localize(element("source-status-note"), "update_failed_last_time", { time: new Date(state.updatedAt).toLocaleTimeString() });
273
+ if (state.value) localize(element("source-status-note"), "update_failed_last_time", { time: time(state.updatedAt) });
417
274
  else text("source-status-note", "unavailable_eb0be");
418
275
  } else element("source-status-note").textContent = "";
419
276
  for (const node of timestamps.get("auth")) refreshTime(node, state);
420
277
  },
421
278
  },
422
279
  models: {
423
- visible: () => providerEntries.length > 0 && element("upstream-models").open && !element("upstream-models").closest("[hidden]"),
424
- variant: () => selectedProvider,
280
+ visible: () => providerEntries.length > 0 && (element("source-provider").closest('[data-view="codex"]')?.hidden === false || element("upstream-models").open && !element("upstream-models").closest("[hidden]")),
281
+ variant: catalogProvider,
425
282
  load: async ({ signal, variant }) => {
426
283
  if (!variant) throw new Error("reading_provider_catalog");
427
284
  const data = await readDashboard(`/_ccdx/ui/models/live?provider=${encodeURIComponent(variant)}`, { signal, source: ["live", "catalog"] });
@@ -431,6 +288,7 @@ const dashboardRefresh = globalThis.ccdxRefresh.createController({
431
288
  project: data => [data.provider, data.models, data.selectable, data.advertised, data.upstream_host],
432
289
  apply: applyModels,
433
290
  state: state => {
291
+ if (state.attemptVariant !== selectedProvider) return;
434
292
  element("refresh-models").disabled = Boolean(state.pending);
435
293
  text("models-state", state.pending ? "checking_live" : state.error ? "live_lookup_failed" : state.value?.source === "catalog" ? "catalog_snapshot" : "live_snapshot");
436
294
  element("model-check-details").hidden = !state.error;
@@ -438,8 +296,8 @@ const dashboardRefresh = globalThis.ccdxRefresh.createController({
438
296
  const message = String(state.error.message || state.error).slice(0, 240);
439
297
  const httpError = /^Live model lookup failed \(HTTP (\d{3})\)\. Run ccdx models for details\.$/.exec(message);
440
298
  const sourceReason = /^Model catalog unavailable \/ (m365_[a-z0-9_]+)$/.exec(message);
441
- const diagnostic = state.error.diagnostic || {}, network = diagnostic.network;
442
- const reason = network ? phrase(`network_cause_${network.cause_code}`) : httpError ? phrase("live_model_lookup_failed_http_status_run_ccdx_models_for_details", { status: httpError[1] })
299
+ const diagnostic = state.error.diagnostic || {}, network = diagnostic.network, catalog = diagnostic.catalog;
300
+ const reason = catalog ? phrase(`catalog_cause_${catalog.cause_code}`) : network ? phrase(`network_cause_${network.cause_code}`) : httpError ? phrase("live_model_lookup_failed_http_status_run_ccdx_models_for_details", { status: httpError[1] })
443
301
  : sourceReason ? phrase("source_catalog_unavailable", { code: sourceReason[1] }) : phrase(message);
444
302
  const source = providerEntries.find(entry => entry.id === selectedProvider)?.name || selectedProvider;
445
303
  const previous = modelSnapshots.get(selectedProvider);
@@ -447,13 +305,13 @@ const dashboardRefresh = globalThis.ccdxRefresh.createController({
447
305
  element("models-note").replaceChildren();
448
306
  const summary = document.createElement("span"), kept = document.createElement("span");
449
307
  localize(summary, "source_check_failed", { source });
450
- localize(kept, previous?.checked_at ? "source_check_previous" : "source_check_none", { time: previous?.checked_at ? new Date(previous.checked_at).toLocaleTimeString() : "" });
308
+ localize(kept, previous?.checked_at ? "source_check_previous" : "source_check_none", { time: previous?.checked_at ? time(previous.checked_at) : "" });
451
309
  element("models-note").append(summary, document.createElement("br"), kept);
452
310
  const fields = element("model-check-fields");fields.replaceChildren();
453
311
  for (const [key, value] of [["source", source], ["source_check_time", diagnostic.checked_at], ["source_check_reason", reason],
454
312
  ["network_route_source", network ? phrase(`network_source_${network.source}`) : null],
455
313
  ["network_failure_stage", network ? phrase(`network_stage_${network.stage}`) : null],
456
- ["network_cause_code", network?.cause_code], ["http_status", diagnostic.http_status]]) {
314
+ ["network_cause_code", network?.cause_code], ["http_status", catalog?.http_status || diagnostic.http_status], ["last_success", catalog?.last_success_at], ["upstream_request_id", catalog?.request_id]]) {
457
315
  if (value === null || value === undefined || value === "") continue;
458
316
  const term = document.createElement("dt"), detail = document.createElement("dd");localize(term, key);
459
317
  if (value?.key) localize(detail, value.key, value.values);else detail.textContent = String(value).slice(0, 300);
@@ -462,17 +320,17 @@ const dashboardRefresh = globalThis.ccdxRefresh.createController({
462
320
  if (Number.isFinite(diagnostic.retry_after_ms) && diagnostic.retry_after_ms > 0) {
463
321
  const term = document.createElement("dt"), detail = document.createElement("dd");localize(term, "retry");
464
322
  const checked = Date.parse(diagnostic.checked_at);
465
- if (Number.isFinite(checked)) { localize(detail, "source_retry_time", { time: new Date(checked + diagnostic.retry_after_ms).toLocaleTimeString() });fields.append(term, detail); }
323
+ if (Number.isFinite(checked)) { localize(detail, "source_retry_time", { time: time(checked + diagnostic.retry_after_ms) });fields.append(term, detail); }
466
324
  }
467
325
  }
468
- if (state.error && !modelSnapshots.has(selectedProvider)) emptyTable("live-models-body", 6, "no_catalog_available");
326
+ if (state.error && !modelSnapshots.has(selectedProvider)) emptyTable("live-models-body", 3, "no_catalog_available");
469
327
  for (const node of timestamps.get("models")) refreshTime(node, state);
470
328
  },
471
329
  },
472
330
  usage: {
473
- visible: () => element("model-usage").open && !element("model-usage").closest("[hidden]"),
331
+ visible: () => (element("model-usage").open || element("usage-analytics").open) && !element("model-usage").closest("[hidden]"),
474
332
  variant: () => {
475
- const mode = ((element("model-usage").open && element("usage-analytics").open) || Boolean(usageView.selectedDate)) ? "analytics" : "summary";
333
+ const mode = (element("usage-analytics").open || Boolean(usageView.selectedDate)) ? "analytics" : "summary";
476
334
  const provider = element("usage-provider")?.value || "";
477
335
  return mode + (provider ? `:${provider}` : "");
478
336
  },
@@ -501,8 +359,8 @@ const dashboardRefresh = globalThis.ccdxRefresh.createController({
501
359
  },
502
360
  },
503
361
  animation: {
504
- visible: () => element("animation-settings").open && !element("animation-settings").closest("[hidden]") && !animationSaving,
505
- variant: () => element("animation-settings").open && !animationFramesLoaded ? "frames" : "metadata",
362
+ visible: () => element("animation-settings").open && !element("animation-settings").closest("[hidden]") && !animationView.saving,
363
+ variant: () => element("animation-settings").open && !animationView.framesLoaded ? "frames" : "metadata",
506
364
  project: data => [data.theme, data.source, data.disabled_by_environment, data.themes.map(theme => [theme.id, theme.label, theme.default, Boolean(theme.frames)])],
507
365
  load: ({ variant, signal }) => readDashboard(`/_ccdx/ui/animation${variant === "frames" ? "" : "?frames=0"}`, { signal, timeout: 8000 }),
508
366
  apply: applyAnimation,
@@ -552,7 +410,7 @@ element("animation-settings").addEventListener("toggle", () => {
552
410
  });
553
411
  element("usage-analytics").addEventListener("toggle", () => {
554
412
  if (element("usage-analytics").open) usageView.revealChart();else usageView.stopMotion();
555
- if (element("usage-analytics").open && element("model-usage").open) dashboardRefresh.refresh("usage");
413
+ if (element("usage-analytics").open) dashboardRefresh.refresh("usage");
556
414
  });
557
415
  for (const id of ["analytics-model", "analytics-range", "analytics-metric", "analytics-view"]) element(id).addEventListener("change", () => {
558
416
  renderAnalytics();
@@ -24,7 +24,7 @@ try {
24
24
  sh "$ccdx_install_dir/install.sh"
25
25
  )`;
26
26
  }
27
- function create({ element, localize, navigator }) {
27
+ function create({ time = value => new Date(value).toLocaleString(), element, localize, navigator }) {
28
28
  let snapshot = null, platform = "macos";
29
29
  const date = value => typeof value === "string" && Number.isFinite(Date.parse(value)) ? value.slice(0, 10) : null;
30
30
  function install() {
@@ -46,8 +46,8 @@ try {
46
46
  localize(element("update-latest-date"), latestDate ? "released_date" : "release_date_unknown", { date: latestDate });
47
47
  localize(element("update-state"), checked ? data.update_available ? "new_version_available" : "already_latest" : data.status === "rate_limited" ? "update_rate_limited" : "update_check_failed");
48
48
  element("update-command-row").hidden = checked && !data.update_available;
49
- const time = typeof data.checked_at === "string" && Number.isFinite(Date.parse(data.checked_at)) ? new Date(data.checked_at).toLocaleString() : "—";
50
- localize(element("update-checked"), checked ? "update_checked_time" : "update_attempted_time", { time });
49
+ const checkedTime = typeof data.checked_at === "string" && Number.isFinite(Date.parse(data.checked_at)) ? time(data.checked_at, { date: true }) : "—";
50
+ localize(element("update-checked"), checked ? "update_checked_time" : "update_attempted_time", { time: checkedTime });
51
51
  install();
52
52
  }
53
53
  function state(value) {