dsh-agent-control-center 0.1.0 → 0.3.0
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.
- package/CHANGELOG.md +116 -0
- package/README.md +217 -83
- package/README.zh.md +159 -58
- package/client.js +7660 -2005
- package/cordis.patch.yml +5 -0
- package/docs/01-CONTRACT.md +3 -2
- package/docs/05-ACCEPTANCE-EVIDENCE.md +81 -0
- package/docs/06-UX-OPTIMIZATION.md +57 -0
- package/docs/07-GUIDE.md +327 -0
- package/docs/08-COMPATIBILITY.md +202 -0
- package/docs/09-ARCHITECTURE.md +333 -0
- package/docs/ROADMAP.md +448 -0
- package/index.js +67 -2
- package/lib/core/cache.js +277 -0
- package/lib/core/compat.js +877 -0
- package/lib/core/errors.js +14 -1
- package/lib/core/http.js +22 -0
- package/lib/core/index.js +53 -2
- package/lib/core/paths.js +6 -0
- package/lib/core/registry.js +21 -5
- package/lib/core/util.js +4 -1
- package/lib/modules/a-agents.js +104 -4
- package/lib/modules/b-tools.js +169 -26
- package/lib/modules/f-diagnostics.js +109 -17
- package/lib/modules/g-templates.js +18 -0
- package/lib/modules/i-recovery.js +84 -23
- package/lib/modules/j-instruction.js +624 -0
- package/lib/modules/k-export.js +540 -0
- package/package.json +1 -1
- package/scripts/release.mjs +81 -0
- package/scripts/verify.mjs +12 -0
- package/src/client/app.js +684 -118
- package/src/client/i18n/agents.js +96 -0
- package/src/client/i18n/common.js +36 -0
- package/src/client/i18n/diagnostics.js +52 -0
- package/src/client/i18n/export.js +174 -0
- package/src/client/i18n/instruction.js +236 -0
- package/src/client/i18n/meta.js +72 -0
- package/src/client/i18n/overview.js +38 -0
- package/src/client/i18n/recovery.js +66 -0
- package/src/client/i18n/sessions.js +64 -0
- package/src/client/i18n/templates.js +88 -0
- package/src/client/i18n/tools.js +96 -0
- package/src/client/i18n/usage.js +42 -0
- package/src/client/kernel.js +327 -40
- package/src/client/pages/agents.js +637 -354
- package/src/client/pages/diagnostics.js +526 -177
- package/src/client/pages/export.js +664 -0
- package/src/client/pages/instruction.js +648 -0
- package/src/client/pages/meta.js +553 -193
- package/src/client/pages/overview.js +255 -34
- package/src/client/pages/recovery.js +332 -131
- package/src/client/pages/sessions.js +470 -307
- package/src/client/pages/templates.js +691 -381
- package/src/client/pages/tools.js +559 -206
- package/src/client/pages/usage.js +235 -57
package/src/client/app.js
CHANGED
|
@@ -5,122 +5,585 @@
|
|
|
5
5
|
* ------------------------------------------------------------------------- */
|
|
6
6
|
|
|
7
7
|
ACC.CSS = `
|
|
8
|
-
/* Every colour, radius and
|
|
9
|
-
* host's light values so a missing variable still renders
|
|
10
|
-
* branch is needed: the host overrides the same
|
|
11
|
-
|
|
8
|
+
/* Every colour, radius, font and easing comes from the host theme; the
|
|
9
|
+
* fallbacks are the host's light values so a missing variable still renders
|
|
10
|
+
* sanely. No dark-mode branch is needed: the host overrides the same
|
|
11
|
+
* --dsw-alias-* names on <body>.
|
|
12
|
+
*
|
|
13
|
+
* Scale: 11 caption / 12 label+table / 13 body / 14 card title / 20 page title.
|
|
14
|
+
* Line height: 20 for 13px body, 22 for 14px titles, 28 for the page title.
|
|
15
|
+
* Spacing rhythm is written in px (4/8/12/16/24): the host has no spacing
|
|
16
|
+
* tokens by design.
|
|
17
|
+
*/
|
|
18
|
+
/* The palette is also declared on <body>: host dialogs portal their children
|
|
19
|
+
* outside .acc-root, and the shared form/button/table classes must keep their
|
|
20
|
+
* theme values there. The values are identical; .acc-root only wins by
|
|
21
|
+
* specificity. Alias tokens resolve on <body> itself, where the host overrides
|
|
22
|
+
* them, so both the light and the dark theme stay correct. */
|
|
23
|
+
body, .acc-root {
|
|
12
24
|
--acc-fg: var(--dsw-alias-label-primary, #0f1115);
|
|
13
25
|
--acc-fg-weak: var(--dsw-alias-label-secondary, #61666b);
|
|
14
|
-
|
|
26
|
+
/* Text roles are pulled toward the theme's own text colour so the ratio
|
|
27
|
+
* adapts to light AND dark without a dark-mode branch: on light surfaces
|
|
28
|
+
* the mix darkens, on dark surfaces it lightens. The raw semantic colours
|
|
29
|
+
* below are for borders, icons and fills only. */
|
|
30
|
+
--acc-fg-faint: color-mix(in srgb, var(--dsw-alias-label-tertiary, #81858c) 82%, var(--dsw-alias-label-primary, #0f1115));
|
|
31
|
+
--acc-fg-caption: var(--dsw-alias-label-caption, #adb2b8);
|
|
15
32
|
--acc-card: var(--dsw-alias-settings-card-fill, var(--dsw-alias-bg-layer-1, #fff));
|
|
16
33
|
--acc-card-stroke: var(--dsw-alias-settings-card-stroke, var(--dsw-alias-border-l2, rgba(0, 0, 0, .1)));
|
|
17
34
|
--acc-hover: var(--dsw-alias-interactive-bg-hover, rgba(38, 49, 72, .06));
|
|
35
|
+
--acc-active: var(--dsw-alias-interactive-bg-active, rgba(38, 49, 72, .1));
|
|
18
36
|
--acc-border: var(--dsw-alias-border-l2, rgba(0, 0, 0, .1));
|
|
37
|
+
--acc-border-strong: var(--dsw-alias-border-l4, rgba(0, 0, 0, .16));
|
|
38
|
+
--acc-selected: var(--dsw-alias-border-selected, #adb2b8);
|
|
39
|
+
/* Raw semantic colours: borders, icons, bars and tinted fills only. */
|
|
19
40
|
--acc-accent: var(--dsw-alias-state-business-primary, #4176e6);
|
|
20
41
|
--acc-danger: var(--dsw-alias-state-error-primary, #ec1313);
|
|
21
42
|
--acc-warn: var(--dsw-alias-state-warn-primary, #f59e0b);
|
|
22
43
|
--acc-success: var(--dsw-alias-state-success-primary, #22c55e);
|
|
44
|
+
/* Readable text variants of the same hues (measured, see DESIGN2.md). */
|
|
45
|
+
--acc-accent-text: color-mix(in srgb, var(--acc-accent) 70%, var(--dsw-alias-label-primary, #0f1115));
|
|
46
|
+
--acc-danger-text: color-mix(in srgb, var(--acc-danger) 70%, var(--dsw-alias-label-primary, #0f1115));
|
|
47
|
+
--acc-warn-text: color-mix(in srgb, var(--acc-warn) 55%, var(--dsw-alias-label-primary, #0f1115));
|
|
48
|
+
--acc-success-text: color-mix(in srgb, var(--acc-success) 56%, var(--dsw-alias-label-primary, #0f1115));
|
|
49
|
+
/* Primary action pair comes from the host's own button tokens, so the
|
|
50
|
+
* foreground flips with the theme (white/black) and the pair stays AA. */
|
|
51
|
+
--acc-primary-fill: var(--dsw-alias-button-primary-fill, var(--dsw-alias-label-primary, #0f1115));
|
|
52
|
+
--acc-primary-fg: var(--dsw-alias-label-primary-foreground, #fff);
|
|
53
|
+
--acc-primary-hover: var(--dsw-alias-button-primary-hover, color-mix(in srgb, var(--acc-primary-fill) 82%, var(--acc-primary-fg)));
|
|
23
54
|
--acc-mask: var(--dsw-alias-bg-mask-1, rgba(0, 0, 0, .35));
|
|
55
|
+
--acc-elev: var(--dsw-elevation-panel, 0 0 0 .5px rgba(0, 0, 0, .16), 0 3px 8px rgba(0, 0, 0, .03));
|
|
24
56
|
--acc-radius: var(--dsw-radius-md, 12px);
|
|
25
57
|
--acc-radius-sm: var(--dsw-radius-sm, 8px);
|
|
58
|
+
--acc-radius-xs: var(--dsw-radius-xs, 4px);
|
|
59
|
+
--acc-ease: var(--ds-ease-in-out, cubic-bezier(.4, 0, .2, 1));
|
|
60
|
+
--acc-fast: var(--ds-transition-duration-fast, .12s);
|
|
26
61
|
--acc-mono: var(--ds-font-family-code, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
|
|
27
62
|
--acc-font: var(--dsw-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif);
|
|
63
|
+
}
|
|
64
|
+
.acc-root {
|
|
28
65
|
color: var(--acc-fg);
|
|
29
|
-
font: var(--dsw-font-xs-13, 13px/
|
|
66
|
+
font: var(--dsw-font-xs-13, 13px/20px var(--acc-font));
|
|
67
|
+
font-variant-numeric: tabular-nums;
|
|
30
68
|
display: flex;
|
|
31
69
|
flex-direction: column;
|
|
32
70
|
gap: 16px;
|
|
71
|
+
min-width: 0;
|
|
33
72
|
/* The host settings panel already scrolls and pads its content column;
|
|
34
73
|
* only vertical rhythm belongs here (no height/overflow takeover). */
|
|
35
74
|
padding: 8px 0;
|
|
75
|
+
/* Safety net: a stray wide child must not create a page-level x-scroll.
|
|
76
|
+
* clip (unlike hidden) does not become a scroll container, so the sticky
|
|
77
|
+
* navigation still resolves against the settings column. */
|
|
78
|
+
overflow-x: clip;
|
|
79
|
+
}
|
|
80
|
+
/* The host does not set a global border-box, and portaled dialog content is
|
|
81
|
+
* outside .acc-root — match every element that carries one of our classes. */
|
|
82
|
+
.acc-root *, [class^="acc-"], [class*=" acc-"] { box-sizing: border-box; }
|
|
83
|
+
/* The colour comes from the host token so the host's pointer-modality rule
|
|
84
|
+
* (it sets --dsw-focus-ring-color: transparent) keeps suppressing mouse rings;
|
|
85
|
+
* the width/style/offset are ours because dense controls need a tight ring. */
|
|
86
|
+
.acc-root :focus-visible {
|
|
87
|
+
outline-style: solid;
|
|
88
|
+
outline-width: var(--dsw-focus-ring-width, 2px);
|
|
89
|
+
outline-color: var(--dsw-focus-ring-color, var(--acc-accent));
|
|
90
|
+
outline-offset: 1px;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* ---- header ------------------------------------------------------------- */
|
|
94
|
+
.acc-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
|
|
95
|
+
.acc-header-text { min-width: 0; flex: 1 1 260px; }
|
|
96
|
+
/* Plugin identity as a breadcrumb eyebrow; the page name owns the H2. */
|
|
97
|
+
.acc-eyebrow { display: flex; align-items: center; gap: 6px; min-width: 0; margin-bottom: 4px; color: var(--acc-fg-faint); font: 600 11px/16px var(--acc-font); letter-spacing: .04em; }
|
|
98
|
+
.acc-eyebrow-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
99
|
+
.acc-eyebrow .acc-version { height: 16px; padding: 0 5px; font-size: 10px; }
|
|
100
|
+
.acc-title { margin: 0; color: var(--acc-fg); font: 600 20px/28px var(--acc-font); letter-spacing: -.01em; }
|
|
101
|
+
.acc-subtitle { margin: 4px 0 0; color: var(--acc-fg-weak); font: var(--dsw-font-xxs-12, 12px/18px var(--acc-font)); max-width: 60ch; }
|
|
102
|
+
.acc-header-meta { display: flex; align-items: center; gap: 8px; flex: none; color: var(--acc-fg-weak); font: var(--dsw-font-xxs-12, 12px/18px var(--acc-font)); }
|
|
103
|
+
.acc-version { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border: .5px solid var(--acc-card-stroke); border-radius: 999px; background: var(--acc-card); color: var(--acc-fg-faint); font: 500 11px/1 var(--acc-font); letter-spacing: .02em; }
|
|
104
|
+
.acc-header .acc-btn-ghost { height: 24px; padding: 0 8px; font-size: 12px; color: var(--acc-fg-weak); }
|
|
105
|
+
.acc-header .acc-btn-ghost .acc-icon { width: 14px; height: 14px; }
|
|
106
|
+
|
|
107
|
+
/* ---- layout ------------------------------------------------------------- */
|
|
108
|
+
.acc-body { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
|
|
109
|
+
.acc-body-narrow { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
|
|
110
|
+
.acc-root[data-acc-layout="wide"] .acc-body { display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: 20px; align-items: start; }
|
|
111
|
+
|
|
112
|
+
/* ---- navigation: rail (wide) ------------------------------------------- */
|
|
113
|
+
.acc-nav { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
|
|
114
|
+
.acc-root[data-acc-layout="wide"] .acc-nav {
|
|
115
|
+
position: sticky;
|
|
116
|
+
top: 0;
|
|
117
|
+
align-self: start;
|
|
118
|
+
max-height: min(560px, calc(100vh - 200px));
|
|
119
|
+
overflow-y: auto;
|
|
120
|
+
overscroll-behavior: contain;
|
|
121
|
+
scrollbar-gutter: stable;
|
|
122
|
+
padding: 2px 4px 2px 0;
|
|
123
|
+
}
|
|
124
|
+
/* Section label above each rail group: 11px uppercase micro-heading. The rail
|
|
125
|
+
* is 176px, so a long English label truncates instead of wrapping; the full
|
|
126
|
+
* text stays in the DOM (accessible name) and in the title attribute. */
|
|
127
|
+
.acc-nav-group {
|
|
128
|
+
padding: 8px 8px 2px;
|
|
129
|
+
color: var(--acc-fg-faint);
|
|
130
|
+
font: 600 11px/16px var(--acc-font);
|
|
131
|
+
letter-spacing: .08em;
|
|
132
|
+
text-transform: uppercase;
|
|
133
|
+
white-space: nowrap;
|
|
134
|
+
overflow: hidden;
|
|
135
|
+
text-overflow: ellipsis;
|
|
136
|
+
}
|
|
137
|
+
.acc-nav-item {
|
|
138
|
+
position: relative;
|
|
139
|
+
display: flex;
|
|
140
|
+
align-items: center;
|
|
141
|
+
gap: 8px;
|
|
142
|
+
width: 100%;
|
|
143
|
+
min-height: 32px;
|
|
144
|
+
min-width: 0;
|
|
145
|
+
padding: 6px 8px 6px 10px;
|
|
146
|
+
border: 0;
|
|
147
|
+
border-radius: var(--acc-radius-sm);
|
|
148
|
+
background: transparent;
|
|
149
|
+
color: var(--acc-fg-weak);
|
|
150
|
+
font: 500 13px/20px var(--acc-font);
|
|
151
|
+
text-align: left;
|
|
152
|
+
cursor: pointer;
|
|
153
|
+
transition: background-color var(--acc-fast) var(--acc-ease), color var(--acc-fast) var(--acc-ease);
|
|
36
154
|
}
|
|
37
|
-
.acc-
|
|
38
|
-
.acc-
|
|
39
|
-
.acc-
|
|
40
|
-
.acc-
|
|
41
|
-
.acc-
|
|
42
|
-
.acc-
|
|
43
|
-
.acc-
|
|
44
|
-
.acc-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
.acc-nav
|
|
50
|
-
|
|
51
|
-
|
|
155
|
+
.acc-nav-item:hover { background: var(--acc-hover); color: var(--acc-fg); }
|
|
156
|
+
.acc-nav-item:active { background: var(--acc-active); }
|
|
157
|
+
.acc-nav-item.is-active { background: color-mix(in srgb, var(--acc-accent) 9%, transparent); color: var(--acc-accent-text); font-weight: 600; }
|
|
158
|
+
.acc-root[data-acc-layout="wide"] .acc-nav-item.is-active::before { content: ''; position: absolute; inset-block: 7px; inset-inline-start: 0; width: 2px; border-radius: 2px; background: var(--acc-accent); }
|
|
159
|
+
.acc-nav-icon { flex: none; color: var(--acc-fg-faint); transition: color var(--acc-fast) var(--acc-ease); }
|
|
160
|
+
.acc-nav-item:hover .acc-nav-icon { color: var(--acc-fg-weak); }
|
|
161
|
+
.acc-nav-item.is-active .acc-nav-icon { color: var(--acc-accent-text); }
|
|
162
|
+
.acc-nav-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
163
|
+
/* Module health is a short TEXT pill (WCAG 1.4.1: never colour alone): the
|
|
164
|
+
* state name is visible, the detail string is the tooltip, the tint/ink pair
|
|
165
|
+
* is the measured badge pairing. Geometry only here — the tint, border and ink
|
|
166
|
+
* come from the shared badge tones so the nav cannot drift from them. */
|
|
167
|
+
.acc-nav .acc-nav-state {
|
|
168
|
+
flex: none;
|
|
169
|
+
min-width: 0;
|
|
170
|
+
max-width: 84px;
|
|
171
|
+
height: 16px;
|
|
172
|
+
padding: 0 5px;
|
|
173
|
+
gap: 0;
|
|
174
|
+
font: 600 10px/16px var(--acc-font);
|
|
175
|
+
letter-spacing: .02em;
|
|
176
|
+
overflow: hidden;
|
|
177
|
+
text-overflow: ellipsis;
|
|
178
|
+
white-space: nowrap;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/* ---- navigation: wrapped bar (mid) ------------------------------------- */
|
|
182
|
+
.acc-nav-horizontal {
|
|
183
|
+
flex-direction: row;
|
|
184
|
+
flex-wrap: wrap;
|
|
185
|
+
align-items: center;
|
|
186
|
+
gap: 2px;
|
|
187
|
+
padding: 4px;
|
|
188
|
+
border: .5px solid var(--acc-card-stroke);
|
|
189
|
+
border-radius: var(--acc-radius);
|
|
190
|
+
background: var(--acc-card);
|
|
191
|
+
}
|
|
192
|
+
.acc-nav-horizontal .acc-nav-item { width: auto; min-height: 28px; padding: 3px 9px; font: 500 12px/18px var(--acc-font); }
|
|
193
|
+
.acc-nav-horizontal .acc-nav-item.is-active { font-weight: 600; }
|
|
194
|
+
.acc-nav-horizontal .acc-nav-icon { width: 14px; height: 14px; }
|
|
195
|
+
.acc-nav-horizontal .acc-nav-label { flex: 0 1 auto; }
|
|
196
|
+
.acc-nav-horizontal .acc-nav-state { position: static; margin-inline-start: 2px; max-width: 72px; }
|
|
197
|
+
/* A hairline marks the group boundary in the wrapped bar; the rail uses its
|
|
198
|
+
* label and the narrow select its optgroup, so this appears mid-only. */
|
|
199
|
+
.acc-nav-sep {
|
|
200
|
+
flex: none;
|
|
201
|
+
align-self: center;
|
|
202
|
+
width: 2px;
|
|
203
|
+
height: 8px;
|
|
204
|
+
margin: 0 4px;
|
|
205
|
+
border-radius: 1px;
|
|
206
|
+
background: var(--acc-border);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/* ---- navigation: dropdown (narrow) ------------------------------------- */
|
|
210
|
+
.acc-narrowbar { position: relative; display: flex; align-items: center; min-width: 0; }
|
|
211
|
+
.acc-narrowbar-icon { position: absolute; inset-inline-start: 10px; color: var(--acc-fg-faint); pointer-events: none; }
|
|
212
|
+
.acc-narrowbar .acc-select { width: 100%; padding-inline-start: 32px; }
|
|
213
|
+
|
|
214
|
+
/* ---- content ------------------------------------------------------------ */
|
|
52
215
|
.acc-content { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
|
|
53
|
-
.acc-content-inner { display: flex; flex-direction: column; gap: 16px; }
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
.acc-card
|
|
57
|
-
.acc-card-
|
|
58
|
-
.acc-card-
|
|
59
|
-
.acc-card-
|
|
60
|
-
.acc-
|
|
61
|
-
.acc-
|
|
62
|
-
.acc-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
.acc-
|
|
66
|
-
.acc-btn
|
|
216
|
+
.acc-content-inner { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
|
|
217
|
+
|
|
218
|
+
/* ---- cards -------------------------------------------------------------- */
|
|
219
|
+
.acc-card { display: flex; flex-direction: column; min-width: 0; border: .5px solid var(--acc-card-stroke); border-radius: var(--acc-radius); background: var(--acc-card); }
|
|
220
|
+
.acc-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; padding: 12px 16px; border-bottom: .5px solid var(--acc-card-stroke); }
|
|
221
|
+
.acc-card-heading { display: flex; flex-direction: column; gap: 2px; flex: 1 1 280px; min-width: 0; }
|
|
222
|
+
.acc-card-title { margin: 0; color: var(--acc-fg); font: 600 14px/22px var(--acc-font); letter-spacing: -.005em; }
|
|
223
|
+
.acc-card-subtitle { margin: 0; color: var(--acc-fg-weak); font: var(--dsw-font-xxs-12, 12px/18px var(--acc-font)); }
|
|
224
|
+
.acc-card-actions { display: flex; align-items: center; gap: 8px; flex: 0 1 auto; margin-inline-start: auto; }
|
|
225
|
+
.acc-card-body { display: flex; flex-direction: column; gap: 12px; padding: 16px; min-width: 0; }
|
|
226
|
+
|
|
227
|
+
/* ---- toolbar & buttons -------------------------------------------------- */
|
|
228
|
+
.acc-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
|
|
229
|
+
.acc-btn {
|
|
230
|
+
display: inline-flex;
|
|
231
|
+
align-items: center;
|
|
232
|
+
justify-content: center;
|
|
233
|
+
gap: 6px;
|
|
234
|
+
height: 28px;
|
|
235
|
+
min-width: 0;
|
|
236
|
+
padding: 0 10px;
|
|
237
|
+
border: 1px solid var(--acc-border);
|
|
238
|
+
border-radius: var(--acc-radius-sm);
|
|
239
|
+
background: var(--acc-card);
|
|
240
|
+
color: var(--acc-fg);
|
|
241
|
+
font: 500 13px/20px var(--acc-font);
|
|
242
|
+
white-space: nowrap;
|
|
243
|
+
cursor: pointer;
|
|
244
|
+
transition: background-color var(--acc-fast) var(--acc-ease), border-color var(--acc-fast) var(--acc-ease), color var(--acc-fast) var(--acc-ease);
|
|
245
|
+
}
|
|
246
|
+
.acc-btn:hover:not(:disabled) { background: var(--acc-hover); border-color: var(--acc-border-strong); }
|
|
247
|
+
.acc-btn:active:not(:disabled) { background: var(--acc-active); }
|
|
248
|
+
.acc-btn-icon { flex: none; }
|
|
249
|
+
.acc-btn-primary { border-color: transparent; background: var(--acc-primary-fill); color: var(--acc-primary-fg); }
|
|
250
|
+
.acc-btn-primary:hover:not(:disabled) { background: var(--acc-primary-hover); border-color: transparent; }
|
|
251
|
+
.acc-btn-primary:active:not(:disabled) { background: color-mix(in srgb, var(--acc-primary-hover) 65%, var(--acc-primary-fill)); }
|
|
252
|
+
.acc-btn-danger { border-color: color-mix(in srgb, var(--acc-danger) 40%, transparent); background: transparent; color: var(--acc-danger-text); }
|
|
253
|
+
.acc-btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--acc-danger) 8%, transparent); border-color: var(--acc-danger); }
|
|
254
|
+
.acc-btn-danger:active:not(:disabled) { background: color-mix(in srgb, var(--acc-danger) 14%, transparent); }
|
|
255
|
+
/* Disabled keeps a readable label: a neutral fill instead of fading coloured
|
|
256
|
+
* text below half contrast. */
|
|
257
|
+
.acc-btn:disabled { background: var(--acc-hover); border-color: transparent; color: var(--acc-fg-weak); opacity: 1; cursor: not-allowed; }
|
|
67
258
|
.acc-btn-ghost { border-color: transparent; background: transparent; color: var(--acc-fg-weak); }
|
|
68
|
-
.acc-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
.acc-badge
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
259
|
+
.acc-btn-ghost:hover:not(:disabled) { background: var(--acc-hover); border-color: transparent; color: var(--acc-fg); }
|
|
260
|
+
|
|
261
|
+
/* ---- badges ------------------------------------------------------------- */
|
|
262
|
+
.acc-badge {
|
|
263
|
+
display: inline-flex;
|
|
264
|
+
align-items: center;
|
|
265
|
+
gap: 4px;
|
|
266
|
+
height: 20px;
|
|
267
|
+
padding: 0 7px;
|
|
268
|
+
border: .5px solid transparent;
|
|
269
|
+
border-radius: 999px;
|
|
270
|
+
background: var(--acc-hover);
|
|
271
|
+
color: var(--acc-fg-weak);
|
|
272
|
+
font: 500 11px/1 var(--acc-font);
|
|
273
|
+
letter-spacing: .02em;
|
|
274
|
+
white-space: nowrap;
|
|
275
|
+
}
|
|
276
|
+
.acc-badge-neutral { background: var(--acc-hover); color: var(--acc-fg-weak); }
|
|
277
|
+
.acc-badge-info { background: color-mix(in srgb, var(--acc-accent) 12%, transparent); border-color: color-mix(in srgb, var(--acc-accent) 28%, transparent); color: var(--acc-accent-text); }
|
|
278
|
+
.acc-badge-success { background: color-mix(in srgb, var(--acc-success) 14%, transparent); border-color: color-mix(in srgb, var(--acc-success) 32%, transparent); color: var(--acc-success-text); }
|
|
279
|
+
.acc-badge-warn { background: color-mix(in srgb, var(--acc-warn) 16%, transparent); border-color: color-mix(in srgb, var(--acc-warn) 36%, transparent); color: var(--acc-warn-text); }
|
|
280
|
+
.acc-badge-danger { background: color-mix(in srgb, var(--acc-danger) 12%, transparent); border-color: color-mix(in srgb, var(--acc-danger) 30%, transparent); color: var(--acc-danger-text); }
|
|
281
|
+
|
|
282
|
+
/* ---- empty / loading / error states ------------------------------------ */
|
|
283
|
+
.acc-state {
|
|
284
|
+
display: flex;
|
|
285
|
+
flex-direction: column;
|
|
286
|
+
align-items: center;
|
|
287
|
+
justify-content: center;
|
|
288
|
+
gap: 8px;
|
|
289
|
+
min-width: 0;
|
|
290
|
+
padding: 40px 24px;
|
|
291
|
+
border: 1px dashed var(--acc-border);
|
|
292
|
+
border-radius: var(--acc-radius);
|
|
293
|
+
background: color-mix(in srgb, var(--acc-hover) 32%, transparent);
|
|
294
|
+
text-align: center;
|
|
295
|
+
}
|
|
296
|
+
.acc-state-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-bottom: 2px; border-radius: 50%; background: var(--acc-hover); color: var(--acc-fg-faint); }
|
|
297
|
+
.acc-state-title { color: var(--acc-fg); font: 600 14px/22px var(--acc-font); }
|
|
298
|
+
.acc-state-hint, .acc-state-message { max-width: 56ch; color: var(--acc-fg-weak); font: var(--dsw-font-xxs-12, 12px/18px var(--acc-font)); }
|
|
299
|
+
.acc-state-message { word-break: break-word; }
|
|
300
|
+
.acc-state-code { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border: .5px solid color-mix(in srgb, var(--acc-danger) 30%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--acc-danger) 8%, transparent); color: var(--acc-danger-text); font-family: var(--acc-mono); font-size: 11px; letter-spacing: .02em; }
|
|
301
|
+
.acc-state-action { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
|
|
302
|
+
/* error: solid danger frame, left-aligned so long messages stay readable */
|
|
303
|
+
.acc-state-error {
|
|
304
|
+
align-items: flex-start;
|
|
305
|
+
justify-content: flex-start;
|
|
306
|
+
text-align: left;
|
|
307
|
+
border-style: solid;
|
|
308
|
+
border-color: color-mix(in srgb, var(--acc-danger) 42%, transparent);
|
|
309
|
+
background: color-mix(in srgb, var(--acc-danger) 5%, transparent);
|
|
310
|
+
}
|
|
311
|
+
.acc-state-error .acc-state-icon { width: 32px; height: 32px; background: color-mix(in srgb, var(--acc-danger) 12%, transparent); color: var(--acc-danger); }
|
|
312
|
+
.acc-state-error .acc-state-action { justify-content: flex-start; }
|
|
313
|
+
/* loading: no frame; a label plus skeleton rows reads as "content is coming" */
|
|
314
|
+
.acc-state-loading {
|
|
315
|
+
align-items: stretch;
|
|
316
|
+
justify-content: flex-start;
|
|
317
|
+
gap: 10px;
|
|
318
|
+
padding: 8px 0 16px;
|
|
319
|
+
border: 0;
|
|
320
|
+
background: transparent;
|
|
321
|
+
text-align: left;
|
|
322
|
+
}
|
|
323
|
+
.acc-loading-head { display: flex; align-items: center; gap: 8px; color: var(--acc-fg-weak); font: var(--dsw-font-xxs-12, 12px/18px var(--acc-font)); }
|
|
324
|
+
.acc-loading-label { min-width: 0; }
|
|
325
|
+
.acc-skeleton-stack { display: flex; flex-direction: column; gap: 8px; padding-top: 2px; }
|
|
326
|
+
.acc-skeleton {
|
|
327
|
+
display: block;
|
|
328
|
+
height: 12px;
|
|
329
|
+
border-radius: 6px;
|
|
330
|
+
background: linear-gradient(90deg, var(--acc-hover) 25%, color-mix(in srgb, var(--acc-fg) 7%, transparent) 37%, var(--acc-hover) 63%);
|
|
331
|
+
background-size: 220% 100%;
|
|
332
|
+
animation: acc-shimmer 1.4s linear infinite;
|
|
333
|
+
}
|
|
334
|
+
.acc-spinner { flex: none; width: 14px; height: 14px; border: 2px solid var(--acc-border); border-top-color: var(--acc-accent); border-radius: 50%; animation: acc-spin .8s linear infinite; }
|
|
82
335
|
@keyframes acc-spin { to { transform: rotate(360deg); } }
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
.acc-notice
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
336
|
+
@keyframes acc-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
|
|
337
|
+
|
|
338
|
+
/* ---- notices ------------------------------------------------------------ */
|
|
339
|
+
.acc-notice {
|
|
340
|
+
position: relative;
|
|
341
|
+
padding: 8px 12px 8px 14px;
|
|
342
|
+
overflow: hidden;
|
|
343
|
+
border: .5px solid color-mix(in srgb, var(--acc-accent) 22%, transparent);
|
|
344
|
+
border-radius: var(--acc-radius-sm);
|
|
345
|
+
background: color-mix(in srgb, var(--acc-accent) 6%, transparent);
|
|
346
|
+
color: var(--acc-fg);
|
|
347
|
+
font: var(--dsw-font-xxs-12, 12px/18px var(--acc-font));
|
|
348
|
+
overflow-wrap: anywhere;
|
|
349
|
+
}
|
|
350
|
+
.acc-notice::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; width: 3px; background: var(--acc-accent); }
|
|
351
|
+
.acc-notice-info { border-color: color-mix(in srgb, var(--acc-accent) 22%, transparent); background: color-mix(in srgb, var(--acc-accent) 6%, transparent); }
|
|
352
|
+
.acc-notice-warn { border-color: color-mix(in srgb, var(--acc-warn) 26%, transparent); background: color-mix(in srgb, var(--acc-warn) 9%, transparent); }
|
|
353
|
+
.acc-notice-warn::before { background: var(--acc-warn); }
|
|
354
|
+
.acc-notice-danger { border-color: color-mix(in srgb, var(--acc-danger) 30%, transparent); background: color-mix(in srgb, var(--acc-danger) 6%, transparent); }
|
|
355
|
+
.acc-notice-danger::before { background: var(--acc-danger); }
|
|
356
|
+
.acc-notice-success { border-color: color-mix(in srgb, var(--acc-success) 28%, transparent); background: color-mix(in srgb, var(--acc-success) 8%, transparent); }
|
|
357
|
+
.acc-notice-success::before { background: var(--acc-success); }
|
|
358
|
+
|
|
359
|
+
/* ---- tables ------------------------------------------------------------- */
|
|
360
|
+
.acc-table-wrap { max-width: 100%; overflow: auto; border: .5px solid var(--acc-card-stroke); border-radius: var(--acc-radius-sm); background: var(--acc-card); }
|
|
361
|
+
/* Long tables get their own scroll frame so the sticky header keeps the
|
|
362
|
+
* column meaning visible; short tables keep flowing with the page. */
|
|
363
|
+
.acc-table-wrap.is-tall { max-height: min(60vh, 520px); }
|
|
364
|
+
.acc-table-wrap:focus-within { border-color: var(--acc-border-strong); }
|
|
365
|
+
.acc-table { width: 100%; border-collapse: separate; border-spacing: 0; font: var(--dsw-font-xxs-12, 12px/18px var(--acc-font)); }
|
|
366
|
+
.acc-table th, .acc-table td { padding: 8px 10px; border-bottom: .5px solid var(--acc-border); text-align: left; vertical-align: top; }
|
|
367
|
+
.acc-table th { position: sticky; top: 0; z-index: 2; background: var(--acc-card); box-shadow: inset 0 -1px 0 var(--acc-card-stroke); color: var(--acc-fg-weak); font: 600 12px/18px var(--acc-font); white-space: nowrap; }
|
|
368
|
+
.acc-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--acc-hover) 50%, transparent); }
|
|
369
|
+
.acc-table tbody tr:hover { background: var(--acc-hover); }
|
|
370
|
+
.acc-table tbody tr:focus-visible { outline: 2px solid var(--dsw-focus-ring-color, var(--acc-accent)); outline-offset: -2px; }
|
|
371
|
+
.acc-table tbody tr:last-child td { border-bottom: 0; }
|
|
372
|
+
/* Table cells inherit the .acc-table td default alignment, so the helpers
|
|
373
|
+
* are re-stated at cell specificity. */
|
|
374
|
+
.acc-align-right, .acc-table th.acc-align-right, .acc-table td.acc-align-right { text-align: right; font-variant-numeric: tabular-nums; }
|
|
375
|
+
.acc-align-center, .acc-table th.acc-align-center, .acc-table td.acc-align-center { text-align: center; }
|
|
376
|
+
.acc-cell-text { display: inline; }
|
|
377
|
+
.acc-cell-text.is-long { display: inline-block; max-width: min(34ch, 100%); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
|
|
378
|
+
.acc-cell-text.is-clip { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
379
|
+
.acc-cell-empty { color: var(--acc-fg-faint); }
|
|
380
|
+
|
|
381
|
+
/* ---- key/value list ----------------------------------------------------- */
|
|
382
|
+
.acc-kv { display: flex; flex-direction: column; margin: 0; font: var(--dsw-font-xxs-12, 12px/18px var(--acc-font)); }
|
|
383
|
+
.acc-kv-row { display: grid; grid-template-columns: minmax(96px, 40%) minmax(0, 1fr); gap: 4px 16px; padding: 6px 0; border-bottom: .5px solid var(--acc-border); }
|
|
384
|
+
.acc-kv-row:first-child { padding-top: 0; }
|
|
385
|
+
.acc-kv-row:last-child { padding-bottom: 0; border-bottom: 0; }
|
|
97
386
|
.acc-kv-key { color: var(--acc-fg-weak); }
|
|
98
|
-
.acc-kv-value { margin: 0; word-break: break-word; }
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
.acc-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
387
|
+
.acc-kv-value { margin: 0; min-width: 0; color: var(--acc-fg); word-break: break-word; }
|
|
388
|
+
|
|
389
|
+
/* ---- code --------------------------------------------------------------- */
|
|
390
|
+
.acc-code {
|
|
391
|
+
margin: 0;
|
|
392
|
+
padding: 10px 12px;
|
|
393
|
+
max-height: 360px;
|
|
394
|
+
overflow: auto;
|
|
395
|
+
border: .5px solid var(--acc-card-stroke);
|
|
396
|
+
border-radius: var(--acc-radius-sm);
|
|
397
|
+
background: color-mix(in srgb, var(--acc-hover) 55%, transparent);
|
|
398
|
+
font-family: var(--acc-mono);
|
|
399
|
+
font-size: 11px;
|
|
400
|
+
line-height: 18px;
|
|
401
|
+
tab-size: 2;
|
|
402
|
+
white-space: pre-wrap;
|
|
403
|
+
word-break: break-word;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
/* ---- statistics --------------------------------------------------------- */
|
|
407
|
+
.acc-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 12px; min-width: 0; }
|
|
408
|
+
.acc-stat { align-items: flex-start; gap: 4px; padding: 12px 14px; text-align: left; font: inherit; color: inherit; cursor: pointer; transition: border-color var(--acc-fast) var(--acc-ease), background-color var(--acc-fast) var(--acc-ease); }
|
|
409
|
+
.acc-stat:hover { border-color: color-mix(in srgb, var(--acc-accent) 42%, transparent); background: color-mix(in srgb, var(--acc-accent) 4%, transparent); }
|
|
410
|
+
.acc-stat:active { background: var(--acc-hover); }
|
|
411
|
+
.acc-stat-label { color: var(--acc-fg-weak); font: 500 12px/18px var(--acc-font); letter-spacing: .01em; }
|
|
412
|
+
.acc-stat-value { color: var(--acc-fg); font: 600 20px/28px var(--acc-font); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
|
|
413
|
+
.acc-stat-reason { display: -webkit-box; max-width: 100%; overflow: hidden; color: var(--acc-danger-text); font: 11px/16px var(--acc-font); -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
|
|
414
|
+
.acc-stat-unavailable .acc-stat-value { color: var(--acc-fg-faint); font-size: 14px; font-weight: 500; line-height: 22px; }
|
|
415
|
+
|
|
416
|
+
/* ---- tabs --------------------------------------------------------------- */
|
|
417
|
+
.acc-tabs { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 2px; overflow-x: auto; border: .5px solid var(--acc-border); border-radius: var(--acc-radius-sm); background: var(--acc-hover); }
|
|
418
|
+
.acc-tab { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--acc-fg-weak); font: 500 12px/18px var(--acc-font); white-space: nowrap; cursor: pointer; transition: background-color var(--acc-fast) var(--acc-ease), color var(--acc-fast) var(--acc-ease); }
|
|
419
|
+
.acc-tab:hover { color: var(--acc-fg); background: color-mix(in srgb, var(--acc-card) 65%, transparent); }
|
|
420
|
+
.acc-tab.is-active, .acc-tab[aria-selected="true"], .acc-tab[aria-pressed="true"] { background: var(--acc-card); box-shadow: 0 0 0 .5px var(--acc-card-stroke); color: var(--acc-fg); }
|
|
421
|
+
.acc-tab:disabled { opacity: .45; cursor: not-allowed; }
|
|
422
|
+
|
|
423
|
+
/* ---- selectable list ---------------------------------------------------- */
|
|
424
|
+
.acc-list { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
|
|
425
|
+
.acc-list-item {
|
|
426
|
+
display: flex;
|
|
427
|
+
align-items: center;
|
|
428
|
+
gap: 8px;
|
|
429
|
+
width: 100%;
|
|
430
|
+
min-height: 32px;
|
|
431
|
+
min-width: 0;
|
|
432
|
+
padding: 6px 10px;
|
|
433
|
+
border: 1px solid transparent;
|
|
434
|
+
border-radius: var(--acc-radius-sm);
|
|
435
|
+
background: transparent;
|
|
436
|
+
color: var(--acc-fg);
|
|
437
|
+
font: inherit;
|
|
438
|
+
text-align: left;
|
|
439
|
+
cursor: pointer;
|
|
440
|
+
transition: background-color var(--acc-fast) var(--acc-ease), border-color var(--acc-fast) var(--acc-ease);
|
|
441
|
+
}
|
|
442
|
+
.acc-list-item:hover { background: var(--acc-hover); }
|
|
443
|
+
.acc-list-item:focus-visible { outline: 2px solid var(--dsw-focus-ring-color, var(--acc-accent)); outline-offset: -2px; }
|
|
444
|
+
.acc-list-item.is-selected, .acc-list-item[aria-selected="true"], .acc-list-item[data-selected="true"] {
|
|
445
|
+
border-color: var(--acc-selected);
|
|
446
|
+
background: color-mix(in srgb, var(--acc-accent) 8%, transparent);
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
/* ---- proportion bar ----------------------------------------------------- */
|
|
450
|
+
.acc-bar { display: flex; align-items: stretch; width: 100%; height: 6px; overflow: hidden; border-radius: 999px; background: color-mix(in srgb, var(--acc-fg) 8%, transparent); }
|
|
451
|
+
.acc-bar-fill { height: 100%; min-width: 2px; border-radius: 999px; background: var(--acc-accent); transition: width var(--ds-transition-duration, .2s) var(--acc-ease); }
|
|
452
|
+
.acc-bar-fill.is-warn { background: var(--acc-warn); }
|
|
453
|
+
.acc-bar-fill.is-danger { background: var(--acc-danger); }
|
|
454
|
+
.acc-bar-fill.is-success { background: var(--acc-success); }
|
|
455
|
+
.acc-bar-fill.is-muted { background: var(--acc-fg-caption); }
|
|
456
|
+
|
|
457
|
+
/* ---- form fields -------------------------------------------------------- */
|
|
458
|
+
.acc-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
|
|
459
|
+
.acc-label { color: var(--acc-fg-weak); font: 500 12px/18px var(--acc-font); }
|
|
460
|
+
.acc-select, .acc-input, .acc-textarea {
|
|
461
|
+
min-height: 32px;
|
|
462
|
+
min-width: 0;
|
|
463
|
+
padding: 5px 8px;
|
|
464
|
+
border: 1px solid var(--acc-border);
|
|
465
|
+
border-radius: var(--acc-radius-sm);
|
|
466
|
+
background: var(--acc-card);
|
|
467
|
+
color: var(--acc-fg);
|
|
468
|
+
font: var(--dsw-font-xs-13, 13px/20px var(--acc-font));
|
|
469
|
+
transition: border-color var(--acc-fast) var(--acc-ease);
|
|
470
|
+
}
|
|
471
|
+
.acc-select:hover, .acc-input:hover, .acc-textarea:hover { border-color: var(--acc-border-strong); }
|
|
472
|
+
.acc-select:focus-visible, .acc-input:focus-visible, .acc-textarea:focus-visible { outline: 2px solid var(--dsw-focus-ring-color, var(--acc-accent)); outline-offset: 0; border-color: var(--acc-border-strong); }
|
|
473
|
+
.acc-select:disabled, .acc-input:disabled, .acc-textarea:disabled { opacity: .5; cursor: not-allowed; }
|
|
474
|
+
.acc-select[aria-invalid="true"], .acc-input[aria-invalid="true"], .acc-textarea[aria-invalid="true"] { border-color: var(--acc-danger); }
|
|
475
|
+
.acc-input { height: 32px; }
|
|
476
|
+
.acc-textarea { min-height: 96px; padding: 8px; resize: vertical; font-family: var(--acc-mono); font-size: 12px; line-height: 18px; }
|
|
477
|
+
.acc-input::placeholder, .acc-textarea::placeholder { color: var(--acc-fg-faint); }
|
|
478
|
+
.acc-select option { background: var(--acc-card); color: var(--acc-fg); }
|
|
479
|
+
|
|
480
|
+
/* ---- grids & utilities -------------------------------------------------- */
|
|
481
|
+
.acc-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; min-width: 0; }
|
|
482
|
+
.acc-grid-fit { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 12px; min-width: 0; }
|
|
483
|
+
.acc-section-title { margin: 0; color: var(--acc-fg-faint); font: 600 11px/16px var(--acc-font); letter-spacing: .06em; text-transform: uppercase; }
|
|
484
|
+
.acc-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
|
|
485
|
+
.acc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
|
|
113
486
|
.acc-muted { color: var(--acc-fg-weak); }
|
|
114
|
-
.acc-mono { font-family: var(--acc-mono); font-size:
|
|
487
|
+
.acc-mono { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; font-family: var(--acc-mono); font-size: 12px; font-variant-numeric: tabular-nums; }
|
|
115
488
|
.acc-grow { flex: 1 1 auto; min-width: 0; }
|
|
116
489
|
.acc-hidden { display: none; }
|
|
490
|
+
|
|
491
|
+
/* ---- fallback dialog (only when the host Modal primitive is missing) ---- */
|
|
492
|
+
.acc-modal-backdrop { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--acc-mask); animation: acc-fade-in .16s var(--acc-ease); }
|
|
493
|
+
.acc-modal { display: flex; flex-direction: column; width: min(560px, 100%); max-height: calc(100vh - 48px); overflow: hidden; border: .5px solid var(--acc-card-stroke); border-radius: var(--dsw-radius-lg, 16px); background: var(--acc-card); color: var(--acc-fg); box-shadow: var(--acc-elev); animation: acc-rise-in .16s var(--acc-ease); }
|
|
494
|
+
.acc-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: .5px solid var(--acc-card-stroke); }
|
|
495
|
+
.acc-modal-title { margin: 0; font: 600 15px/22px var(--acc-font); }
|
|
496
|
+
.acc-modal-body { display: flex; flex-direction: column; gap: 12px; padding: 16px; overflow: auto; }
|
|
497
|
+
.acc-modal-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: .5px solid var(--acc-card-stroke); }
|
|
498
|
+
@keyframes acc-fade-in { from { opacity: 0; } to { opacity: 1; } }
|
|
499
|
+
@keyframes acc-rise-in { from { opacity: 0; transform: translateY(6px) scale(.99); } to { opacity: 1; transform: none; } }
|
|
500
|
+
|
|
501
|
+
/* ---- responsive backstops (the layout attribute is measured in JS; these
|
|
502
|
+
* keep the section usable if a host build never fires a resize) ------ */
|
|
503
|
+
@media (max-width: 720px) {
|
|
504
|
+
.acc-title { font-size: 18px; line-height: 26px; }
|
|
505
|
+
.acc-state { padding: 32px 16px; }
|
|
506
|
+
.acc-table th, .acc-table td { padding: 7px 8px; }
|
|
507
|
+
}
|
|
508
|
+
/* Narrow: the head stacks and its actions become a full-width row, so long
|
|
509
|
+
* action sets do not squeeze the title into three lines. */
|
|
510
|
+
[data-acc-layout="narrow"] .acc-card-heading { flex-basis: 100%; }
|
|
511
|
+
[data-acc-layout="narrow"] .acc-card-actions { width: 100%; justify-content: flex-start; margin-inline-start: 0; }
|
|
512
|
+
@media (max-width: 520px) {
|
|
513
|
+
.acc-header-meta { width: 100%; }
|
|
514
|
+
.acc-stat-value { font-size: 18px; line-height: 26px; }
|
|
515
|
+
.acc-kv-row { grid-template-columns: minmax(84px, 38%) minmax(0, 1fr); }
|
|
516
|
+
.acc-modal-head, .acc-modal-body, .acc-modal-footer { padding-inline: 12px; }
|
|
517
|
+
}
|
|
117
518
|
@media (prefers-reduced-motion: reduce) {
|
|
118
519
|
.acc-root *, .acc-root *::before, .acc-root *::after { animation: none !important; transition: none !important; }
|
|
520
|
+
.acc-modal, .acc-modal-backdrop { animation: none; }
|
|
119
521
|
}
|
|
120
522
|
`
|
|
121
523
|
|
|
122
524
|
const ACC_PAGE_STORAGE_KEY = 'dsh-acc:page'
|
|
123
525
|
|
|
526
|
+
/** Page id → icon name for hosts that registered pages without `icon`. */
|
|
527
|
+
const ACC_PAGE_ICONS = {
|
|
528
|
+
overview: 'overview',
|
|
529
|
+
agents: 'agents',
|
|
530
|
+
tools: 'tools',
|
|
531
|
+
sessions: 'sessions',
|
|
532
|
+
meta: 'meta',
|
|
533
|
+
usage: 'usage',
|
|
534
|
+
diagnostics: 'diagnostics',
|
|
535
|
+
templates: 'templates',
|
|
536
|
+
recovery: 'recovery',
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
/** Fallback one-line descriptions when a page registers no `descriptionKey`. */
|
|
540
|
+
const ACC_PAGE_DESCRIPTIONS = {
|
|
541
|
+
overview: 'nav.desc.overview',
|
|
542
|
+
agents: 'nav.desc.agents',
|
|
543
|
+
tools: 'nav.desc.tools',
|
|
544
|
+
sessions: 'nav.desc.sessions',
|
|
545
|
+
meta: 'nav.desc.meta',
|
|
546
|
+
usage: 'nav.desc.usage',
|
|
547
|
+
diagnostics: 'nav.desc.diagnostics',
|
|
548
|
+
templates: 'nav.desc.templates',
|
|
549
|
+
recovery: 'nav.desc.recovery',
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
/** Module state → shared i18n key for the visible navigation pill. */
|
|
553
|
+
const ACC_STATE_KEYS = {
|
|
554
|
+
FULL: 'common.stateFull',
|
|
555
|
+
PARTIAL: 'common.statePartial',
|
|
556
|
+
ALTERNATIVE: 'common.stateAlternative',
|
|
557
|
+
BLOCKED: 'common.stateBlocked',
|
|
558
|
+
DEFERRED: 'common.stateDeferred',
|
|
559
|
+
UNKNOWN: 'common.stateUnknown',
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
/** Rail needs room for a 176px column; below that the navigation becomes a bar. */
|
|
563
|
+
const ACC_LAYOUT_RAIL_MIN = 640
|
|
564
|
+
/** Below this the navigation becomes a dropdown. */
|
|
565
|
+
const ACC_LAYOUT_BAR_MIN = 460
|
|
566
|
+
|
|
567
|
+
/**
|
|
568
|
+
* Fixed navigation group order, shared by the rail, the wrapped bar and the
|
|
569
|
+
* narrow select. The landing page (Overview) lives in `insight`, so that group
|
|
570
|
+
* leads and the active tab sits at the start of every surface.
|
|
571
|
+
*/
|
|
572
|
+
const ACC_NAV_GROUPS = ['insight', 'edit', 'maintain']
|
|
573
|
+
/**
|
|
574
|
+
* Fallback split for pages that register no `group`: ≤20 edit, ≤60 insight,
|
|
575
|
+
* everything later maintain. Explicit `group` always wins, so pages stay
|
|
576
|
+
* correctly placed when their order changes to fit a different section.
|
|
577
|
+
*/
|
|
578
|
+
const ACC_NAV_INSIGHT_MAX_ORDER = 60
|
|
579
|
+
|
|
580
|
+
/** @param {{ id: string, icon?: string, state?: string }} page @returns {string} */
|
|
581
|
+
function pageIcon(page) {
|
|
582
|
+
if (page && typeof page.icon === 'string' && ACC.icons[page.icon]) return page.icon
|
|
583
|
+
if (page && ACC_PAGE_ICONS[page.id]) return ACC_PAGE_ICONS[page.id]
|
|
584
|
+
return 'dot'
|
|
585
|
+
}
|
|
586
|
+
|
|
124
587
|
/** @param {string} state @returns {string} badge tone for a module state */
|
|
125
588
|
function stateTone(state) {
|
|
126
589
|
if (state === 'FULL') return 'success'
|
|
@@ -129,6 +592,38 @@ function stateTone(state) {
|
|
|
129
592
|
return 'neutral'
|
|
130
593
|
}
|
|
131
594
|
|
|
595
|
+
/** @param {number} width @returns {'wide' | 'mid' | 'narrow'} */
|
|
596
|
+
function layoutForWidth(width) {
|
|
597
|
+
if (width >= ACC_LAYOUT_RAIL_MIN) return 'wide'
|
|
598
|
+
if (width >= ACC_LAYOUT_BAR_MIN) return 'mid'
|
|
599
|
+
return 'narrow'
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
/**
|
|
603
|
+
* Resolve one page's navigation group. An explicit `group` wins; otherwise
|
|
604
|
+
* `order` keeps pages written before the groups existed in a sensible slot.
|
|
605
|
+
* @param {{ group?: string, order?: number }} page
|
|
606
|
+
* @returns {'edit' | 'insight' | 'maintain'}
|
|
607
|
+
*/
|
|
608
|
+
function groupOf(page) {
|
|
609
|
+
if (page && ACC_NAV_GROUPS.includes(page.group)) return page.group
|
|
610
|
+
const order = page && typeof page.order === 'number' ? page.order : 100
|
|
611
|
+
if (order <= 20) return 'edit'
|
|
612
|
+
return order <= ACC_NAV_INSIGHT_MAX_ORDER ? 'insight' : 'maintain'
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
/**
|
|
616
|
+
* Bucket already-sorted pages into the fixed group order. Empty groups are
|
|
617
|
+
* dropped so a label never appears without pages under it.
|
|
618
|
+
* @param {readonly object[]} pages
|
|
619
|
+
* @returns {Array<{ id: 'edit' | 'insight' | 'maintain', pages: object[] }>}
|
|
620
|
+
*/
|
|
621
|
+
function groupedPages(pages) {
|
|
622
|
+
const buckets = { edit: [], insight: [], maintain: [] }
|
|
623
|
+
for (const page of pages) buckets[groupOf(page)].push(page)
|
|
624
|
+
return ACC_NAV_GROUPS.filter((id) => buckets[id].length > 0).map((id) => ({ id, pages: buckets[id] }))
|
|
625
|
+
}
|
|
626
|
+
|
|
132
627
|
/**
|
|
133
628
|
* The one settings page. Owns internal navigation only; each page owns its
|
|
134
629
|
* data, loading/error/empty states and destructive confirmations.
|
|
@@ -137,6 +632,8 @@ function stateTone(state) {
|
|
|
137
632
|
function AccSection(props) {
|
|
138
633
|
const t = props.t
|
|
139
634
|
const pages = ACC.pagesSorted()
|
|
635
|
+
const navGroups = groupedPages(pages)
|
|
636
|
+
const rootRef = useRef(null)
|
|
140
637
|
const [activeId, setActiveId] = useState(() => {
|
|
141
638
|
try {
|
|
142
639
|
const stored = localStorage.getItem(ACC_PAGE_STORAGE_KEY)
|
|
@@ -146,14 +643,31 @@ function AccSection(props) {
|
|
|
146
643
|
}
|
|
147
644
|
return pages.length > 0 ? pages[0].id : ''
|
|
148
645
|
})
|
|
149
|
-
|
|
646
|
+
// The settings panel is ~560px wide even on a 1440px viewport, so the
|
|
647
|
+
// navigation mode follows the measured section width, not the viewport.
|
|
648
|
+
const [layout, setLayout] = useState(() => {
|
|
649
|
+
if (typeof window === 'undefined') return 'mid'
|
|
650
|
+
return window.innerWidth >= 720 ? 'mid' : 'narrow'
|
|
651
|
+
})
|
|
150
652
|
|
|
151
653
|
useEffect(() => {
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
|
|
654
|
+
const node = rootRef.current
|
|
655
|
+
if (!node) return undefined
|
|
656
|
+
const apply = (width) => setLayout(layoutForWidth(width))
|
|
657
|
+
apply(node.getBoundingClientRect().width)
|
|
658
|
+
if (typeof ResizeObserver !== 'function') return undefined
|
|
659
|
+
const observer = new ResizeObserver((entries) => {
|
|
660
|
+
const entry = entries[0]
|
|
661
|
+
if (entry) apply(entry.contentRect.width)
|
|
662
|
+
})
|
|
663
|
+
observer.observe(node)
|
|
664
|
+
return () => observer.disconnect()
|
|
155
665
|
}, [])
|
|
156
666
|
|
|
667
|
+
// Long ids/paths become hoverable: one observer for the whole section beats
|
|
668
|
+
// nine pages repeating title plumbing (modal content is outside this tree).
|
|
669
|
+
useEffect(() => ACC.annotateTruncation(rootRef.current), [])
|
|
670
|
+
|
|
157
671
|
useEffect(() => {
|
|
158
672
|
if (pages.length === 0) return
|
|
159
673
|
if (!pages.some((page) => page.id === activeId)) {
|
|
@@ -176,65 +690,117 @@ function AccSection(props) {
|
|
|
176
690
|
}, [health.status, health.data])
|
|
177
691
|
|
|
178
692
|
const active = pages.find((page) => page.id === activeId) || pages[0]
|
|
693
|
+
const wide = layout === 'wide'
|
|
694
|
+
const pageTitle = active ? t(active.titleKey) : t('nav.title')
|
|
695
|
+
const pageDescription = active ? t(active.descriptionKey || ACC_PAGE_DESCRIPTIONS[active.id] || 'nav.description') : t('nav.description')
|
|
696
|
+
|
|
697
|
+
/** @param {object} page @returns {unknown} */
|
|
698
|
+
function renderNavItem(page) {
|
|
699
|
+
const isActive = page.id === activeId
|
|
700
|
+
const label = t(page.titleKey)
|
|
701
|
+
const moduleState = moduleStates[page.id]
|
|
702
|
+
const showState = moduleState !== undefined && moduleState.state !== 'FULL'
|
|
703
|
+
return h(
|
|
704
|
+
'button',
|
|
705
|
+
{
|
|
706
|
+
key: page.id,
|
|
707
|
+
type: 'button',
|
|
708
|
+
className: `acc-nav-item${isActive ? ' is-active' : ''}`,
|
|
709
|
+
'aria-current': isActive ? 'page' : undefined,
|
|
710
|
+
title: label,
|
|
711
|
+
onClick: () => setActiveId(page.id),
|
|
712
|
+
},
|
|
713
|
+
h(C.Icon, { name: pageIcon(page), className: 'acc-nav-icon' }),
|
|
714
|
+
h('span', { className: 'acc-nav-label' }, label),
|
|
715
|
+
showState
|
|
716
|
+
? h(
|
|
717
|
+
'span',
|
|
718
|
+
{
|
|
719
|
+
className: `acc-nav-state acc-badge acc-badge-${stateTone(moduleState.state)}`,
|
|
720
|
+
title: String(moduleState.detail || moduleState.state),
|
|
721
|
+
},
|
|
722
|
+
t(ACC_STATE_KEYS[moduleState.state] || 'common.stateUnknown'),
|
|
723
|
+
)
|
|
724
|
+
: null,
|
|
725
|
+
)
|
|
726
|
+
}
|
|
179
727
|
|
|
180
728
|
return h(
|
|
181
729
|
'div',
|
|
182
|
-
{ className: 'acc-root' },
|
|
730
|
+
{ className: 'acc-root', 'data-acc-layout': layout, 'data-acc-page': active ? active.id : '', ref: rootRef },
|
|
183
731
|
h(
|
|
184
732
|
'header',
|
|
185
733
|
{ className: 'acc-header' },
|
|
186
|
-
h(
|
|
734
|
+
h(
|
|
735
|
+
'div',
|
|
736
|
+
{ className: 'acc-header-text' },
|
|
737
|
+
h(
|
|
738
|
+
'div',
|
|
739
|
+
{ className: 'acc-eyebrow' },
|
|
740
|
+
h('span', { className: 'acc-eyebrow-name' }, t('nav.title')),
|
|
741
|
+
health.status === 'ready' && health.data
|
|
742
|
+
? h('span', { className: 'acc-version', title: String(health.data.storageRoot || '') }, `v${health.data.version}`)
|
|
743
|
+
: null,
|
|
744
|
+
),
|
|
745
|
+
h('h2', { className: 'acc-title' }, pageTitle),
|
|
746
|
+
h('p', { className: 'acc-subtitle' }, pageDescription),
|
|
747
|
+
),
|
|
187
748
|
h(
|
|
188
749
|
'div',
|
|
189
750
|
{ className: 'acc-header-meta' },
|
|
190
751
|
health.status === 'error' ? h(C.Badge, { tone: 'danger', title: String(health.error && health.error.message) }, t('common.hostUnavailable')) : null,
|
|
191
|
-
|
|
192
|
-
h(C.Btn, { tone: 'ghost', onClick: health.reload, title: t('common.refresh') }, t('common.refresh')),
|
|
752
|
+
h(C.Btn, { tone: 'ghost', icon: 'retry', onClick: health.reload, title: t('nav.refreshStatusHint'), ariaLabel: t('nav.refreshStatus') }, t('nav.refreshStatus')),
|
|
193
753
|
),
|
|
194
754
|
),
|
|
195
755
|
pages.length === 0
|
|
196
756
|
? h(C.Empty, { title: t('nav.empty'), hint: t('nav.emptyHint') })
|
|
197
757
|
: h(
|
|
198
758
|
'div',
|
|
199
|
-
{ className:
|
|
200
|
-
|
|
759
|
+
{ className: wide ? 'acc-body' : 'acc-body acc-body-narrow' },
|
|
760
|
+
wide
|
|
201
761
|
? h(
|
|
202
|
-
'select',
|
|
203
|
-
{
|
|
204
|
-
className: 'acc-select',
|
|
205
|
-
value: active ? active.id : '',
|
|
206
|
-
'aria-label': t('nav.ariaLabel'),
|
|
207
|
-
onChange: (event) => setActiveId(event.target.value),
|
|
208
|
-
},
|
|
209
|
-
pages.map((page) => h('option', { key: page.id, value: page.id }, t(page.titleKey))),
|
|
210
|
-
)
|
|
211
|
-
: h(
|
|
212
762
|
'nav',
|
|
213
763
|
{ className: 'acc-nav', 'aria-label': t('nav.ariaLabel') },
|
|
214
|
-
|
|
764
|
+
navGroups.flatMap((group) => {
|
|
765
|
+
const label = t(`nav.group.${group.id}`)
|
|
766
|
+
return [
|
|
767
|
+
h('div', { key: `group-${group.id}`, className: 'acc-nav-group', title: label }, label),
|
|
768
|
+
...group.pages.map(renderNavItem),
|
|
769
|
+
]
|
|
770
|
+
}),
|
|
771
|
+
)
|
|
772
|
+
: layout === 'mid'
|
|
773
|
+
? h(
|
|
774
|
+
'nav',
|
|
775
|
+
{ className: 'acc-nav acc-nav-horizontal', 'aria-label': t('nav.ariaLabel') },
|
|
776
|
+
navGroups.flatMap((group, index) => [
|
|
777
|
+
...(index === 0
|
|
778
|
+
? []
|
|
779
|
+
: [h('span', { key: `sep-${group.id}`, className: 'acc-nav-sep', 'aria-hidden': 'true' })]),
|
|
780
|
+
...group.pages.map(renderNavItem),
|
|
781
|
+
]),
|
|
782
|
+
)
|
|
783
|
+
: h(
|
|
784
|
+
'div',
|
|
785
|
+
{ className: 'acc-narrowbar' },
|
|
786
|
+
h(C.Icon, { name: pageIcon(active), className: 'acc-narrowbar-icon' }),
|
|
215
787
|
h(
|
|
216
|
-
'
|
|
788
|
+
'select',
|
|
217
789
|
{
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
onClick: () => setActiveId(page.id),
|
|
790
|
+
className: 'acc-select',
|
|
791
|
+
value: active ? active.id : '',
|
|
792
|
+
'aria-label': t('nav.ariaLabel'),
|
|
793
|
+
onChange: (event) => setActiveId(event.target.value),
|
|
223
794
|
},
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
},
|
|
232
|
-
moduleStates[page.id].state,
|
|
233
|
-
)
|
|
234
|
-
: null,
|
|
795
|
+
navGroups.map((group) =>
|
|
796
|
+
h(
|
|
797
|
+
'optgroup',
|
|
798
|
+
{ key: `group-${group.id}`, label: t(`nav.group.${group.id}`) },
|
|
799
|
+
group.pages.map((page) => h('option', { key: page.id, value: page.id }, t(page.titleKey))),
|
|
800
|
+
),
|
|
801
|
+
),
|
|
235
802
|
),
|
|
236
803
|
),
|
|
237
|
-
),
|
|
238
804
|
h(
|
|
239
805
|
'div',
|
|
240
806
|
{ className: 'acc-content' },
|