@celestia-island/hikari 0.55.494 → 0.55.495

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celestia-island/hikari",
3
- "version": "0.55.494",
3
+ "version": "0.55.495",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Hikari UI library, Vue 3 runtime — one design system for Vue 3 and Rust/WASM applications",
@@ -27,6 +27,7 @@ import {
27
27
  import HkButton from "./HkButton";
28
28
  import HkCopyBadge from "./HkCopyBadge";
29
29
  import HkModal, { type ModalAction } from "./HkModal";
30
+ import HkSpinner from "./HkSpinner";
30
31
  import HTabs, { type TabItem } from "./HkTabs";
31
32
  import "./HkSolarLocationSetting.scss";
32
33
 
@@ -337,21 +338,37 @@ export const HkSolarLocationEditor = defineComponent({
337
338
  </div>
338
339
  </div>
339
340
  ))}
340
- {probeStatus.value && (
341
- <div class="hk-solar-detected-status" data-state={probeStatus.value.kind}>
341
+ {probeStatus.value && (probeStatus.value.kind === "probing" ? (
342
+ // In-flight probe (2026-11-26 user direction): the progress
343
+ // line was a text sentence, and a fast probe made it read as a
344
+ // flicker — a circle reads as "working" without the flicker.
345
+ // The COMPACT circle rides the status row: the centered
346
+ // placement contract (HkSpinner center) carries 1.5rem/1rem of
347
+ // padding and an 8rem-tall floor, which inside this one-line
348
+ // strip would inflate the dialog by several times the height
349
+ // of the text it replaces. The row centers it
350
+ // (.hk-solar-detected-status[data-state="probing"]), and the
351
+ // i18n probing line stays as the region's hidden announcement
352
+ // so screen readers still say what is happening. The failure
353
+ // state below keeps its visible copy: informative, not
354
+ // transient.
355
+ <div class="hk-solar-detected-status" data-state="probing" role="status" aria-live="polite">
356
+ <HkSpinner size="sm" />
357
+ <span class="hk-solar-detected-sr">{probeStatus.value.text}</span>
358
+ </div>
359
+ ) : (
360
+ <div class="hk-solar-detected-status" data-state="failed">
342
361
  <span>{probeStatus.value.text}</span>
343
- {probeStatus.value.kind === "failed" && (
344
- <HkButton
345
- size="sm"
346
- variant="ghost"
347
- class="hk-solar-detected-retry"
348
- onClick={retryProbe}
349
- >
350
- {t("hikari::theme.solar.detectedRetry")}
351
- </HkButton>
352
- )}
362
+ <HkButton
363
+ size="sm"
364
+ variant="ghost"
365
+ class="hk-solar-detected-retry"
366
+ onClick={retryProbe}
367
+ >
368
+ {t("hikari::theme.solar.detectedRetry")}
369
+ </HkButton>
353
370
  </div>
354
- )}
371
+ ))}
355
372
  </div>
356
373
  );
357
374
  }
@@ -123,6 +123,12 @@
123
123
  gap: var(--space-8, 0.5rem);
124
124
  }
125
125
 
126
+ /* One readout line = label LEFT, value RIGHT (2026-11-26 user direction:
127
+ * a label followed by its value packed tight in the left half reads as
128
+ * ragged prose; the two-column readout wants the two ends). The label
129
+ * column is content-sized and the value column absorbs the rest, so every
130
+ * row ends at the same right edge. Long values stay inside their own
131
+ * column and soft-wrap there — they never push the left edge around. */
126
132
  .hk-solar-detected-row {
127
133
  display: grid;
128
134
  grid-template-columns: max-content minmax(0, 1fr);
@@ -141,6 +147,7 @@
141
147
  .hk-solar-detected-value {
142
148
  display: flex;
143
149
  flex-wrap: wrap;
150
+ justify-content: flex-end;
144
151
  gap: var(--space-6, 0.375rem);
145
152
  min-width: 0;
146
153
  }
@@ -153,6 +160,10 @@
153
160
  text-align: left;
154
161
  }
155
162
 
163
+ /* A chip that has to wrap keeps its own text left-aligned (above) while
164
+ * the chip itself stays flush to the row's right edge — the readout's
165
+ * two-column contract holds even when one value needs two lines. */
166
+
156
167
  /* Probe status line (IP pane): muted progress / failure note, with the
157
168
  * retry affordance inline after the text. */
158
169
  .hk-solar-detected-status {
@@ -168,6 +179,31 @@
168
179
  flex-shrink: 0;
169
180
  }
170
181
 
182
+ /* The probing row is ONE line: the compact circle sits centered in it
183
+ * (the label-less status strip carries no text of its own — the sentence
184
+ * rides the hidden announcement), and the circle takes the row's own
185
+ * height instead of the centered contract's padded box. */
186
+ .hk-solar-detected-status[data-state="probing"] {
187
+ justify-content: center;
188
+ }
189
+
190
+ /* The probing state's status text, visually hidden but announced: the
191
+ visible grammar is the centered spinner (HkSpinner's center contract);
192
+ the region keeps its text content so screen readers have something to
193
+ say when it appears (same pattern as HkEmptyState's sr utility). */
194
+ .hk-solar-detected-sr {
195
+ position: absolute;
196
+ width: 1px;
197
+ height: 1px;
198
+ padding: 0;
199
+ margin: -1px;
200
+ overflow: hidden;
201
+ clip: rect(0, 0, 0, 0);
202
+ clip-path: inset(50%);
203
+ white-space: nowrap;
204
+ border: 0;
205
+ }
206
+
171
207
  .hk-solar-manual {
172
208
  display: flex;
173
209
  flex-direction: column;
@@ -33,6 +33,33 @@ function bodyOf(selector: string): string | null {
33
33
  return m ? m[1] : null;
34
34
  }
35
35
 
36
+ describe("solar readout + probe-row layout contract", () => {
37
+ it("puts the readout label LEFT and its value flush RIGHT", () => {
38
+ // 2026-11-26 user direction: a label with its value packed tight after
39
+ // it reads as ragged prose — the two-column readout wants the two ends.
40
+ // MUT:solar-readout-ends: dropping the flex-end alignment (or the
41
+ // content-sized label column) brings the packed-left look back and
42
+ // goes red.
43
+ const value = bodyOf(".hk-solar-detected-value");
44
+ expect(value, "the value ruleset exists").not.toBeNull();
45
+ expect(value).toContain("justify-content: flex-end");
46
+
47
+ const row = bodyOf(".hk-solar-detected-row");
48
+ expect(row).toContain("grid-template-columns: max-content minmax(0, 1fr)");
49
+ });
50
+
51
+ it("keeps the probing row a centered one-liner with a compact circle", () => {
52
+ // The centered placement contract carries padding + an 8rem floor;
53
+ // inside this one-line strip it would inflate the dialog, so the
54
+ // component renders the compact circle and the row centers it.
55
+ // MUT:solar-probe-spinner is pinned in the behaviour spec; this guards
56
+ // the sheet half (no padded box sneaks back in).
57
+ const probing = bodyOf('.hk-solar-detected-status[data-state="probing"]');
58
+ expect(probing, "the probing-row ruleset exists").not.toBeNull();
59
+ expect(probing).toContain("justify-content: center");
60
+ });
61
+ });
62
+
36
63
  describe("HkSolarLocationSetting row geometry", () => {
37
64
  it("pins the row's cross size to the 28px action square", () => {
38
65
  const row = bodyOf(".hk-solar-row");
@@ -548,6 +548,56 @@ describe("HkSolarLocationSetting editor", () => {
548
548
  expect(detectedSection().querySelector(".hk-solar-detected-retry")).toBeTruthy();
549
549
  });
550
550
 
551
+ it("an in-flight probe reads as a centered spinner, not a flashing sentence", async () => {
552
+ // 2026-11-26 user direction: the probing state was a text sentence, and
553
+ // a fast probe made it read as a flicker — the in-flight state renders
554
+ // the family's centered loading circle instead; the i18n probing line
555
+ // stays only as the status region's hidden announcement.
556
+ const container = mountSetting();
557
+ await openEditor(container);
558
+ resetSolarIpInsight();
559
+ // The probe's fetch holds behind a gate the test controls: the
560
+ // in-flight state stays up for the assertions, then releases into
561
+ // the failure path for the retry pin.
562
+ let releaseProbe!: () => void;
563
+ const gate = new Promise<void>((resolve) => { releaseProbe = resolve; });
564
+ vi.stubGlobal("fetch", vi.fn(async () => {
565
+ await gate;
566
+ return { ok: false };
567
+ }));
568
+ clickStrategy("ip");
569
+ await settle();
570
+ await vi.waitFor(() => {
571
+ expect(detectedSection().querySelector('[data-state="probing"]')).toBeTruthy();
572
+ });
573
+ const probing = detectedSection().querySelector('[data-state="probing"]')!;
574
+ // MUT:solar-probe-spinner: the region's children are EXACTLY the
575
+ // centered circle and the hidden announcement — re-introducing visible
576
+ // probing text adds a child and goes red, as does dropping the
577
+ // spinner. (The gate promise is wall-clock bounded by the engine's
578
+ // 4s fetch abort; the assertions run well inside it. The module-level
579
+ // ipProbeInflight resolves in this test's releaseProbe, so the
580
+ // next test's fresh mount cannot inherit an in-flight probe.)
581
+ // The compact circle (NOT the padded centered contract, which would
582
+ // inflate this one-line strip by several times the height of the text
583
+ // it replaces — R4 measured the padding trap).
584
+ expect(probing.querySelector(".hk-spinner")).toBeTruthy();
585
+ expect(probing.querySelector(".hk-spinner-sm")).toBeTruthy();
586
+ expect(probing.querySelector(".hk-spinner-centered")).toBeNull();
587
+ expect([...probing.children].map((child) => child.className)).toEqual([
588
+ expect.stringContaining("hk-spinner-wrapper"),
589
+ "hk-solar-detected-sr",
590
+ ]);
591
+ // The status region keeps its announcement for screen readers.
592
+ expect(probing.querySelector(".hk-solar-detected-sr")?.textContent).toContain("Detecting");
593
+ expect(probing.getAttribute("role")).toBe("status");
594
+ releaseProbe();
595
+ await vi.waitFor(() => {
596
+ expect(detectedSection().querySelector('[data-state="failed"]')).toBeTruthy();
597
+ });
598
+ expect(detectedSection().querySelector(".hk-solar-detected-retry")).toBeTruthy();
599
+ });
600
+
551
601
  it("switching strategies swaps the hint and reveals the manual pane", async () => {
552
602
  const container = mountSetting();
553
603
  await openEditor(container);