@celestia-island/hikari 0.55.476 → 0.55.478

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.
@@ -165,6 +165,22 @@ export interface HkFaceShellUserPanelSlot {
165
165
  */
166
166
  export type HkFaceShellSlots = SlotsType<{
167
167
  header?: (params: HkFaceShellHeaderSlot) => VNode[];
168
+ /**
169
+ * The header sub-row: a host-owned band rendered directly under the
170
+ * header and ABOVE the document scroll viewport. It is the "which scope
171
+ * am I in" line — the console's active-platform strip is its first
172
+ * consumer — and it is deliberately NOT inside the header slot: the
173
+ * header's three-zone grid (avatar | centre group | actions) has no free
174
+ * row, and a host-owned title there would compete with the page-owned
175
+ * centre group for the same track.
176
+ *
177
+ * Geometry: no wrapper box of the shell's own — the slot's VNodes are
178
+ * the band's boxes, so a slot that renders nothing reserves nothing.
179
+ * The band does not scroll (it sits above the viewport), so it stays put
180
+ * while the page scrolls, and it never takes part in the content padding
181
+ * contract: the page body below keeps its gutters exactly as before.
182
+ */
183
+ headerExtra?: () => VNode[];
168
184
  sidebar?: (params: HkFaceShellSidebarSlot) => VNode[];
169
185
  userPanel?: (params: HkFaceShellUserPanelSlot) => VNode[];
170
186
  content?: () => VNode[];
@@ -32,6 +32,11 @@ export interface HkMenuItem {
32
32
  key: string;
33
33
  label: string;
34
34
  icon?: Component;
35
+ /** Marks the icon as a MARK (dot, bullet, status pip) rather than an
36
+ * illustration: the rail flip still TRAVELS it to its new position but
37
+ * never tweens its size — a dot's size is its meaning, and growing it
38
+ * across the flip reads as a glitch (2026-11-24 user direction). */
39
+ iconNoScale?: boolean;
35
40
  flag?: string;
36
41
  checked?: boolean;
37
42
  disabled?: boolean;
@@ -70,6 +70,16 @@
70
70
  * 4. Non-participating icons (identity blocks, group carets, badge
71
71
  * dots), the pills, and the labels crossfade exactly as before.
72
72
  *
73
+ * 4a. NO-SCALE GLYPHS (2026-11-24 user direction): a MARK — a dot, a
74
+ * bullet, a status pip — is not an illustration that happens to be
75
+ * small; its size IS its meaning, and tweening it reads as a glitch
76
+ * ("the dot balloons, then shrinks back"). Such cells carry
77
+ * `data-flip-noscale`, and the flight then travels the clone at the
78
+ * DESTINATION's size from the first frame — position continues, size
79
+ * never moves. Measured per pair (either end may opt in), because the
80
+ * two generations are different DOM and a row can gain or lose the
81
+ * mark between densities.
82
+ *
73
83
  * TIMING IS TOKEN-DERIVED, NOT HARDCODED (2026-11-02 user direction):
74
84
  * the flight window reads the theme's `--duration-normal` off the swap
75
85
  * host's computed style — the very variable HkCrossfade's dissolve
@@ -102,6 +112,10 @@
102
112
  */
103
113
  /** Row-key attribute on an icon cell that flies across a rail flip. */
104
114
  export declare const RAIL_FLIP_ICON_ATTR = "data-flip-icon";
115
+ /** Marks a flying icon cell whose GLYPH must not tween: it still travels
116
+ * to the destination (the motion is the point) but keeps its own size the
117
+ * whole way. See the "no-scale glyphs" note in the mechanism doc. */
118
+ export declare const RAIL_FLIP_NOSCALE_ATTR = "data-flip-noscale";
105
119
  /** Host attribute marking a flight in progress (drives the hide rule). */
106
120
  export declare const RAIL_FLIP_ACTIVE_ATTR = "data-flipping";
107
121
  /** Per-cell mark stamped on exactly the LEAVING icons that were paired
@@ -203,6 +203,7 @@ export { extOf, isImageFile, isAudioFile, codeLanguage, isCodeFile, isArchiveFil
203
203
  export { useReducedMotion } from "./composables/useReducedMotion";
204
204
  export { useSidebarRail, SIDEBAR_RAIL_PEEK_DELAY, SIDEBAR_RAIL_PEEK_GRACE, SIDEBAR_RAIL_PIN_FALLBACK, SIDEBAR_RAIL_CLIP_SELECTOR, SIDEBAR_RAIL_TOGGLE_BUTTON_SELECTOR, } from "./composables/useSidebarRail";
205
205
  export type { SidebarRailOptions, SidebarRailHandle } from "./composables/useSidebarRail";
206
+ export { RAIL_FLIP_ICON_ATTR, RAIL_FLIP_FLYING_ATTR, RAIL_FLIP_NOSCALE_ATTR, } from "./composables/useRailIconFlight";
206
207
  export { provideMenuGroupState, useMenuGroupState, } from "./composables/useMenuGroupState";
207
208
  export type { MenuGroupState } from "./composables/useMenuGroupState";
208
209
  export { drawnScale, frameMetrics, frameScale, laidOffsetWithin, laidSize, layoutOffset, layoutRect, nearestLaidAncestor, placePoint, } from "./composables/layoutGeometry";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celestia-island/hikari",
3
- "version": "0.55.476",
3
+ "version": "0.55.478",
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",
@@ -179,6 +179,11 @@ export const HkAdminShell = defineComponent({
179
179
  // shell that stops relaying the field goes red there.
180
180
  })
181
181
  : undefined,
182
+ // The header sub-row rides through verbatim: this face has no
183
+ // opinion on the band (it is the host's scope label, not chrome
184
+ // the wrapper can synthesize), and dropping it here would make
185
+ // the admin face silently narrower than the shell it composes.
186
+ headerExtra: slots.headerExtra,
182
187
  sidebar: slots.sidebar,
183
188
  userPanel: slots.userPanel,
184
189
  content: slots.content,
@@ -0,0 +1,208 @@
1
+ import { afterEach, describe, expect, it, vi } from "vitest";
2
+ import { createApp, defineComponent, h, nextTick, ref, type VNode } from "vue";
3
+
4
+ // HDrawer teleports and animates. This file never opens the drawer (the
5
+ // band sits outside the body that hosts it), so a deliberately MINIMAL
6
+ // closed-drawer stub is enough: it renders the slot only when open, with
7
+ // none of the `drawer-stub` body/footer classes HkFaceShell.test.tsx needs.
8
+ vi.mock("@celestia-island/hikari", async (importOriginal) => {
9
+ const actual = await importOriginal<typeof import("@celestia-island/hikari")>();
10
+ const { defineComponent, h } = await import("vue");
11
+ const HDrawerStub = defineComponent({
12
+ name: "HDrawer",
13
+ props: {
14
+ modelValue: { type: Boolean, default: false },
15
+ side: { type: String, default: "left" },
16
+ size: { type: String, default: "280px" },
17
+ title: { type: String, default: undefined },
18
+ panelClass: { type: String, default: undefined },
19
+ },
20
+ setup(props, { slots }) {
21
+ return () => (props.modelValue ? h("div", slots.default?.()) : null);
22
+ },
23
+ });
24
+ return { ...actual, HDrawer: HDrawerStub };
25
+ });
26
+
27
+ import { HkFaceShell } from "./HkFaceShell";
28
+ import { HkAdminShell } from "./HkAdminShell";
29
+
30
+ /**
31
+ * `headerExtra` — the header sub-row (2026-11-24). What this file pins:
32
+ *
33
+ * 1. GEOMETRY: the band renders directly under the header and ABOVE the
34
+ * body, so it inherits the header's full width and sits clear of the
35
+ * document scroll viewport — a scope line must not scroll away with
36
+ * the page it scopes.
37
+ * 2. NO WRAPPER: the slot's VNodes are the band's boxes. The shell adds
38
+ * no box of its own, so a host that styles its band keeps its own
39
+ * geometry, and an empty slot reserves nothing.
40
+ * 3. HkAdminShell RELAYS the slot verbatim: the admin wrapper has no
41
+ * opinion on the band, and dropping it there would make the admin face
42
+ * silently narrower than the shell it composes.
43
+ *
44
+ * (Repo test convention: raw createApp + container queries.)
45
+ */
46
+
47
+ const mounts: Array<{ app: ReturnType<typeof createApp>; container: HTMLElement }> = [];
48
+
49
+ function mount(node: VNode) {
50
+ const container = document.createElement("div");
51
+ document.body.appendChild(container);
52
+ const app = createApp({ render: () => node });
53
+ app.mount(container);
54
+ mounts.push({ app, container });
55
+ return container;
56
+ }
57
+
58
+ afterEach(() => {
59
+ for (const { app, container } of mounts.splice(0)) {
60
+ app.unmount();
61
+ container.remove();
62
+ }
63
+ });
64
+
65
+ const CONTENT = () => h("main", { class: "content-mock" }, "CONTENT");
66
+ const HEADER = () => h("div", { class: "header-mock" }, "HEADER");
67
+ const BAND = () => h("div", { class: "band-mock" }, "ACTIVE PANEL");
68
+
69
+ /** The shell's own boxes in DOM order, named by their first class. */
70
+ function ordered(c: HTMLElement, selector: string): string[] {
71
+ return [...c.querySelectorAll(selector)].map((el) => el.className.split(" ")[0]);
72
+ }
73
+
74
+ describe("HkFaceShell headerExtra", () => {
75
+ it("renders the band under the header and above the body, outside the scroll viewport", () => {
76
+ const c = mount(h(HkFaceShell, { navTitle: "Navigation" }, {
77
+ header: HEADER,
78
+ headerExtra: BAND,
79
+ content: CONTENT,
80
+ }));
81
+ const band = c.querySelector(".band-mock");
82
+ expect(band, "the band renders").toBeTruthy();
83
+ expect(band!.textContent).toBe("ACTIVE PANEL");
84
+ // Order: header → band → body (document mode's viewport lives inside body).
85
+ expect(ordered(c, ".header-mock,.band-mock,.s-admin-shell-body")).toEqual([
86
+ "header-mock",
87
+ "band-mock",
88
+ "s-admin-shell-body",
89
+ ]);
90
+ // The whole point: the band is NOT inside the scroll viewport.
91
+ expect(band!.closest(".hk-scroll-container-viewport")).toBeNull();
92
+ expect(band!.closest(".hk-scroll-container")).toBeNull();
93
+ expect(band!.closest(".s-admin-shell-body")).toBeNull();
94
+ // It is also not inside the header: the header's three-zone grid has
95
+ // no free row, and a host scope line must not compete with the page's
96
+ // centre group. The guard is the PARENT (the root), not `closest` — a
97
+ // band moved into the header wrapper becomes a SIBLING of the header
98
+ // mock, so `closest(".header-mock")` would stay null there (review R2).
99
+ expect(band!.parentElement).toBe(c.querySelector(".s-admin-shell"));
100
+ });
101
+
102
+ it("adds no wrapper box of its own — the slot's VNode IS the band", () => {
103
+ const c = mount(h(HkFaceShell, { navTitle: "Navigation" }, {
104
+ header: HEADER,
105
+ headerExtra: BAND,
106
+ content: CONTENT,
107
+ }));
108
+ const band = c.querySelector(".band-mock")!;
109
+ // The band's parent is the shell root itself, not an intermediate
110
+ // container the shell synthesized around the slot.
111
+ expect(band.parentElement!.classList.contains("s-admin-shell")).toBe(true);
112
+ // The header lives in the shell's own flex-shrink wrapper; the band
113
+ // sits beside that wrapper as a sibling, which is what keeps it out
114
+ // of the header's three-zone grid.
115
+ const headerBox = c.querySelector(".header-mock")!.parentElement!;
116
+ expect(headerBox.classList.contains("s-admin-shell")).toBe(false);
117
+ expect(band.previousElementSibling).toBe(headerBox);
118
+ });
119
+
120
+ it("reserves nothing when the slot is absent or empty, and renders exactly one band when filled", () => {
121
+ // Name each root child by its first class, or by its tag when it carries
122
+ // none (the header wrapper is a bare `<div style="flex-shrink: 0">`).
123
+ const rootChildren = (c: HTMLElement) =>
124
+ [...c.querySelector(".s-admin-shell")!.children]
125
+ .map((el) => el.className.split(" ")[0] || el.tagName.toLowerCase());
126
+ const absent = mount(h(HkFaceShell, { navTitle: "Navigation" }, {
127
+ header: HEADER, content: CONTENT,
128
+ }));
129
+ const empty = mount(h(HkFaceShell, { navTitle: "Navigation" }, {
130
+ header: HEADER, headerExtra: () => [], content: CONTENT,
131
+ }));
132
+ const filled = mount(h(HkFaceShell, { navTitle: "Navigation" }, {
133
+ header: HEADER, headerExtra: BAND, content: CONTENT,
134
+ }));
135
+ // Absent: the root holds the header wrapper and the body, nothing else.
136
+ expect(rootChildren(absent)).toEqual(["div", "s-admin-shell-body"]);
137
+ expect(absent.querySelector(".band-mock")).toBeNull();
138
+ // EMPTY slot ≡ absent: the literal "an empty slot reserves nothing".
139
+ // (The header wrapper is conditional on `slots.header`, so both mounts
140
+ // carry it; the list is identical.)
141
+ expect(rootChildren(empty)).toEqual(rootChildren(absent));
142
+ expect(empty.querySelector(".band-mock")).toBeNull();
143
+ // Filled: exactly ONE band, as the body's immediately preceding sibling.
144
+ // Asserting the full list (not a count delta) is what catches a shell-
145
+ // synthesized wrapper AND a duplicate render (review R2, M2 / M6).
146
+ expect(rootChildren(filled)).toEqual(["div", "band-mock", "s-admin-shell-body"]);
147
+ expect(filled.querySelectorAll(".band-mock").length).toBe(1);
148
+ const band = filled.querySelector(".band-mock")!;
149
+ expect(band.nextElementSibling).toBe(filled.querySelector(".s-admin-shell-body"));
150
+ // The main region is untouched by the band in every case.
151
+ expect(filled.querySelector(".s-admin-shell-main")!.children.length)
152
+ .toBe(absent.querySelector(".s-admin-shell-main")!.children.length);
153
+ });
154
+
155
+ it("keeps the band outside the contentKey crossfade so a page swap leaves it in place", async () => {
156
+ // A tiny host whose key is a ref, so the swap is driven for real: the
157
+ // ruling's promise is "a page swap leaves the band in place", and that
158
+ // is only testable by swapping (review R2).
159
+ const page = ref("page-a");
160
+ const Host = defineComponent({
161
+ setup() {
162
+ return () => h(HkFaceShell, { navTitle: "Navigation", contentKey: page.value }, {
163
+ header: HEADER,
164
+ headerExtra: BAND,
165
+ content: () => h("main", { class: "content-mock" }, page.value),
166
+ });
167
+ },
168
+ });
169
+ const c = mount(h(Host));
170
+ const bandBefore = c.querySelector(".band-mock");
171
+ expect(bandBefore, "the band renders").toBeTruthy();
172
+ expect(bandBefore!.closest(".hk-crossfade")).toBeNull();
173
+ expect(bandBefore!.closest(".s-admin-shell-swap")).toBeNull();
174
+ expect(c.querySelector('[data-crossfade-key="page-a"] .content-mock')!.textContent).toBe("page-a");
175
+ page.value = "page-b";
176
+ await nextTick();
177
+ // The page changed: the ENTERING crossfade item carries the new key
178
+ // (the leaving item stays in the DOM for its exit transition, which is
179
+ // why the lookup is by key rather than first-match)…
180
+ expect(c.querySelector('[data-crossfade-key="page-b"] .content-mock')!.textContent).toBe("page-b");
181
+ // …and the band is the SAME DOM node, not a re-mount. (This identity
182
+ // line catches a re-MOUNT; "band inside the crossfade" is caught by
183
+ // the structural `closest(".hk-crossfade")` guard above — Vue re-
184
+ // PARENTS a slot vnode into the entering item without re-mounting it,
185
+ // so identity alone would not notice. Review R3.)
186
+ expect(c.querySelector(".band-mock")).toBe(bandBefore);
187
+ });
188
+ });
189
+
190
+ describe("HkAdminShell relays headerExtra", () => {
191
+ it("passes the band through to the inner shell unchanged", () => {
192
+ // HkAdminShell provides its own action bar; mount it bare.
193
+ const c = mount(h(HkAdminShell, { navTitle: "Navigation" }, {
194
+ header: () => h("div", { class: "header-mock" }, "HEADER"),
195
+ headerExtra: BAND,
196
+ content: CONTENT,
197
+ }));
198
+ const band = c.querySelector(".band-mock");
199
+ expect(band, "the admin face renders the host's band").toBeTruthy();
200
+ expect(band!.textContent).toBe("ACTIVE PANEL");
201
+ expect(ordered(c, ".header-mock,.band-mock,.s-admin-shell-body")).toEqual([
202
+ "header-mock",
203
+ "band-mock",
204
+ "s-admin-shell-body",
205
+ ]);
206
+ expect(band!.closest(".hk-scroll-container-viewport")).toBeNull();
207
+ });
208
+ });
@@ -230,6 +230,22 @@ export interface HkFaceShellUserPanelSlot {
230
230
  */
231
231
  export type HkFaceShellSlots = SlotsType<{
232
232
  header?: (params: HkFaceShellHeaderSlot) => VNode[];
233
+ /**
234
+ * The header sub-row: a host-owned band rendered directly under the
235
+ * header and ABOVE the document scroll viewport. It is the "which scope
236
+ * am I in" line — the console's active-platform strip is its first
237
+ * consumer — and it is deliberately NOT inside the header slot: the
238
+ * header's three-zone grid (avatar | centre group | actions) has no free
239
+ * row, and a host-owned title there would compete with the page-owned
240
+ * centre group for the same track.
241
+ *
242
+ * Geometry: no wrapper box of the shell's own — the slot's VNodes are
243
+ * the band's boxes, so a slot that renders nothing reserves nothing.
244
+ * The band does not scroll (it sits above the viewport), so it stays put
245
+ * while the page scrolls, and it never takes part in the content padding
246
+ * contract: the page body below keeps its gutters exactly as before.
247
+ */
248
+ headerExtra?: () => VNode[];
233
249
  sidebar?: (params: HkFaceShellSidebarSlot) => VNode[];
234
250
  userPanel?: (params: HkFaceShellUserPanelSlot) => VNode[];
235
251
  content?: () => VNode[];
@@ -549,6 +565,13 @@ export const HkFaceShell = defineComponent({
549
565
  </div>
550
566
  )}
551
567
 
568
+ {/* The header sub-row: directly under the header, above the
569
+ body — so it inherits the header's full width and sits clear
570
+ of the content viewport's scrolling. Slot VNodes are NOT
571
+ wrapped: the consumer's element IS the band (see the slot
572
+ doc), and an empty slot renders no box at all. */}
573
+ {slots.headerExtra?.()}
574
+
552
575
  <div class="s-admin-shell-body" style={{ paddingBottom: footerPad() }}>
553
576
  {isDesktop.value && !props.sidebarCollapsed && slots.sidebar && (
554
577
  props.sidebarCollapsible ? (
@@ -7,7 +7,10 @@ import { createApp, h, nextTick, ref, type Ref } from "vue";
7
7
  import { Home, Settings } from "lucide-vue-next";
8
8
 
9
9
  import HkMenu, { type HkMenuItem } from "./HkMenu";
10
- import { RAIL_FLIP_ICON_ATTR } from "../composables/useRailIconFlight";
10
+ import {
11
+ RAIL_FLIP_ICON_ATTR,
12
+ RAIL_FLIP_NOSCALE_ATTR,
13
+ } from "../composables/useRailIconFlight";
11
14
 
12
15
  /**
13
16
  * HkMenu sidebar-variant ICON-RAIL mode (collapsed prop, 2026-10-30):
@@ -447,6 +450,42 @@ describe("HkMenu sidebar icon rail", () => {
447
450
  expect(glyph.textContent).toBe("D");
448
451
  });
449
452
 
453
+ // 2026-11-24 user direction: a MARK (dot/bullet/pip) must not tween its
454
+ // size across the density flip — it travels, it never grows. The host
455
+ // opts a row in through `iconNoScale`; the cell the flight pairs must
456
+ // then carry the no-scale attribute in BOTH densities, or the dot quietly
457
+ // rejoins the size tween.
458
+ // MUT:mut-attr-unstamped — unstamping the cells turns this test RED (this
459
+ // is the very gap the attribute exists to close).
460
+ it("carries iconNoScale onto the rail cell as data-flip-noscale", () => {
461
+ // Ordinary icon: keeps the size tween (no attribute).
462
+ const plain = mountMenu([{ key: "home", label: "Home", icon: Home }], {
463
+ collapsed: true,
464
+ });
465
+ const plainCell = plain.querySelector<HTMLElement>(
466
+ `.hk-menu-item-icon[${RAIL_FLIP_ICON_ATTR}="home"]`,
467
+ );
468
+ expect(plainCell, "the rail row stamps its icon cell").toBeTruthy();
469
+ expect(
470
+ plainCell!.hasAttribute(RAIL_FLIP_NOSCALE_ATTR),
471
+ "an ordinary icon keeps the size tween",
472
+ ).toBe(false);
473
+
474
+ // Mark: opts out of the tween.
475
+ const mark = mountMenu(
476
+ [{ key: "dot", label: "Dot", icon: Home, iconNoScale: true }],
477
+ { collapsed: true },
478
+ );
479
+ const markCell = mark.querySelector<HTMLElement>(
480
+ `.hk-menu-item-icon[${RAIL_FLIP_ICON_ATTR}="dot"]`,
481
+ );
482
+ expect(markCell, "the mark's cell is stamped too").toBeTruthy();
483
+ expect(
484
+ markCell!.hasAttribute(RAIL_FLIP_NOSCALE_ATTR),
485
+ "iconNoScale must reach the cell the flight pairs",
486
+ ).toBe(true);
487
+ });
488
+
450
489
  it("stamps every icon cell with data-flip-icon = the row key, in BOTH densities", () => {
451
490
  // The rail flip's icon flight (useRailIconFlight) pairs the leaving
452
491
  // and entering copies of ONE destination by this attribute; a cell
@@ -54,6 +54,11 @@ export interface HkMenuItem {
54
54
  key: string;
55
55
  label: string;
56
56
  icon?: Component;
57
+ /** Marks the icon as a MARK (dot, bullet, status pip) rather than an
58
+ * illustration: the rail flip still TRAVELS it to its new position but
59
+ * never tweens its size — a dot's size is its meaning, and growing it
60
+ * across the flip reads as a glitch (2026-11-24 user direction). */
61
+ iconNoScale?: boolean;
57
62
  flag?: string;
58
63
  checked?: boolean;
59
64
  disabled?: boolean;
@@ -956,7 +961,11 @@ export default defineComponent({
956
961
  // data-flip-icon: the row key opts this cell into the rail
957
962
  // flip's icon flight (useRailIconFlight) — the flight pairs
958
963
  // the leaving and entering copies of ONE destination by it.
959
- <span class="hk-menu-item-icon" data-flip-icon={item.key}>
964
+ <span
965
+ class="hk-menu-item-icon"
966
+ data-flip-icon={item.key}
967
+ data-flip-noscale={item.iconNoScale ? true : undefined}
968
+ >
960
969
  {h(item.icon, { size: 16 })}
961
970
  </span>
962
971
  )}
@@ -992,7 +1001,9 @@ export default defineComponent({
992
1001
  Still conditional: an icon-less group renders no cell
993
1002
  here, exactly as before. */}
994
1003
  {item.icon && (
995
- <span class="hk-menu-item-icon" data-flip-icon={item.key}>
1004
+ <span class="hk-menu-item-icon" data-flip-icon={item.key}
1005
+ data-flip-noscale={item.iconNoScale ? true : undefined}
1006
+ >
996
1007
  {h(item.icon, { size: 16 })}
997
1008
  </span>
998
1009
  )}
@@ -1067,6 +1078,9 @@ export default defineComponent({
1067
1078
  <span
1068
1079
  class="hk-menu-item-icon"
1069
1080
  data-flip-icon={item.key}
1081
+ // A LETTER fallback is a mark, not an illustration: its size is
1082
+ // its identity, so the flight must not tween it (2026-11-24).
1083
+ data-flip-noscale={item.iconNoScale || !item.icon ? true : undefined}
1070
1084
  data-fallback={item.icon ? undefined : true}
1071
1085
  >
1072
1086
  {item.icon ? h(item.icon, { size: 16 }) : item.label.trim().charAt(0).toUpperCase()}
@@ -1130,7 +1144,11 @@ export default defineComponent({
1130
1144
  {railCaret(expanded, 16)}
1131
1145
  </span>
1132
1146
  {item.icon && (
1133
- <span class="hk-menu-rail-glyph-corner" data-flip-icon={item.key}>
1147
+ <span
1148
+ class="hk-menu-rail-glyph-corner"
1149
+ data-flip-icon={item.key}
1150
+ data-flip-noscale={item.iconNoScale ? true : undefined}
1151
+ >
1134
1152
  {h(item.icon, { size: 10 })}
1135
1153
  </span>
1136
1154
  )}
@@ -6,6 +6,7 @@ import {
6
6
  RAIL_FLIGHT_MS,
7
7
  RAIL_FLIGHT_SWEEP_MARGIN_MS,
8
8
  RAIL_FLIP_ACTIVE_ATTR,
9
+ RAIL_FLIP_NOSCALE_ATTR,
9
10
  RAIL_FLIP_FLYING_ATTR,
10
11
  RAIL_FLIP_ICON_ATTR,
11
12
  RAIL_FLIP_ITEM_ATTR,
@@ -670,4 +671,40 @@ describe("useRailIconFlight", () => {
670
671
  );
671
672
  });
672
673
 
674
+ // 2026-11-24 user direction: a MARK (dot/bullet/pip) keeps its size across
675
+ // the flip — its size IS its meaning, and a tween reads as the dot
676
+ // ballooning then snapping back. Same geometry as the test above, so the
677
+ // ONLY difference is the opt-in attribute.
678
+ it("keeps a no-scale mark's size constant while it travels", async () => {
679
+ const h = mountSwap();
680
+ await h.set(true);
681
+ const { leaving, entering } = dissolvePair(h, true);
682
+ stubRect(h.swap(), rect(0, 0, 240, 400));
683
+ stubIcons(leaving, (key) => rect(32, key === "home" ? 100 : 140, 16, 16));
684
+ stubIcons(entering, (key) =>
685
+ key === "home" ? rect(40, 104, 10, 10) : rect(20, 140, 10, 10),
686
+ );
687
+ // Mark the HOME pair's DESTINATION as a mark; the other pair keeps the
688
+ // tween, so one flip proves both branches at once.
689
+ entering
690
+ .querySelector<HTMLElement>('[data-flip-icon="home"]')!
691
+ .setAttribute(RAIL_FLIP_NOSCALE_ATTR, "");
692
+
693
+ await vi.advanceTimersByTimeAsync(0);
694
+
695
+ const clones = [...flightLayer(h)!.querySelectorAll<HTMLElement>(".hk-sidebar-rail-flight-clone")];
696
+ expect(clones, "both pairs fly").toHaveLength(2);
697
+ const markClone = clones.find((c) => c.textContent === "H")!;
698
+ // Painted at its OWN size from frame 0 (10px, not the 16px it leaves
699
+ // at), centered on the leaving center: 40 − 10/2 = 35.
700
+ expect(markClone.style.width, "the mark is painted at its own size").toBe("10px");
701
+ expect(markClone.style.height).toBe("10px");
702
+ expect(markClone.style.insetInlineStart).toBe("35px");
703
+ const markAnim = animations.find((a) => a.el.textContent === "H")!;
704
+ expect(markAnim.keyframes.at(-1)!.transform).toBe(
705
+ "translate(5px, 1px) scale(1, 1)",
706
+ // The transform still carries the travel; its scale stays identity.
707
+ );
708
+ });
709
+
673
710
  });
@@ -75,6 +75,16 @@ import { releaseMediaQuery, useMediaQuery } from "../runtime/useMediaQuery";
75
75
  * 4. Non-participating icons (identity blocks, group carets, badge
76
76
  * dots), the pills, and the labels crossfade exactly as before.
77
77
  *
78
+ * 4a. NO-SCALE GLYPHS (2026-11-24 user direction): a MARK — a dot, a
79
+ * bullet, a status pip — is not an illustration that happens to be
80
+ * small; its size IS its meaning, and tweening it reads as a glitch
81
+ * ("the dot balloons, then shrinks back"). Such cells carry
82
+ * `data-flip-noscale`, and the flight then travels the clone at the
83
+ * DESTINATION's size from the first frame — position continues, size
84
+ * never moves. Measured per pair (either end may opt in), because the
85
+ * two generations are different DOM and a row can gain or lose the
86
+ * mark between densities.
87
+ *
78
88
  * TIMING IS TOKEN-DERIVED, NOT HARDCODED (2026-11-02 user direction):
79
89
  * the flight window reads the theme's `--duration-normal` off the swap
80
90
  * host's computed style — the very variable HkCrossfade's dissolve
@@ -108,6 +118,11 @@ import { releaseMediaQuery, useMediaQuery } from "../runtime/useMediaQuery";
108
118
 
109
119
  /** Row-key attribute on an icon cell that flies across a rail flip. */
110
120
  export const RAIL_FLIP_ICON_ATTR = "data-flip-icon";
121
+
122
+ /** Marks a flying icon cell whose GLYPH must not tween: it still travels
123
+ * to the destination (the motion is the point) but keeps its own size the
124
+ * whole way. See the "no-scale glyphs" note in the mechanism doc. */
125
+ export const RAIL_FLIP_NOSCALE_ATTR = "data-flip-noscale";
111
126
  /** Host attribute marking a flight in progress (drives the hide rule). */
112
127
  export const RAIL_FLIP_ACTIVE_ATTR = "data-flipping";
113
128
  /** Per-cell mark stamped on exactly the LEAVING icons that were paired
@@ -153,6 +168,8 @@ interface FlightPair {
153
168
  to: DOMRect;
154
169
  color: string;
155
170
  template: HTMLElement;
171
+ /** A MARK (dot/bullet/pip): travels, never changes size (see 4a). */
172
+ noScale: boolean;
156
173
  }
157
174
 
158
175
  /** What one flight needs from the swap: the paired icons. */
@@ -278,6 +295,12 @@ export function useRailIconFlight(
278
295
  to: toRect,
279
296
  color: getComputedStyle(fromEl).color,
280
297
  template: toEl,
298
+ // A MARK keeps its size (see 4a): either end opting in pins the
299
+ // clone to the destination size — a dot's size IS its meaning, and
300
+ // a tween reads as the dot ballooning and snapping back.
301
+ noScale:
302
+ fromEl.hasAttribute(RAIL_FLIP_NOSCALE_ATTR) ||
303
+ toEl.hasAttribute(RAIL_FLIP_NOSCALE_ATTR),
281
304
  });
282
305
  }
283
306
  return { pairs };
@@ -361,9 +384,6 @@ export function useRailIconFlight(
361
384
  // is origin.right − from.right; the sign the other way round
362
385
  // pushed every clone outside the docked edge and the clip ate the
363
386
  // whole flight — 2026-11-02 review).
364
- const inlineOffset = rtl
365
- ? origin.right - pair.from.right
366
- : pair.from.left - origin.left;
367
387
  // CENTER-ALIGNED travel + SIZE TWEEN (2026-11-20 user direction):
368
388
  // a glyph whose density size differs (the rail group's demoted
369
389
  // corner badge) must grow/shrink CONTINUOUSLY. The clone is painted
@@ -377,18 +397,41 @@ export function useRailIconFlight(
377
397
  const toCenterY = pair.to.top + pair.to.height / 2;
378
398
  const dx = (toCenterX - fromCenterX) / scale.x;
379
399
  const dy = (toCenterY - fromCenterY) / scale.y;
380
- const sx = pair.from.width ? pair.to.width / pair.from.width : 1;
381
- const sy = pair.from.height ? pair.to.height / pair.from.height : 1;
400
+ // A no-scale mark is painted at the DESTINATION size from frame 0, so
401
+ // the transform never contains a scale at all (a `scale(1)` would
402
+ // still be a no-op today but leaves the door open for the size tween
403
+ // to creep back in through a later edit).
404
+ const paintedW = pair.noScale ? pair.to.width : pair.from.width;
405
+ const paintedH = pair.noScale ? pair.to.height : pair.from.height;
406
+ const sx = pair.noScale
407
+ ? 1
408
+ : pair.from.width
409
+ ? pair.to.width / pair.from.width
410
+ : 1;
411
+ const sy = pair.noScale
412
+ ? 1
413
+ : pair.from.height
414
+ ? pair.to.height / pair.from.height
415
+ : 1;
382
416
  const clone = pair.template.cloneNode(true) as HTMLElement;
383
417
  // Neutralize identity: the clone must never match a future pairing
384
418
  // query nor the hide rule — it is the flight layer's own citizen.
385
419
  clone.removeAttribute(RAIL_FLIP_ICON_ATTR);
386
420
  clone.removeAttribute(RAIL_FLIP_FLYING_ATTR);
387
421
  clone.className = "hk-sidebar-rail-flight-clone";
388
- clone.style.insetInlineStart = `${inlineOffset / scale.x}px`;
389
- clone.style.insetBlockStart = `${(pair.from.top - origin.top) / scale.y}px`;
390
- clone.style.width = `${pair.from.width / scale.x}px`;
391
- clone.style.height = `${pair.from.height / scale.y}px`;
422
+ // Center-aligned travel for both kinds: the painted box is centered on
423
+ // the LEAVING center and travels to the DESTINATION center, so a
424
+ // constant-size mark and a tweening glyph share one code path — only
425
+ // the scale differs (a mark's is identity).
426
+ const paintLeft = pair.from.left + pair.from.width / 2 - paintedW / 2;
427
+ const paintTop = pair.from.top + pair.from.height / 2 - paintedH / 2;
428
+ const paintInlineOffset = rtl
429
+ ? origin.right - (paintLeft + paintedW)
430
+ : paintLeft - origin.left;
431
+ clone.style.insetInlineStart = `${paintInlineOffset / scale.x}px`;
432
+ clone.style.insetBlockStart = `${(paintTop - origin.top) / scale.y}px`;
433
+ clone.style.width = `${paintedW / scale.x}px`;
434
+ clone.style.height = `${paintedH / scale.y}px`;
392
435
  clone.style.color = pair.color;
393
436
  // Pure travel: full opacity the whole way, `fill: forwards` so a
394
437
  // frame that slips past finish still shows the clone AT the
package/src/index.ts CHANGED
@@ -587,6 +587,15 @@ export {
587
587
  SIDEBAR_RAIL_TOGGLE_BUTTON_SELECTOR,
588
588
  } from "./composables/useSidebarRail";
589
589
  export type { SidebarRailOptions, SidebarRailHandle } from "./composables/useSidebarRail";
590
+ // The rail flip's icon continuations vocabulary: a host that renders its own
591
+ // rail glyph cells (bespoke sidebar markup) stamps these attributes directly.
592
+ // `iconNoScale` on HkMenuItem is the component-level spelling of the same
593
+ // contract for hosts that go through HkMenu.
594
+ export {
595
+ RAIL_FLIP_ICON_ATTR,
596
+ RAIL_FLIP_FLYING_ATTR,
597
+ RAIL_FLIP_NOSCALE_ATTR,
598
+ } from "./composables/useRailIconFlight";
590
599
  // The sidebar GROUP FOLD store (known-live-issues #43). HkFaceShell and
591
600
  // HkSidebar provide one above their rail swap, so slot content THEY own
592
601
  // shares the fold across density generations. A host that defines the