@celestia-island/hikari 0.55.436 → 0.55.438

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.
Files changed (38) hide show
  1. package/package.json +1 -1
  2. package/src/components/HkAdaptiveTabs.test.tsx +1 -1
  3. package/src/components/HkAvatar.scss +8 -0
  4. package/src/components/HkAvatarFallback.centering.styles.test.ts +7 -0
  5. package/src/components/HkBoard3D.tsx +3 -3
  6. package/src/components/HkEditableTable.test.tsx +15 -9
  7. package/src/components/HkEmergencyAlert.layering.contract.test.ts +1 -1
  8. package/src/components/HkJsonTree.tsx +1 -1
  9. package/src/components/HkKanban.tsx +1 -1
  10. package/src/components/HkLoadMore.tsx +1 -1
  11. package/src/components/HkLocalePicker.tsx +1 -1
  12. package/src/components/HkLocalePickerPopup.tsx +1 -1
  13. package/src/components/HkMarkdownRenderer.mermaid.test.tsx +6 -6
  14. package/src/components/HkMenu.tsx +1 -1
  15. package/src/components/HkMermaidDiagram.test.tsx +4 -6
  16. package/src/components/HkNavSidebar.tsx +1 -1
  17. package/src/components/HkNodeCanvas.tsx +6 -6
  18. package/src/components/HkRangeRibbon.test.tsx +2 -2
  19. package/src/components/HkScrollContainer.dock.test.tsx +6 -6
  20. package/src/components/HkScrollContainer.dockRide.test.tsx +7 -7
  21. package/src/components/HkSerpentineUnlock.scss +11 -2
  22. package/src/components/HkSerpentineUnlock.tsx +30 -27
  23. package/src/components/HkTagDotRow.tsx +1 -1
  24. package/src/components/HkTerminal.test.tsx +1 -1
  25. package/src/components/HkTimeZonePicker.tsx +1 -1
  26. package/src/components/HkWaterfall.tsx +1 -1
  27. package/src/components/HkWindowControls.test.tsx +2 -2
  28. package/src/components/__tests__/hkMarkdownLinks.test.ts +2 -2
  29. package/src/composables/useHighlight.ts +3 -3
  30. package/src/plugins/boot-recovery.details.test.ts +4 -2
  31. package/src/plugins/boot-recovery.error-context.test.ts +14 -16
  32. package/src/plugins/boot-recovery.external.test.ts +8 -7
  33. package/src/runtime/hyperlink.ts +1 -1
  34. package/src/runtime/popupBounds.test.ts +2 -2
  35. package/src/runtime/tooltipBridge.test.ts +1 -1
  36. package/src/scene3d/modelLayer.ts +2 -2
  37. package/src/utils/currency.test.ts +1 -1
  38. package/src/utils/currency.ts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celestia-island/hikari",
3
- "version": "0.55.436",
3
+ "version": "0.55.438",
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",
@@ -63,7 +63,7 @@ async function settle() {
63
63
  }
64
64
 
65
65
  function setMobile(mobile: boolean) {
66
- (window as unknown as { innerWidth: number }).innerWidth = mobile ? 500 : 1280;
66
+ window.innerWidth = mobile ? 500 : 1280;
67
67
  window.dispatchEvent(new Event("resize"));
68
68
  }
69
69
 
@@ -9,6 +9,14 @@
9
9
  align-items: center;
10
10
  justify-content: center;
11
11
  overflow: hidden;
12
+ /* Avatars are round — the letter fallback included (2026-11-20 user
13
+ report: the workspace roster's fallback chip rendered SQUARE because
14
+ this rule never rounded; every other avatar grammar in the two faces
15
+ — .s-user-avatar / .s-user-avatar-chip / the account modal's
16
+ rounded-full preview — already answers 50%, so the component was the
17
+ one square holdout). `overflow: hidden` above clips the <img> to the
18
+ same circle. */
19
+ border-radius: 50%;
12
20
  background-color: rgb(var(--color-muted, 108 108 108) / 15%);
13
21
  color: rgb(var(--color-text-secondary, 102 102 102));
14
22
  transition: all 0.2s ease;
@@ -84,6 +84,13 @@ describe("avatar letter-fallback optical centering (text-box guard)", () => {
84
84
  expect(ruleFor(css.adminTokens, ".s-user-avatar", "admin-tokens")).toContain("display: flex");
85
85
  });
86
86
 
87
+ it("hk-avatar: the fallback chip is ROUND (2026-11-20 square-chip report)", () => {
88
+ // The roster fallback rendered a SQUARE letter chip because this rule
89
+ // never rounded while every sibling avatar grammar answers 50% — the
90
+ // component was the one square holdout. Pin it so it stays round.
91
+ expect(ruleFor(css.avatar, ".hk-avatar", "avatar")).toContain("border-radius: 50%");
92
+ });
93
+
87
94
  it("hk-avatar-fallback: guard block swaps flex for block + centered trimmed line", () => {
88
95
  const body = supportsBody(css.avatar, SUPPORTS_PREAMBLE, "avatar");
89
96
  expect(guardedSelector(css.avatar, SUPPORTS_PREAMBLE, "avatar")).toBe(".hk-avatar-fallback");
@@ -953,19 +953,19 @@ export default defineComponent({
953
953
  frameAll(padding = 1.3, durationMs = 0) {
954
954
  if (!camera || !controls) return;
955
955
  const box = new THREE.Box3();
956
- let any = false;
956
+ let frameable = false;
957
957
  for (const def of registry.values()) {
958
958
  if (def.content === false) continue;
959
959
  // Skip what the MAIN camera cannot see (the minimap's helpers
960
960
  // live on their own layer): framing must never chase them.
961
961
  if (!def.object.layers.test(camera.layers)) continue;
962
962
  box.expandByObject(def.object);
963
- any = true;
963
+ frameable = true;
964
964
  }
965
965
  // Nothing frameable registered yet (an async page calling
966
966
  // frameAll before its content arrives): stay put rather than
967
967
  // framing whatever happens to be in the scene.
968
- if (!any || box.isEmpty()) return;
968
+ if (!frameable || box.isEmpty()) return;
969
969
  groundHandle?.fit(box);
970
970
  const sphere = box.getBoundingSphere(new THREE.Sphere());
971
971
  const dist = fitDistance(sphere.radius, camera.fov, camera.aspect) * padding;
@@ -25,7 +25,10 @@ import { dirname, join } from "node:path";
25
25
  import { fileURLToPath } from "node:url";
26
26
  import { createApp, h } from "vue";
27
27
 
28
- import HkEditableTable from "./HkEditableTable";
28
+ import HkEditableTable, {
29
+ type HkEditableCellSlotProps,
30
+ type HkEditableRowErrorSlotProps,
31
+ } from "./HkEditableTable";
29
32
 
30
33
  const here = dirname(fileURLToPath(import.meta.url));
31
34
  const source = readFileSync(join(here, "HkEditableTable.tsx"), "utf-8");
@@ -54,9 +57,12 @@ afterEach(() => {
54
57
  document.body.innerHTML = "";
55
58
  });
56
59
 
60
+ // The slot bag is forwarded to `h()` untouched (Vue's own `RawSlots` is
61
+ // `Record<string, unknown>`); each caller annotates its lambdas with the
62
+ // payload interface the component actually hands that slot.
57
63
  function mount(
58
64
  props: Record<string, unknown> = {},
59
- slots: Record<string, (payload: any) => unknown> = {},
65
+ slots: Record<string, unknown> = {},
60
66
  ): { container: HTMLElement; emitted: Array<{ event: string; args: unknown[] }> } {
61
67
  const container = document.createElement("div");
62
68
  document.body.appendChild(container);
@@ -120,9 +126,9 @@ describe("HkEditableTable composition", () => {
120
126
 
121
127
  describe("HkEditableTable slot contract", () => {
122
128
  it("renders an edit slot in place of the display slot", () => {
123
- const seen: any[] = [];
129
+ const seen: HkEditableCellSlotProps[] = [];
124
130
  const { container } = mount({}, {
125
- "edit-price": (payload: any) => {
131
+ "edit-price": (payload: HkEditableCellSlotProps) => {
126
132
  seen.push(payload);
127
133
  return h("input", { class: "host-editor", value: String(payload.value) });
128
134
  },
@@ -139,7 +145,7 @@ describe("HkEditableTable slot contract", () => {
139
145
 
140
146
  it("uses the display slot for columns without an editor", () => {
141
147
  const { container } = mount({}, {
142
- "cell-tier": (payload: any) => h("strong", { class: "tier-display" }, payload.value),
148
+ "cell-tier": (payload: HkEditableCellSlotProps) => h("strong", { class: "tier-display" }, String(payload.value)),
143
149
  });
144
150
  expect(container.querySelectorAll(".tier-display")).toHaveLength(2);
145
151
  // The other column still falls back to HkTable's text rendering.
@@ -149,7 +155,7 @@ describe("HkEditableTable slot contract", () => {
149
155
  it("falls back to the display slot when disabled", () => {
150
156
  const { container } = mount({ disabled: true }, {
151
157
  "edit-price": () => h("input", { class: "host-editor" }),
152
- "cell-price": (payload: any) => h("span", { class: "host-display" }, payload.value),
158
+ "cell-price": (payload: HkEditableCellSlotProps) => h("span", { class: "host-display" }, String(payload.value)),
153
159
  });
154
160
  expect(container.querySelector(".host-editor")).toBeNull();
155
161
  expect(container.querySelectorAll(".host-display")).toHaveLength(2);
@@ -157,11 +163,11 @@ describe("HkEditableTable slot contract", () => {
157
163
  });
158
164
 
159
165
  it("hands the row-error slot the invalid row", () => {
160
- const seen: any[] = [];
166
+ const seen: HkEditableRowErrorSlotProps[] = [];
161
167
  const { container } = mount(
162
168
  { validate: (row: Row) => (row.id === "b" ? "Price must be above zero" : null) },
163
169
  {
164
- "row-error": (payload: any) => {
170
+ "row-error": (payload: HkEditableRowErrorSlotProps) => {
165
171
  seen.push(payload);
166
172
  return h("span", { class: "custom-error" }, `! ${payload.error}`);
167
173
  },
@@ -252,7 +258,7 @@ describe("HkEditableTable per-row validation", () => {
252
258
 
253
259
  it("wires the editor's aria-describedby to the rendered error line", () => {
254
260
  const { container } = mount({ validate }, {
255
- "edit-price": (payload: any) =>
261
+ "edit-price": (payload: HkEditableCellSlotProps) =>
256
262
  h("input", {
257
263
  class: "host-editor",
258
264
  "aria-invalid": payload.error ? "true" : undefined,
@@ -137,7 +137,7 @@ describe("emergency alert layering contract", () => {
137
137
  // themes — the 0.55.370 bug).
138
138
  const scrim = root.match(/--hk-emergency-scrim:\s*rgb\(\s*(\d+)\s+(\d+)\s+(\d+)\s*\/\s*(\d+)%\s*\);/);
139
139
  expect(scrim, "the scrim must be a literal rgb(…) dark ink").not.toBeNull();
140
- const [, r, g, b, a] = scrim!.map(Number) as unknown as number[];
140
+ const [, r, g, b, a] = scrim!.map(Number);
141
141
  expect(Math.max(r, g, b)).toBeLessThan(60);
142
142
  expect(a).toBeGreaterThanOrEqual(40);
143
143
  // Wash: exactly one, and it derives from the LINE (the theme's
@@ -497,7 +497,7 @@ export const HkJsonTree = defineComponent({
497
497
  * root and receives every commit through `update:value`. */
498
498
  editable: { type: Boolean, default: false },
499
499
  },
500
- emits: ["update:value"],
500
+ emits: { "update:value": null },
501
501
  setup(props, { emit }) {
502
502
  const clipboard = useClipboard();
503
503
  const { t } = useI18n();
@@ -134,7 +134,7 @@ export default defineComponent({
134
134
  * for an empty dock slot), so every existing board is untouched. */
135
135
  dockMode: { type: String as PropType<"pin" | "ride">, default: "pin" },
136
136
  },
137
- emits: ["move"],
137
+ emits: { move: null },
138
138
  setup(props, { slots, emit, expose }) {
139
139
  const scrollHost = shallowRef<{ getScrollElement: () => HTMLElement | undefined } | null>(null);
140
140
  /** The card being dragged, kept at module scope of the setup so a drop
@@ -29,7 +29,7 @@ export default defineComponent({
29
29
  /** Full item count behind the windowed list. */
30
30
  total: { type: Number, default: undefined },
31
31
  },
32
- emits: ["loadMore"],
32
+ emits: { loadMore: null },
33
33
  setup(props, { emit }) {
34
34
  const { t } = useI18n();
35
35
  return () => {
@@ -31,7 +31,7 @@ export const HkLocalePicker = defineComponent({
31
31
  default: "en",
32
32
  },
33
33
  },
34
- emits: ["select"],
34
+ emits: { select: null },
35
35
  setup(props, { emit }) {
36
36
  const open = ref(false);
37
37
  const trigger = ref<HTMLElement | null>(null);
@@ -19,7 +19,7 @@ const HkLocalePickerPopup = defineComponent({
19
19
  currentLocale: { type: String, default: "" },
20
20
  t: { type: Function as PropType<(key: string) => string>, default: (k: string) => k },
21
21
  },
22
- emits: ["update:open", "select"],
22
+ emits: { "update:open": null, select: null },
23
23
  setup(props, { emit }) {
24
24
  const items: HkMenuItem[] = props.locales.map((loc) => ({
25
25
  key: loc.code,
@@ -125,13 +125,13 @@ describe("mermaid sub-app lifecycle pins", () => {
125
125
  const { container, set } = mount(DOC);
126
126
  await settleFor(container, ".hk-md-mermaid[data-mermaid='mounted']");
127
127
  const stale = container.querySelector(".hk-md-mermaid") as HTMLElement;
128
- expect((stale as unknown as Record<string, unknown>).__vue_app__).toBeTruthy();
128
+ expect((stale as { __vue_app__?: unknown }).__vue_app__).toBeTruthy();
129
129
 
130
130
  set(["Update:", "", "```mermaid", "sequenceDiagram", "X ->> Y: ping", "```"].join("\n"));
131
131
  await settleFor(container, ".hk-mermaid[data-mermaid-kind='sequence']");
132
132
  // The stale host left the document AND its app was unmounted.
133
133
  expect(stale.isConnected).toBe(false);
134
- expect((stale as unknown as Record<string, unknown>).__vue_app__).toBeUndefined();
134
+ expect((stale as { __vue_app__?: unknown }).__vue_app__).toBeUndefined();
135
135
  });
136
136
 
137
137
  it("renderer teardown unmounts every mermaid sub-app", async () => {
@@ -139,11 +139,11 @@ describe("mermaid sub-app lifecycle pins", () => {
139
139
  const { container } = mount(DOC);
140
140
  await settleFor(container, ".hk-md-mermaid[data-mermaid='mounted']");
141
141
  const host = container.querySelector(".hk-md-mermaid") as HTMLElement;
142
- expect((host as unknown as Record<string, unknown>).__vue_app__).toBeTruthy();
142
+ expect((host as { __vue_app__?: unknown }).__vue_app__).toBeTruthy();
143
143
 
144
144
  const entry = mounts[mounts.length - 1];
145
145
  entry.app.unmount();
146
- expect((host as unknown as Record<string, unknown>).__vue_app__).toBeUndefined();
146
+ expect((host as { __vue_app__?: unknown }).__vue_app__).toBeUndefined();
147
147
  expect(host.isConnected).toBe(false);
148
148
  });
149
149
  });
@@ -206,7 +206,7 @@ describe("mermaid streaming reuse", () => {
206
206
  const fresh = container.querySelector(".hk-md-mermaid") as HTMLElement;
207
207
  expect(fresh).not.toBe(first);
208
208
  expect(first.isConnected).toBe(false);
209
- expect((first as unknown as Record<string, unknown>).__vue_app__).toBeUndefined();
209
+ expect((first as { __vue_app__?: unknown }).__vue_app__).toBeUndefined();
210
210
  });
211
211
 
212
212
  it("retires the sub-app when the fence disappears from the body", async () => {
@@ -220,6 +220,6 @@ describe("mermaid streaming reuse", () => {
220
220
  await new Promise((r) => setTimeout(r, 60));
221
221
  await nextTick();
222
222
  expect(container.querySelector(".hk-md-mermaid")).toBeNull();
223
- expect((host as unknown as Record<string, unknown>).__vue_app__).toBeUndefined();
223
+ expect((host as { __vue_app__?: unknown }).__vue_app__).toBeUndefined();
224
224
  });
225
225
  });
@@ -203,7 +203,7 @@ export default defineComponent({
203
203
  */
204
204
  collapsed: { type: Boolean, default: false },
205
205
  },
206
- emits: ["update:open", "select"],
206
+ emits: { "update:open": null, select: null },
207
207
  setup(props, { emit, slots }) {
208
208
  const { isMobile } = useBreakpoint();
209
209
 
@@ -1,5 +1,5 @@
1
1
  import { afterEach, describe, expect, it } from "vitest";
2
- import { createApp, h, nextTick } from "vue";
2
+ import { createApp, h, nextTick, ref } from "vue";
3
3
 
4
4
  import HkMermaidDiagram from "./HkMermaidDiagram";
5
5
  import { buildBoardModel, heuristicTextWidth } from "../mermaid/layout";
@@ -110,17 +110,15 @@ describe("HkMermaidDiagram", () => {
110
110
  setMermaidEngineForTests(mermaidParser);
111
111
  const container = document.createElement("div");
112
112
  document.body.appendChild(container);
113
+ const source = ref(FLOWCHART);
113
114
  const app = createApp({
114
- data: () => ({ source: FLOWCHART }),
115
- render() {
116
- return h(HkMermaidDiagram, { source: (this as { source: string }).source });
117
- },
115
+ render: () => h(HkMermaidDiagram, { source: source.value }),
118
116
  });
119
117
  app.mount(container);
120
118
  mounts.push({ app, container });
121
119
  await settle();
122
120
  expect(container.querySelector(".hk-mermaid")?.getAttribute("data-mermaid-kind")).toBe("graph");
123
- (app as unknown as { _instance: { proxy: { source: string } } })._instance.proxy.source = "sequenceDiagram\nA ->> B: x";
121
+ source.value = "sequenceDiagram\nA ->> B: x";
124
122
  await settle();
125
123
  expect(container.querySelector(".hk-mermaid")?.getAttribute("data-mermaid-kind")).toBe("sequence");
126
124
  container.remove();
@@ -51,7 +51,7 @@ export const HkNavSidebar = defineComponent({
51
51
  default: false,
52
52
  },
53
53
  },
54
- emits: ["navigate"],
54
+ emits: { navigate: null },
55
55
  setup(props, { emit }) {
56
56
  return () => (
57
57
  <HSidebar width="224px">
@@ -293,16 +293,16 @@ export default defineComponent({
293
293
  default: undefined,
294
294
  },
295
295
  },
296
- emits: [
297
- "update:camera",
296
+ emits: {
297
+ "update:camera": null,
298
298
  /** An edge's hit stroke was entered/left (`null` on leave). */
299
- "edge-hover",
299
+ "edge-hover": null,
300
300
  /** An edge's hit stroke was clicked (not after a pan). */
301
- "edge-click",
301
+ "edge-click": null,
302
302
  /** An edge's hit stroke received a contextmenu (right-click, or a
303
303
  * synthesized touch long-press). Already `preventDefault()`ed. */
304
- "edge-contextmenu",
305
- ],
304
+ "edge-contextmenu": null,
305
+ },
306
306
  setup(props, { slots, emit, expose }) {
307
307
  const rootEl = shallowRef<HTMLElement | null>(null);
308
308
  const viewport = ref({ width: 0, height: 0 });
@@ -479,7 +479,7 @@ describe("HkRangeRibbon windowed view", () => {
479
479
 
480
480
  it("normalizes inverted, out-of-domain and degenerate windows; NaN means full", () => {
481
481
  // Inverted [0.8, 0.2] → [0.2, 0.8].
482
- const inverted = mountRibbon({ window: [0.8, 0.2] as unknown as [number, number] });
482
+ const inverted = mountRibbon({ window: [0.8, 0.2] as [number, number] });
483
483
  expect(boxOf(inverted.querySelector<HTMLElement>(".hk-range-ribbon-window")!).left).toBeCloseTo(
484
484
  20,
485
485
  4,
@@ -1544,7 +1544,7 @@ describe("HkRangeRibbon domain normalizer", () => {
1544
1544
  expect(normalizeHkRangeWindow([0.2, 0.4])).toEqual([0.2, 0.4]);
1545
1545
  expect(normalizeHkRangeWindow([0.2, 0.4], 0.02)).toEqual([0.2, 0.4]);
1546
1546
  expect(normalizeHkRangeWindow([0.2, 0.4], 0.02, null)).toEqual([0.2, 0.4]);
1547
- expect(normalizeHkRangeWindow([0.2, 0.4], 0.02, "nope" as unknown as number[])).toEqual([
1547
+ expect(normalizeHkRangeWindow([0.2, 0.4], 0.02, "nope" as never)).toEqual([
1548
1548
  0.2, 0.4,
1549
1549
  ]);
1550
1550
  // A zero-width domain has no interior: the unit axis takes over.
@@ -96,7 +96,7 @@ describe("HkScrollContainer dock slots", () => {
96
96
  },
97
97
  }));
98
98
  mounts.push(app);
99
- const host = (app.mount(container) as unknown as { $el: HTMLElement }).$el;
99
+ const host = app.mount(container).$el;
100
100
  const viewport = host.querySelector(".hk-scroll-container-viewport") as HTMLElement;
101
101
  Object.defineProperty(viewport, "scrollHeight", { value: 400, configurable: true });
102
102
  Object.defineProperty(viewport, "clientHeight", { value: 100, configurable: true });
@@ -147,7 +147,7 @@ describe("HkScrollContainer dock slots", () => {
147
147
  },
148
148
  }));
149
149
  mounts.push(app);
150
- const host = (app.mount(container) as unknown as { $el: HTMLElement }).$el;
150
+ const host = app.mount(container).$el;
151
151
  const viewport = host.querySelector(".hk-scroll-container-viewport") as HTMLElement;
152
152
  Object.defineProperty(viewport, "scrollHeight", { value: 400, configurable: true });
153
153
  Object.defineProperty(viewport, "clientHeight", { value: 100, configurable: true });
@@ -193,7 +193,7 @@ describe("HkScrollContainer dock slots", () => {
193
193
  },
194
194
  }));
195
195
  mounts.push(app);
196
- const host = (app.mount(container) as unknown as { $el: HTMLElement }).$el;
196
+ const host = app.mount(container).$el;
197
197
  const viewport = host.querySelector(".hk-scroll-container-viewport") as HTMLElement;
198
198
  Object.defineProperty(viewport, "scrollHeight", { value: 400, configurable: true });
199
199
  Object.defineProperty(viewport, "clientHeight", { value: 100, configurable: true });
@@ -241,7 +241,7 @@ describe("HkScrollContainer dock slots", () => {
241
241
  },
242
242
  }));
243
243
  mounts.push(app);
244
- const host = (app.mount(container) as unknown as { $el: HTMLElement }).$el;
244
+ const host = app.mount(container).$el;
245
245
  const viewport = host.querySelector(".hk-scroll-container-viewport") as HTMLElement;
246
246
  Object.defineProperty(viewport, "scrollHeight", { value: 400, configurable: true });
247
247
  Object.defineProperty(viewport, "clientHeight", { value: 100, configurable: true });
@@ -286,7 +286,7 @@ describe("HkScrollContainer dock slots", () => {
286
286
  },
287
287
  }));
288
288
  mounts.push(app);
289
- const host = (app.mount(container) as unknown as { $el: HTMLElement }).$el;
289
+ const host = app.mount(container).$el;
290
290
  const viewport = host.querySelector(".hk-scroll-container-viewport") as HTMLElement;
291
291
  const strength = () => host.style.getPropertyValue("--hk-scroll-dock-gate-bottom");
292
292
 
@@ -335,7 +335,7 @@ describe("HkScrollContainer dock slots", () => {
335
335
  },
336
336
  }));
337
337
  mounts.push(app);
338
- const host = (app.mount(container) as unknown as { $el: HTMLElement }).$el;
338
+ const host = app.mount(container).$el;
339
339
  const viewport = host.querySelector(".hk-scroll-container-viewport") as HTMLElement;
340
340
  const strength = () => host.style.getPropertyValue("--hk-scroll-dock-gate-bottom");
341
341
  const stub = (scrollTop: number) => {
@@ -106,7 +106,7 @@ function mountSwappable(
106
106
  },
107
107
  }));
108
108
  mounts.push(app);
109
- const vm = app.mount(container) as unknown as { $el: HTMLElement };
109
+ const vm = app.mount(container) as { $el: HTMLElement };
110
110
  return { host: vm.$el, mode };
111
111
  }
112
112
 
@@ -211,7 +211,7 @@ function mountWithApi(
211
211
  },
212
212
  }));
213
213
  mounts.push(app);
214
- const vm = app.mount(container) as unknown as { $el: HTMLElement };
214
+ const vm = app.mount(container) as { $el: HTMLElement };
215
215
  return { host: vm.$el, api };
216
216
  }
217
217
 
@@ -370,7 +370,7 @@ describe("HkScrollContainer ride-mode bottom dock", () => {
370
370
  },
371
371
  }));
372
372
  mounts.push(app);
373
- const host = (app.mount(container) as unknown as { $el: HTMLElement }).$el;
373
+ const host = app.mount(container).$el;
374
374
  expect(host.style.getPropertyValue("--hk-scroll-dock-bottom")).toBe("139px");
375
375
 
376
376
  show.value = false;
@@ -408,7 +408,7 @@ describe("HkScrollContainer ride-mode bottom dock", () => {
408
408
  },
409
409
  }));
410
410
  mounts.push(app);
411
- const host = (app.mount(container) as unknown as { $el: HTMLElement }).$el;
411
+ const host = app.mount(container).$el;
412
412
  expect(host.querySelector(".hk-scroll-dock[data-side='bottom']")).toBeTruthy();
413
413
  expect(host.style.getPropertyValue("--hk-scroll-dock-bottom")).toBe("139px");
414
414
 
@@ -490,7 +490,7 @@ describe("HkScrollContainer ride-mode bottom dock", () => {
490
490
  const rideWarnings = () =>
491
491
  warn.mock.calls.filter((call) => String(call[0]).includes('dockMode="ride"'));
492
492
  expect(rideWarnings().length, "the unsupported combination is called out").toBe(1);
493
- (vm as unknown as { $forceUpdate: () => void }).$forceUpdate();
493
+ vm.$forceUpdate();
494
494
  await nextTick();
495
495
  expect(rideWarnings().length, "once per mount, not per re-render").toBe(1);
496
496
  } finally {
@@ -755,7 +755,7 @@ describe("HkScrollContainer dock-size observer wiring", () => {
755
755
 
756
756
  function installFakeRO() {
757
757
  FakeResizeObserver.instances = [];
758
- globalThis.ResizeObserver = FakeResizeObserver as unknown as typeof ResizeObserver;
758
+ globalThis.ResizeObserver = FakeResizeObserver;
759
759
  }
760
760
 
761
761
  it("watches the dock wrapper it measures in both placements", () => {
@@ -831,7 +831,7 @@ describe("HkKanban ride-dock forwarding", () => {
831
831
  },
832
832
  }));
833
833
  mounts.push(app);
834
- return app.mount(container) as unknown as { $el: HTMLElement };
834
+ return app.mount(container) as { $el: HTMLElement };
835
835
  }
836
836
 
837
837
  it("forwards dockMode and the dockBottom slot onto the vertical strip", () => {
@@ -6,7 +6,8 @@
6
6
 
7
7
  .hk-serpentine {
8
8
  position: relative;
9
- height: calc(var(--space-24, 24px) * 4);
9
+ display: flex;
10
+ flex-direction: column;
10
11
  border-radius: var(--radius-md, 8px);
11
12
  border: 1px solid var(--border-faint);
12
13
  background: rgb(var(--color-surface) / 40%);
@@ -34,6 +35,14 @@
34
35
 
35
36
  }
36
37
 
38
+ .hk-serpentine-stage {
39
+ // The walk area: fixed rows, relative origin for the absolute svg and
40
+ // handle. The hint lives BELOW this block as normal flow, so the copy
41
+ // and the stroke can never overlap (device feedback, light theme).
42
+ position: relative;
43
+ height: calc(var(--space-24, 24px) * 3 + var(--space-16, 16px));
44
+ }
45
+
37
46
  .hk-serpentine-svg {
38
47
  position: absolute;
39
48
  inset: 0;
@@ -95,7 +104,7 @@
95
104
  // The generous top padding keeps the copy clear of the lane stroke —
96
105
  // a second device pass showed 8px reading as part of the graphic.
97
106
  display: block;
98
- padding: var(--space-16, 16px) var(--space-12, 12px) var(--space-4, 4px);
107
+ padding: var(--space-8, 8px) var(--space-12, 12px) var(--space-4, 4px);
99
108
  text-align: center;
100
109
  font-size: var(--text-xs, 0.75rem);
101
110
  color: rgb(var(--color-muted));
@@ -68,6 +68,7 @@ export default defineComponent({
68
68
  },
69
69
  setup(props, { emit }) {
70
70
  const viewport = ref<HTMLElement | null>(null);
71
+ const stage = ref<HTMLElement | null>(null);
71
72
  const seed = ref<number>(props.seed ?? Math.floor(Math.random() * 1e9));
72
73
  const path = ref<SerpentinePath>(generateSerpentinePath(600, 96, seed.value));
73
74
 
@@ -84,8 +85,8 @@ export default defineComponent({
84
85
  const laneHeight = ref(96);
85
86
 
86
87
  function regenerate() {
87
- laneWidth.value = viewport.value?.clientWidth || 600;
88
- laneHeight.value = viewport.value?.clientHeight || 96;
88
+ laneWidth.value = stage.value?.clientWidth || 600;
89
+ laneHeight.value = stage.value?.clientHeight || 96;
89
90
  path.value = generateSerpentinePath(
90
91
  laneWidth.value,
91
92
  laneHeight.value,
@@ -274,7 +275,7 @@ const TRACKING_TOLERANCE = 30;
274
275
 
275
276
  // Lane regenerates per mount (fresh maze each time).
276
277
  watch(
277
- () => viewport.value,
278
+ () => stage.value,
278
279
  (el) => {
279
280
  if (el) regenerate();
280
281
  },
@@ -315,33 +316,35 @@ const TRACKING_TOLERANCE = 30;
315
316
  onPointerup={onPointerUp}
316
317
  onPointercancel={onPointerCancel}
317
318
  >
318
- <svg
319
- class="hk-serpentine-svg"
320
- viewBox={`0 0 ${laneWidth.value} ${laneHeight.value}`}
321
- preserveAspectRatio="none"
322
- aria-hidden="true"
323
- >
324
- <polyline
325
- class="hk-serpentine-lane"
326
- points={pts.map((p) => `${p.x},${p.y}`).join(" ")}
327
- />
328
- <polyline
329
- class="hk-serpentine-travelled"
330
- points={pts.map((p) => `${p.x},${p.y}`).join(" ")}
319
+ <div class="hk-serpentine-stage" ref={stage}>
320
+ <svg
321
+ class="hk-serpentine-svg"
322
+ viewBox={`0 0 ${laneWidth.value} ${laneHeight.value}`}
323
+ preserveAspectRatio="none"
324
+ aria-hidden="true"
325
+ >
326
+ <polyline
327
+ class="hk-serpentine-lane"
328
+ points={pts.map((p) => `${p.x},${p.y}`).join(" ")}
329
+ />
330
+ <polyline
331
+ class="hk-serpentine-travelled"
332
+ points={pts.map((p) => `${p.x},${p.y}`).join(" ")}
333
+ style={{
334
+ strokeDasharray: `${path.value.totalLength}`,
335
+ strokeDashoffset: `${path.value.totalLength * (1 - progress.value)}`,
336
+ }}
337
+ />
338
+ </svg>
339
+ <div
340
+ class="hk-serpentine-handle"
331
341
  style={{
332
- strokeDasharray: `${path.value.totalLength}`,
333
- strokeDashoffset: `${path.value.totalLength * (1 - progress.value)}`,
342
+ left: `${handlePos.x}px`,
343
+ top: `${handlePos.y}px`,
334
344
  }}
345
+ aria-hidden="true"
335
346
  />
336
- </svg>
337
- <div
338
- class="hk-serpentine-handle"
339
- style={{
340
- left: `${handlePos.x}px`,
341
- top: `${handlePos.y}px`,
342
- }}
343
- aria-hidden="true"
344
- />
347
+ </div>
345
348
  <span class="hk-serpentine-hint" aria-live="polite">
346
349
  {confirmed.value
347
350
  ? "✓"
@@ -39,7 +39,7 @@ export default defineComponent({
39
39
  /** Accessible name for the whole group (aria-label). */
40
40
  label: { type: String, default: undefined },
41
41
  },
42
- emits: ["toggle"],
42
+ emits: { toggle: null },
43
43
  setup(props, { emit }) {
44
44
  return () => (
45
45
  <div class="hk-tag-dot-row" role="group" aria-label={props.label}>
@@ -177,7 +177,7 @@ describe("HkTerminal", () => {
177
177
  // Host-side retune wins over the defaults (happy-dom's computed
178
178
  // style doesn't resolve inline custom properties, so the retune arm
179
179
  // is exercised through a stubbed window computed-style).
180
- const fakeHost = { tag: "stub" } as unknown as HTMLElement;
180
+ const fakeHost = { tag: "stub" } as never;
181
181
  const resolver = (el: Element) =>
182
182
  el === fakeHost
183
183
  ? ({
@@ -60,7 +60,7 @@ export function formatZoneOffset(zone: string, at: Date = new Date()): string {
60
60
  /** `Intl.supportedValuesOf("timeZone")` where the runtime has it. */
61
61
  function supportedZoneIds(): readonly string[] {
62
62
  try {
63
- const supported = (Intl as unknown as { supportedValuesOf?: (key: string) => unknown })
63
+ const supported = (Intl as { supportedValuesOf?: (key: string) => unknown })
64
64
  .supportedValuesOf;
65
65
  if (typeof supported !== "function") return [];
66
66
  const ids = supported.call(Intl, "timeZone");
@@ -158,7 +158,7 @@ export default defineComponent({
158
158
  /** Accessible label for the waterfall region. */
159
159
  ariaLabel: { type: String, default: undefined },
160
160
  },
161
- emits: ["update:activeBucket", "update:backTopVisible"],
161
+ emits: { "update:activeBucket": null, "update:backTopVisible": null },
162
162
  setup(props, { slots, expose, emit }) {
163
163
  const scrollHost = shallowRef<ScrollHost | null>(null);
164
164
  const rootEl = shallowRef<HTMLElement | null>(null);
@@ -449,7 +449,7 @@ describe("HkWindowControls maximized glyph (the reported defect)", () => {
449
449
  const shell = stubShell(false);
450
450
  // A shell whose subscription silently yields nothing callable: the only
451
451
  // way the glyph can follow is the bounded fallback poll.
452
- (shell as unknown as { onResized: unknown }).onResized = () =>
452
+ (shell as { onResized: unknown }).onResized = () =>
453
453
  Promise.resolve(undefined);
454
454
 
455
455
  const t = mountControls({ variant: "standard" });
@@ -471,7 +471,7 @@ describe("HkWindowControls maximized glyph (the reported defect)", () => {
471
471
  vi.useFakeTimers();
472
472
  try {
473
473
  const shell = stubShell(false);
474
- (shell as unknown as { onResized: unknown }).onResized = () =>
474
+ (shell as { onResized: unknown }).onResized = () =>
475
475
  Promise.resolve(undefined);
476
476
  const t = mountControls({ variant: "standard" });
477
477
  await settle();
@@ -88,7 +88,7 @@ describe("markdown link activation", () => {
88
88
  });
89
89
 
90
90
  it("never lets the anchor default through (the webview must not navigate)", async () => {
91
- const open = vi.fn(() => ({}));
91
+ const open = vi.fn((_href?: string) => ({}));
92
92
  vi.stubGlobal("open", open);
93
93
 
94
94
  const locationBefore = window.location.href;
@@ -104,7 +104,7 @@ describe("markdown link activation", () => {
104
104
  expect(event.defaultPrevented).toBe(true);
105
105
  expect(window.location.href).toBe(locationBefore);
106
106
  expect(open).toHaveBeenCalledTimes(1);
107
- const firstCall = open.mock.calls[0] as unknown as [string] | undefined;
107
+ const firstCall = open.mock.calls[0];
108
108
  expect(firstCall?.[0]).toBe(new URL("cla.md", document.baseURI).href);
109
109
  });
110
110
 
@@ -13,14 +13,14 @@ type WasmHighlightFn = (code: string, language: string) => string | null;
13
13
 
14
14
  // Module-level state: the loaded wasm function (null until loaded).
15
15
  let wasmFn: WasmHighlightFn | null = null;
16
- let loadPromise: Promise<WasmHighlightFn> | null = null;
16
+ let loadPromise: Promise<WasmHighlightFn | null> | null = null;
17
17
 
18
18
  // Reactive version — bumped when the module finishes loading so
19
19
  // computed/render effects re-run and replace plain text with color.
20
20
  const version = ref(0);
21
21
 
22
22
  /** Load the wasm module on first use; cached thereafter. */
23
- function ensureLoaded(): Promise<WasmHighlightFn> {
23
+ function ensureLoaded(): Promise<WasmHighlightFn | null> {
24
24
  if (wasmFn) return Promise.resolve(wasmFn);
25
25
  if (!loadPromise) {
26
26
  loadPromise = import("../wasm/highlight/hikari_wasm_highlight.js")
@@ -32,7 +32,7 @@ function ensureLoaded(): Promise<WasmHighlightFn> {
32
32
  .catch(() => {
33
33
  // Module failed to load — stay plaintext forever.
34
34
  loadPromise = null;
35
- return null as unknown as WasmHighlightFn;
35
+ return null;
36
36
  });
37
37
  }
38
38
  return loadPromise;
@@ -80,8 +80,10 @@ function runScript(
80
80
  document.body.appendChild(loader);
81
81
 
82
82
  const timers: Array<() => void> = [];
83
- const FakeDate = { now: options.now ?? (() => 1_700_000_000_000) };
84
- (FakeDate as unknown as { prototype: unknown }).prototype = Date.prototype;
83
+ const FakeDate = {
84
+ now: options.now ?? (() => 1_700_000_000_000),
85
+ prototype: Date.prototype,
86
+ };
85
87
 
86
88
  const run = new Function(
87
89
  "location",
@@ -180,8 +180,10 @@ function runScript(
180
180
  "console",
181
181
  script,
182
182
  );
183
- const FakeDate = { now: options.now ?? (() => 1_700_000_000_000) };
184
- (FakeDate as unknown as { prototype: unknown }).prototype = Date.prototype;
183
+ const FakeDate = {
184
+ now: options.now ?? (() => 1_700_000_000_000),
185
+ prototype: Date.prototype,
186
+ };
185
187
  run(
186
188
  { protocol: "http:", hostname: "tauri.localhost", href: "http://tauri.localhost/" },
187
189
  document,
@@ -1005,15 +1007,12 @@ describe("the copy action", () => {
1005
1007
  it("falls back to execCommand when the Clipboard API is absent", async () => {
1006
1008
  const run = runScript(bootRecoveryScript(CTX_OPTION), {});
1007
1009
  paintedCard(run);
1008
- const doc = document as unknown as Record<string, unknown>;
1009
- const originalCreate = doc.createElement;
1010
- const originalExec = doc.execCommand;
1010
+ const originalCreate = document.createElement;
1011
+ const originalExec = document.execCommand;
1011
1012
  let seenValue = "";
1012
1013
  let command: string | null = null;
1013
- doc.createElement = ((tag: string) => {
1014
- const el = (
1015
- originalCreate as typeof document.createElement
1016
- ).call(document, tag);
1014
+ document.createElement = ((tag: string) => {
1015
+ const el = originalCreate.call(document, tag);
1017
1016
  if (tag === "textarea") {
1018
1017
  let value = "";
1019
1018
  Object.defineProperty(el, "value", {
@@ -1027,7 +1026,7 @@ describe("the copy action", () => {
1027
1026
  }
1028
1027
  return el;
1029
1028
  }) as typeof document.createElement;
1030
- doc.execCommand = (cmd: string) => {
1029
+ document.execCommand = (cmd: string) => {
1031
1030
  command = cmd;
1032
1031
  return true;
1033
1032
  };
@@ -1038,22 +1037,21 @@ describe("the copy action", () => {
1038
1037
  expect(seenValue).toContain('"reason"');
1039
1038
  expect(copyButtonOf(run).textContent).toBe(BOOT_RECOVERY_COPIED);
1040
1039
  } finally {
1041
- doc.createElement = originalCreate;
1042
- doc.execCommand = originalExec;
1040
+ document.createElement = originalCreate;
1041
+ document.execCommand = originalExec;
1043
1042
  }
1044
1043
  });
1045
1044
 
1046
1045
  it("reports the failed label when every path refuses", async () => {
1047
1046
  const run = runScript(bootRecoveryScript(CTX_OPTION), {});
1048
1047
  paintedCard(run);
1049
- const doc = document as unknown as Record<string, unknown>;
1050
- const originalExec = doc.execCommand;
1051
- doc.execCommand = () => false;
1048
+ const originalExec = document.execCommand;
1049
+ document.execCommand = () => false;
1052
1050
  try {
1053
1051
  await clickCopy(run);
1054
1052
  expect(copyButtonOf(run).textContent).toBe(BOOT_RECOVERY_COPY_FAILED);
1055
1053
  } finally {
1056
- doc.execCommand = originalExec;
1054
+ document.execCommand = originalExec;
1057
1055
  }
1058
1056
  });
1059
1057
 
@@ -26,6 +26,11 @@ import {
26
26
  bootRecoveryScript,
27
27
  } from "./boot-recovery.js";
28
28
 
29
+ // Vite types the hooks as `ObjectHook<Fn> | Fn`; these are plain functions
30
+ // here, so narrow once instead of spraying casts.
31
+ type Hook = (...args: unknown[]) => unknown;
32
+ const asFn = (hook: unknown): Hook => hook as Hook;
33
+
29
34
  /** Drive the plugin the way Vite does, without a real build. */
30
35
  function drivePlugin(
31
36
  plugin: ReturnType<typeof bootRecoveryPlugin>,
@@ -38,10 +43,6 @@ function drivePlugin(
38
43
  },
39
44
  warn() {},
40
45
  };
41
- // Vite types the hooks as `ObjectHook<Fn> | Fn`; these are plain functions
42
- // here, so narrow once instead of spraying casts.
43
- type Hook = (...args: unknown[]) => unknown;
44
- const asFn = (hook: unknown): Hook => hook as Hook;
45
46
  asFn(plugin.configResolved).call(ctx, { base } as never);
46
47
  asFn(plugin.generateBundle).call(ctx);
47
48
  const tags = asFn(plugin.transformIndexHtml).call(ctx, "", {
@@ -110,7 +111,7 @@ describe("dev server (external mode has no bundle to serve from)", () => {
110
111
  config: { base: "/" },
111
112
  middlewares: { use: (fn: (typeof handlers)[number]) => handlers.push(fn) },
112
113
  };
113
- (plugin.configureServer as unknown as (s: typeof server) => void)(server);
114
+ asFn(plugin.configureServer)(server);
114
115
  expect(handlers).toHaveLength(1);
115
116
 
116
117
  const served: { status?: number; headers?: Record<string, string>; body?: string } = {};
@@ -131,7 +132,7 @@ describe("dev server (external mode has no bundle to serve from)", () => {
131
132
  it("passes unrelated paths through", () => {
132
133
  const plugin = bootRecoveryPlugin({ external: true });
133
134
  const handlers: Array<(req: unknown, res: unknown, next: () => void) => void> = [];
134
- (plugin.configureServer as unknown as (s: unknown) => void)({
135
+ asFn(plugin.configureServer)({
135
136
  config: { base: "/" },
136
137
  middlewares: { use: (fn: (typeof handlers)[number]) => handlers.push(fn) },
137
138
  });
@@ -145,7 +146,7 @@ describe("dev server (external mode has no bundle to serve from)", () => {
145
146
  // hooks conditionally); it must simply register nothing.
146
147
  const handlers: unknown[] = [];
147
148
  const plugin = bootRecoveryPlugin();
148
- (plugin.configureServer as unknown as (s: unknown) => void)({
149
+ asFn(plugin.configureServer)({
149
150
  config: { base: "/" },
150
151
  middlewares: { use: (fn: unknown) => handlers.push(fn) },
151
152
  });
@@ -154,7 +154,7 @@ export async function openExternalHyperlink(url: string): Promise<boolean> {
154
154
  // `window.open` sink reachable. Cheap, so it guards itself.
155
155
  if (isDangerousHref(url)) return false;
156
156
  if (typeof window === "undefined") return false;
157
- const scope = window as unknown as TauriOpenerScope;
157
+ const scope = window as TauriOpenerScope;
158
158
 
159
159
  const opener = scope.__TAURI__?.opener;
160
160
  if (typeof opener?.openUrl === "function") {
@@ -31,7 +31,7 @@ function claimBand(bandInset: string): void {
31
31
  vi.spyOn(window, "getComputedStyle").mockReturnValue({
32
32
  getPropertyValue: (name: string) =>
33
33
  name === "--hk-chrome-band-inset" ? bandInset : "",
34
- } as unknown as CSSStyleDeclaration);
34
+ } as CSSStyleDeclaration);
35
35
  }
36
36
 
37
37
  describe("popupBounds chrome-band floor", () => {
@@ -64,7 +64,7 @@ describe("popupBounds chrome-band floor", () => {
64
64
  vi.spyOn(window, "getComputedStyle").mockReturnValue({
65
65
  getPropertyValue: (name: string) =>
66
66
  name === "--hk-chrome-band-inset" ? "48px" : "",
67
- } as unknown as CSSStyleDeclaration);
67
+ } as CSSStyleDeclaration);
68
68
  expect(popupViewportRect()).toEqual({ x: 0, y: 0, width: 1280, height: 800 });
69
69
  });
70
70
 
@@ -338,7 +338,7 @@ describe("tooltipBridge caption-band avoidance", () => {
338
338
  vi.spyOn(window, "getComputedStyle").mockReturnValue({
339
339
  getPropertyValue: (name: string) =>
340
340
  name === "--hk-chrome-band-inset" ? "48px" : "",
341
- } as unknown as CSSStyleDeclaration);
341
+ } as never);
342
342
  }
343
343
 
344
344
  it("places an unmarked trigger with the band-overlap avoidance default", () => {
@@ -337,12 +337,12 @@ export class ModelLayer {
337
337
  private parse(source: ArrayBuffer | string): Promise<{ scene?: THREE.Object3D; scenes?: THREE.Object3D[] }> {
338
338
  if (typeof source === "string") {
339
339
  return new Promise((resolve, reject) => {
340
- this.loader.load(source, (gltf) => resolve(gltf as never), undefined, (err) => reject(err));
340
+ this.loader.load(source, (gltf) => resolve({ scene: gltf.scene, scenes: gltf.scenes }), undefined, (err) => reject(err));
341
341
  });
342
342
  }
343
343
  // GLTFLoader.parse handles GLB and JSON buffers alike.
344
344
  return new Promise((resolve, reject) => {
345
- this.loader.parse(source, "", (gltf) => resolve(gltf as never), (err) => reject(err));
345
+ this.loader.parse(source, "", (gltf) => resolve({ scene: gltf.scene, scenes: gltf.scenes }), (err) => reject(err));
346
346
  });
347
347
  }
348
348
  }
@@ -201,7 +201,7 @@ describe("parseMoney", () => {
201
201
  "12e3",
202
202
  "--5",
203
203
  "1..2",
204
- null as unknown as string,
204
+ null as never,
205
205
  ]) {
206
206
  expect(parseMoney(raw, 2), `${JSON.stringify(raw)} must not parse`).toBeNull();
207
207
  }
@@ -403,7 +403,7 @@ export function currencyDisplayName(code: string, locale: string, fallback?: str
403
403
  const own = typeof fallback === "string" && fallback.trim() !== "" ? fallback.trim() : "";
404
404
  if (upper === "") return own;
405
405
  try {
406
- const DisplayNames = (Intl as unknown as { DisplayNames?: typeof Intl.DisplayNames })
406
+ const DisplayNames = (Intl as { DisplayNames?: typeof Intl.DisplayNames })
407
407
  .DisplayNames;
408
408
  if (typeof DisplayNames === "function") {
409
409
  const names = new DisplayNames([locale || "en"], {