@celestia-island/hikari 0.55.480 → 0.55.483

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 (33) hide show
  1. package/dist/types/components/HkLoginFlow.d.ts +17 -5
  2. package/package.json +1 -1
  3. package/src/components/HkAdminHeader.test.tsx +36 -0
  4. package/src/components/HkAdminHeader.tsx +34 -7
  5. package/src/components/HkBadge.scss +12 -0
  6. package/src/components/HkBadge.test.tsx +26 -0
  7. package/src/components/HkLoginFlow.scss +13 -9
  8. package/src/components/HkLoginFlow.test.tsx +123 -43
  9. package/src/components/HkLoginFlow.tsx +25 -20
  10. package/src/components/adminHeaderBrand.contract.test.ts +26 -13
  11. package/src/i18n/locales/ar/components.json +1 -0
  12. package/src/i18n/locales/ar/components.toml +1 -0
  13. package/src/i18n/locales/de/components.json +1 -0
  14. package/src/i18n/locales/de/components.toml +1 -0
  15. package/src/i18n/locales/en/components.json +1 -0
  16. package/src/i18n/locales/en/components.toml +1 -0
  17. package/src/i18n/locales/es/components.json +1 -0
  18. package/src/i18n/locales/es/components.toml +1 -0
  19. package/src/i18n/locales/fr/components.json +1 -0
  20. package/src/i18n/locales/fr/components.toml +1 -0
  21. package/src/i18n/locales/ja/components.json +1 -0
  22. package/src/i18n/locales/ja/components.toml +1 -0
  23. package/src/i18n/locales/ko/components.json +1 -0
  24. package/src/i18n/locales/ko/components.toml +1 -0
  25. package/src/i18n/locales/pt/components.json +1 -0
  26. package/src/i18n/locales/pt/components.toml +1 -0
  27. package/src/i18n/locales/ru/components.json +1 -0
  28. package/src/i18n/locales/ru/components.toml +1 -0
  29. package/src/i18n/locales/zh-Hans/components.json +1 -0
  30. package/src/i18n/locales/zh-Hans/components.toml +1 -0
  31. package/src/i18n/locales/zh-Hant/components.json +1 -0
  32. package/src/i18n/locales/zh-Hant/components.toml +1 -0
  33. package/src/styles/admin-tokens.scss +15 -0
@@ -125,11 +125,23 @@ export type HkLoginChannel = HkLoginCredentialsChannel | HkLoginSsoChannel;
125
125
  * group — a channel switch crossfades only the body and leaves the
126
126
  * tabs and the header copy mounted (the 2026-11-24 stable-shell
127
127
  * direction, unchanged);
128
- * - the card's TOP edge is pinned while it grows (`useAnchoredTop`):
129
- * a height morph inside a vertically centered host re-centers the box,
130
- * which moves the top edge AND the content anchored to it — the
131
- * literal "the card flies up" in the report. The hook is closed-loop,
132
- * so a top-anchored host measures zero drift and nothing is written.
128
+ * - the card is NOT top-edge pinned (2026-11-24 ruling, reversing the
129
+ * pin #1501 introduced on 11-23): a height morph inside a
130
+ * vertically centered host re-centers the box, so the top edge travels
131
+ * half the height delta in step with the 300 ms morph and the card
132
+ * ENDS the swap centered for its new height. `useAnchoredTop` used to
133
+ * hold the pre-morph top edge instead and keep holding it at rest,
134
+ * which left a taller step half the growth below the center for good
135
+ * (engine-measured in a 752 px stage: 219.6 px above vs 163.4 px below
136
+ * on the verify step) — the user read that as "the card sits too low".
137
+ * The pin also measured in viewport coordinates while scrolling fires
138
+ * no ResizeObserver, so a swap on a scrolled page folded the scroll
139
+ * offset into its translateY (a 60 px downward jump, painted outside
140
+ * the scroll range). What "do not let the card fly" still buys is
141
+ * everything else on this list: the frame node is the single static
142
+ * one, the swap is an in-card crossfade, and the box arrives BEFORE
143
+ * the entering generation fades in — content that has appeared never
144
+ * moves again.
133
145
  *
134
146
  * Copy rules locked by the chest blueprint (LoginView.test.ts, kept
135
147
  * verbatim here): segment labels are ALWAYS the panel's own locale keys,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celestia-island/hikari",
3
- "version": "0.55.480",
3
+ "version": "0.55.483",
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",
@@ -589,4 +589,40 @@ describe("HkAdminHeader host slots (L39 ruling-a revival)", () => {
589
589
  expect(c.querySelector(".locale-popup")).toBeNull();
590
590
  expect(c.textContent).not.toContain("Account center");
591
591
  });
592
+
593
+ it("makes the brand the drawer trigger on mobile and drops the standalone hamburger", async () => {
594
+ // Brand-as-trigger (2026-11-25 user direction): with a brand on the
595
+ // menu face, the hamburger is redundant chrome and — worse — mounts
596
+ // only after JS, leaving pre-hydration phones with no nav affordance.
597
+ // The brand renders in SSR, so IT carries the trigger.
598
+ let fired = 0;
599
+ const c = mount(headerNode({
600
+ showHamburger: true,
601
+ brandSrc: "/logo.webp",
602
+ avatarAction: "menu",
603
+ title: "Docs",
604
+ onHamburger: () => { fired += 1; },
605
+ }));
606
+ expect(c.querySelector(".s-admin-header-hamburger-icon"), "standalone hamburger is gone").toBeNull();
607
+ const trigger = c.querySelector("button.s-admin-header-brand--trigger");
608
+ expect(trigger, "the brand is a real button").toBeTruthy();
609
+ expect(trigger?.querySelector("img"), "carrying the mark").toBeTruthy();
610
+ await click(trigger);
611
+ expect(fired, "clicking the brand opens the drawer").toBe(1);
612
+ });
613
+
614
+ it("keeps the standalone hamburger on faces without a brand", () => {
615
+ // The fallback: no brand → nothing else to tap → the hamburger stays.
616
+ const c = mount(headerNode({ showHamburger: true, avatarAction: "menu", title: "Docs" }));
617
+ expect(c.querySelector(".s-admin-header-hamburger-icon")).toBeTruthy();
618
+ expect(c.querySelector(".s-admin-header-brand--trigger")).toBeNull();
619
+ });
620
+
621
+ it("keeps the desktop brand a non-control span", () => {
622
+ // Desktop (showHamburger=false): the brand stays identity-not-control.
623
+ const c = mount(headerNode({ brandSrc: "/logo.webp", avatarAction: "menu", title: "Docs" }));
624
+ expect(c.querySelector("span.s-admin-header-brand")).toBeTruthy();
625
+ expect(c.querySelector("button.s-admin-header-brand--trigger")).toBeNull();
626
+ expect(c.querySelector(".s-admin-header-hamburger-icon")).toBeNull();
627
+ });
592
628
  });
@@ -374,8 +374,18 @@ export const HkAdminHeader = defineComponent({
374
374
  * above owns the header's columns, and a fourth in-flow child
375
375
  * would fall into the left wing's track and skew every column
376
376
  * after it. Inside the wing it keeps its place (leftmost, ahead
377
- * of the avatar) at the wing's own 16px rhythm. */}
378
- {props.showHamburger && (
377
+ * of the avatar) at the wing's own 16px rhythm.
378
+ *
379
+ * BRAND-AS-TRIGGER (2026-11-25 user direction): when the face
380
+ * carries a brand mark, the mark ITSELF is the drawer trigger —
381
+ * the standalone hamburger is redundant chrome (多此一举) and,
382
+ * worse, it only mounts after JS (the shell's mounted gate),
383
+ * leaving a pre-hydration phone with NO visible nav affordance.
384
+ * The brand renders in SSR, so making it the trigger gives the
385
+ * phone a visible menu affordance from first paint. The standalone
386
+ * hamburger stays only for faces WITHOUT a brand (there is
387
+ * nothing else to tap). */}
388
+ {props.showHamburger && !brandedMenuFace.value && (
379
389
  <HButton
380
390
  variant="ghost"
381
391
  size="sm"
@@ -405,11 +415,28 @@ export const HkAdminHeader = defineComponent({
405
415
  * dropdown and its carrier slots) does not mount at all —
406
416
  * the ZERO ACCOUNT SURFACE clause of the brand contract. */}
407
417
  {brandedMenuFace.value && (
408
- <span class="s-admin-header-brand">
409
- {slots.brand ? slots.brand() : (
410
- <HkLogo src={props.brandSrc} alt={props.brandAlt} size="sm" />
411
- )}
412
- </span>
418
+ props.showHamburger ? (
419
+ /* Mobile drawer face: the brand IS the menu trigger (see the
420
+ * brand-as-trigger note at the hamburger above). A real button
421
+ * so the affordance is honest; the static-brand styling stays
422
+ * via the shared class, the trigger chrome is pinned off. */
423
+ <button
424
+ type="button"
425
+ class="s-admin-header-brand s-admin-header-brand--trigger"
426
+ aria-label={t("hikari::adminHeader.openNav", "Open navigation")}
427
+ onClick={() => emit("hamburger")}
428
+ >
429
+ {slots.brand ? slots.brand() : (
430
+ <HkLogo src={props.brandSrc} alt={props.brandAlt} size="sm" />
431
+ )}
432
+ </button>
433
+ ) : (
434
+ <span class="s-admin-header-brand">
435
+ {slots.brand ? slots.brand() : (
436
+ <HkLogo src={props.brandSrc} alt={props.brandAlt} size="sm" />
437
+ )}
438
+ </span>
439
+ )
413
440
  )}
414
441
  {/* The reserved workspace-switcher slot (drawer face only).
415
442
  The chat header's left wing is avatar + ws-trigger button,
@@ -32,6 +32,18 @@
32
32
  start a text selection (the workspace tag contract makes HkCopyBadge
33
33
  the copy path instead). */
34
34
  @include user-select(none);
35
+
36
+ /* Icon spacing is the pill's own gap — never the child's margin. An
37
+ `mr-*` utility on an embedded svg/img double-spaces the label (the
38
+ OAuth provider pill shipped shield + mr-1 on top of this gap, reading
39
+ as stray spaces inside the tag), and per-child margins would make
40
+ every icon call site renegotiate the pill's geometry. This rule
41
+ outranks the utility classes (0,1,1 beats `.mr-*` at 0,1,0), so a
42
+ stale `mr-*` stays harmless after this ships. */
43
+ > svg,
44
+ > img {
45
+ margin: 0;
46
+ }
35
47
  }
36
48
 
37
49
  /* ---------- size ---------- */
@@ -69,3 +69,29 @@ describe("HkBadge pulse stylesheet contract", () => {
69
69
  expect(css).toMatch(/@media \(prefers-reduced-motion: reduce\)\s*\{[^@]*\.hk-badge\[data-pulse\] \[data-el=dot\]\s*\{[^}]*animation:\s*none/);
70
70
  });
71
71
  });
72
+
73
+ // The pill's gap is the single source of truth for icon spacing. A utility
74
+ // margin on an embedded svg (the OAuth provider pill shipped `mr-1` under
75
+ // the shield) double-spaces the label; the sheet neutralizes child svg/img
76
+ // margins so a stale utility stays harmless. Mutation contract — 变异表 in
77
+ // the PR body: MUT:badge-child-margin drops the sheet block and "zeroes
78
+ // margins on embedded svg and img children" reds; widen the selector to a
79
+ // descendant form and "never widens the rule past direct children" catches
80
+ // it too. A regression here re-opens the double gap everywhere at once.
81
+ describe("HkBadge icon-spacing stylesheet contract", () => {
82
+ const here = dirname(fileURLToPath(import.meta.url));
83
+ const css = compile(resolve(here, "HkBadge.scss"), { style: "expanded" }).css;
84
+
85
+ it("zeroes margins on embedded svg and img children", () => {
86
+ // Sass hoists the nested rule out of the base block when compiled.
87
+ expect(css).toMatch(/\.hk-badge > svg[^{]*\{[^}]*margin:\s*0/);
88
+ expect(css).toMatch(/\.hk-badge > img[^{]*\{[^}]*margin:\s*0/);
89
+ });
90
+
91
+ it("never widens the rule past direct children", () => {
92
+ // A descendant selector would fight deliberately-spaced nested markup
93
+ // inside badge slots; only direct icon children are normalized.
94
+ expect(css).not.toMatch(/\.hk-badge\s+svg/);
95
+ expect(css).not.toMatch(/\.hk-badge\s+img/);
96
+ });
97
+ });
@@ -1,8 +1,8 @@
1
1
  // HkLoginFlow — the shared sign-in panel.
2
2
  //
3
3
  // The root caps itself to the family-wide auth-card width contract
4
- // (HK_AUTH_CARD_MAX_WIDTH, 28rem): the panel's children (the anchored
5
- // frame, the transition container's measuring wrappers) lay out as
4
+ // (HK_AUTH_CARD_MAX_WIDTH, 28rem): the panel's children (the frame box,
5
+ // the transition container's measuring wrappers) lay out as
6
6
  // width:100%, so the HOST's centering slot must cap here rather than
7
7
  // justify-items the crossfade items — the chest blueprint's hard-won
8
8
  // rule. Hosts that embed the panel in a wider stage can override the
@@ -21,13 +21,17 @@
21
21
  margin-inline: auto;
22
22
  }
23
23
 
24
- // The anchored box around the card (useAnchoredTop). The hook writes ONLY
25
- // a paint-level `transform` here, which is what keeps the card's top edge
26
- // still while the card grows. The declarations this rule may carry are
27
- // therefore limited to the sizing the box needs to be a faithful copy of
28
- // its parent's content lane (the width) — a margin or padding here would
29
- // shift the card relative to the frame the rest of the panel geometry was
30
- // built against. It must also stay `position: static` as a forward rule:
24
+ // The box around the card. It was useAnchoredTop's target while the
25
+ // card's top edge was pinned (#1501 on 11-23; un-pinned by the 11-24 ruling);
26
+ // it is a plain frame box now and carries no transform — a centered
27
+ // host re-centers the taller card, which is the ruling (see the
28
+ // component header). The class name stays because hosts and probes
29
+ // address the frame through it; it no longer implies an anchor. The
30
+ // declarations this rule may carry remain limited to the sizing the box
31
+ // needs to be a faithful copy of its parent's content lane (the width)
32
+ // — a margin or padding here would shift the card relative to the frame
33
+ // the rest of the panel geometry was built against. It must also stay
34
+ // `position: static` as a forward rule:
31
35
  // hikari's overlay roots are body-level today, so nothing under this box
32
36
  // currently anchors to it — but the moment a descendant ever grew an
33
37
  // overlay that resolves against its nearest positioned ancestor, a
@@ -730,10 +730,11 @@ describe("HkLoginFlow — stable shell channel swap (2026-11-24 user direction)"
730
730
 
731
731
  describe("HkLoginFlow — in-card step swap (2026-11-24 user direction)", () => { // "Where the content can change inside the card, do not let the whole
732
732
  // card fly." The account→verify move used to swap TWO whole cards: each
733
- // generation was its own `HkAuthCard`, so the frame dissolved, its
734
- // entrance keyframes replayed on the fresh node, and the height morph
735
- // re-centred the panel in the host (the reported "the card flies up").
736
- // The pins below are ELEMENT-IDENTITY assertions on the frame.
733
+ // generation was its own `HkAuthCard`, so the frame dissolved and its
734
+ // entrance keyframes replayed on the fresh node — the reported "the card
735
+ // flies up". The pins below are ELEMENT-IDENTITY assertions on the frame,
736
+ // plus two geometry pins on how the host may move it (2026-11-24 ruling,
737
+ // the card must END a swap centered, so the frame box carries no pin).
737
738
 
738
739
  function mountStepHost(options: {
739
740
  accountName?: string;
@@ -993,67 +994,146 @@ describe("HkLoginFlow — in-card step swap (2026-11-24 user direction)", () =>
993
994
  .toBe("Acme keeps your account safe");
994
995
  });
995
996
 
996
- it("wires the anchor hook to the card's top edge (behaviour, not just the wrapper)", async () => {
997
- // The structural pin below only sees the wrapper. THIS one proves the
998
- // flow actually hands that wrapper to useAnchoredTop: a stubbed
999
- // observer + a stubbed rect let the probe drive the real hook.
1000
- // MUT:flow-drops-anchor-hook (deleting `useAnchoredTop(anchorRef)`
1001
- // leaves the wrapper in place but no transform ever appears).
1002
- const renders: Array<() => void> = [];
997
+ /** A layout MODEL of the host for the two geometry pins below. happy-dom
998
+ * has no layout engine (every rect reads zero), so the centering rule is
999
+ * spelled out here: the frame box's LAYOUT top is
1000
+ * `(stage − cardHeight) / 2` for a stage never shorter than `stageMin`
1001
+ * nor than the card, and its PAINTED top adds whatever inline
1002
+ * translateY stands on the box and subtracts the page scroll — which is
1003
+ * exactly what a real engine reports. The numbers are the ones the
1004
+ * browser rig measured on the pinned tree (a 752 px stage; a 240 px
1005
+ * viewport over a 3 rem footer for the scrolled case).
1006
+ *
1007
+ * comment-gate-ok: this block documents the fake engine's geometry, not a
1008
+ * behavioural claim of the component; the claims the pins make ("no
1009
+ * transform remains", "the scrolled page does not jump") are anchored
1010
+ * at the two cases below (`MUT:flow-repins-top-edge`). */
1011
+ async function mountCenteredStage(stageMin = 752) {
1012
+ let cardHeight = 310.5;
1013
+ let scrollY = 0;
1014
+ const frames: Array<(entries: unknown[]) => void> = [];
1003
1015
  vi.stubGlobal(
1004
1016
  "ResizeObserver",
1005
1017
  class {
1006
- private readonly cb: () => void;
1007
- constructor(cb: () => void) {
1008
- this.cb = cb;
1009
- renders.push(cb);
1018
+ constructor(cb: (entries: unknown[]) => void) {
1019
+ frames.push(cb);
1010
1020
  }
1011
1021
  observe() {}
1012
1022
  disconnect() {}
1013
1023
  unobserve() {}
1014
1024
  },
1015
1025
  );
1016
- const top = ref(100);
1017
1026
  vi.spyOn(Element.prototype, "getBoundingClientRect").mockImplementation(
1018
1027
  function (this: Element) {
1019
- const own = (this as HTMLElement).style?.transform ?? "";
1028
+ const isFrame =
1029
+ (this as HTMLElement).classList?.contains("hk-login-flow-anchor") ?? false;
1030
+ const own = isFrame ? (this as HTMLElement).style.transform : "";
1020
1031
  const shift = Number(/translateY\((-?[\d.]+)px\)/.exec(own)?.[1] ?? 0);
1021
- const rendered = top.value + shift;
1032
+ const height = isFrame ? cardHeight : 0;
1033
+ const layoutTop = (Math.max(stageMin, cardHeight) - cardHeight) / 2;
1034
+ const rendered = layoutTop + shift - scrollY;
1022
1035
  return {
1023
- top: rendered, left: 0, bottom: rendered, right: 0,
1024
- width: 0, height: 0, x: 0, y: rendered, toJSON: () => ({}),
1036
+ top: rendered, left: 0, bottom: rendered + height, right: 0,
1037
+ width: 0, height, x: 0, y: rendered, toJSON: () => ({}),
1025
1038
  } as DOMRect;
1026
1039
  },
1027
1040
  );
1041
+ const host = mountStepHost();
1042
+ // Let the mount settle before the caller acts, as it does on a page:
1043
+ // a template ref's first assignment queues jobs that read geometry.
1044
+ for (let i = 0; i < 4; i++) await nextTick();
1045
+ const frame = () =>
1046
+ host.container.querySelector(".hk-login-flow-anchor") as HTMLElement;
1047
+ return {
1048
+ step: host.step,
1049
+ frame,
1050
+ paintedTop: () => frame().getBoundingClientRect().top,
1051
+ /** One engine frame's notifications, to every live observer. The
1052
+ * entries are empty: happy-dom measures no box, so a size-driven
1053
+ * observer (HkTransitionContainer's) reads "nothing to pin" from
1054
+ * this frame, exactly as it does from a zero rect. */
1055
+ deliverFrames: () => {
1056
+ for (const cb of frames.slice()) cb([]);
1057
+ },
1058
+ growCard: (height: number) => {
1059
+ cardHeight = height;
1060
+ },
1061
+ scrollTo: (y: number) => {
1062
+ scrollY = y;
1063
+ },
1064
+ };
1065
+ }
1028
1066
 
1029
- const c = mount(
1030
- h(HkLoginFlow, {
1031
- channels: [cloudChannel],
1032
- modelValue: "cloud",
1033
- step: "account",
1034
- }),
1035
- );
1036
- const anchor = c.querySelector(".hk-login-flow-anchor") as HTMLElement;
1037
- expect(anchor.style.transform).toBe("");
1038
- // A centered host lifts the top edge by 12px while the card grows.
1039
- top.value = 88;
1040
- for (const cb of renders) cb();
1041
- expect(anchor.style.transform).toBe("translateY(12px)");
1042
-
1067
+ afterEach(() => {
1043
1068
  vi.unstubAllGlobals();
1044
1069
  vi.restoreAllMocks();
1045
1070
  });
1046
1071
 
1047
- it("anchors the card's top edge on a growing frame (structural pin)", async () => {
1072
+ it("ends a step swap centered for the card's new height: the top edge is not pinned", async () => {
1073
+ // The reported defect (2026-11-24): the verify step is taller, and the
1074
+ // top-edge pin kept the card's PRE-swap top, so the card only grew
1075
+ // downward and sat visibly low for good (219.6 px above vs 163.4 px
1076
+ // below in a 752 px stage, engine-measured). A centered host re-centers
1077
+ // the taller box; the flow must let it.
1078
+ // MUT:flow-repins-top-edge (re-adding `useAnchoredTop(anchorRef)` to
1079
+ // the flow leaves `translateY(29.25px)` on the frame box once the
1080
+ // observers report the growth — both assertions at the end go red).
1081
+ const rig = await mountCenteredStage();
1082
+ rig.deliverFrames();
1083
+ expect(rig.frame().style.transform).toBe("");
1084
+ // At rest before the swap: centered for 310.5 px.
1085
+ expect(Math.abs(rig.paintedTop() - (752 - 310.5) / 2)).toBeLessThanOrEqual(1);
1086
+
1087
+ // Engine order: the DOM is patched first, then laid out, then the
1088
+ // resize notifications of that frame are delivered.
1089
+ rig.step.value = "verify";
1090
+ for (let i = 0; i < 12; i++) await nextTick();
1091
+ rig.growCard(369); // account → verify: the password step is taller
1092
+ rig.deliverFrames();
1093
+
1094
+ // Centered for the NEW height (±1 px), with nothing painted over the
1095
+ // layout.
1096
+ expect(rig.frame().style.transform).toBe("");
1097
+ expect(Math.abs(rig.paintedTop() - (752 - 369) / 2)).toBeLessThanOrEqual(1);
1098
+ });
1099
+
1100
+ it("does not turn a page scroll into a jump when the swap lands on a scrolled page", async () => {
1101
+ // The pin's second defect, engine-measured: it measured in VIEWPORT
1102
+ // coordinates and re-based on a window resize only — scrolling fires
1103
+ // no ResizeObserver — so a swap on a scrolled page read the scroll
1104
+ // offset as drift and painted it back as a translateY (60 px downward,
1105
+ // and a transform does not extend the scroll range). The stage here is
1106
+ // shorter than the card (a 240 px viewport over a 3 rem footer), so
1107
+ // the layout top is 0 and any transform is a pure jump.
1108
+ // MUT:flow-repins-top-edge (re-adding the hook leaves
1109
+ // `translateY(60px)` on the frame box — both assertions at the end go
1110
+ // red).
1111
+ const rig = await mountCenteredStage(192);
1112
+ rig.deliverFrames();
1113
+ expect(rig.paintedTop()).toBe(0);
1114
+
1115
+ // The visitor scrolls to reach the submit, then the swap lands.
1116
+ rig.scrollTo(60);
1117
+ rig.step.value = "verify";
1118
+ for (let i = 0; i < 12; i++) await nextTick();
1119
+ rig.growCard(369);
1120
+ rig.deliverFrames();
1121
+
1122
+ expect(rig.frame().style.transform).toBe("");
1123
+ // Still where the scroll left it: the same document position.
1124
+ expect(rig.paintedTop()).toBe(-60);
1125
+ });
1126
+
1127
+ it("keeps the frame box between the panel root and the card (structural pin)", async () => {
1048
1128
  const { container } = mountStepHost();
1049
- // The anchor wrapper is the element useAnchoredTop owns: a centered
1050
- // host re-centres the frame on every height change, and without the
1051
- // wrapper there is no element to paint back onto the resting top.
1052
- // MUT:step-swap-unguarded (dropping the wrapper / the hook puts the
1053
- // frame straight under .hk-login-flow — this goes red).
1054
- const anchor = container.querySelector(".hk-login-flow-anchor");
1055
- expect(anchor).not.toBeNull();
1056
- expect(anchor!.querySelector(":scope > .s-auth-card")).not.toBeNull();
1129
+ // Hosts and probes address the frame through `.hk-login-flow-anchor`,
1130
+ // and the geometry pins above measure it. It is a plain box — no
1131
+ // transform is ever written to it.
1132
+ // MUT:step-swap-unguarded (dropping the wrapper puts the frame
1133
+ // straight under .hk-login-flow — this goes red).
1134
+ const frameBox = container.querySelector(".hk-login-flow-anchor");
1135
+ expect(frameBox).not.toBeNull();
1136
+ expect(frameBox!.querySelector(":scope > .s-auth-card")).not.toBeNull();
1057
1137
  expect(container.querySelector(".hk-login-flow > .s-auth-card")).toBeNull();
1058
1138
  });
1059
1139
  });
@@ -1,6 +1,5 @@
1
1
  import { computed, defineComponent, ref, watch, type PropType } from "vue";
2
2
 
3
- import { useAnchoredTop } from "../composables/useAnchoredTop";
4
3
  import { useI18n } from "../i18n/context";
5
4
  import { asPropType } from "../utils/typing";
6
5
  import { HkAuthChannelList, type HkAuthChannelListEntry } from "./HkAuthChannelList";
@@ -142,11 +141,23 @@ export type HkLoginChannel = HkLoginCredentialsChannel | HkLoginSsoChannel;
142
141
  * group — a channel switch crossfades only the body and leaves the
143
142
  * tabs and the header copy mounted (the 2026-11-24 stable-shell
144
143
  * direction, unchanged);
145
- * - the card's TOP edge is pinned while it grows (`useAnchoredTop`):
146
- * a height morph inside a vertically centered host re-centers the box,
147
- * which moves the top edge AND the content anchored to it — the
148
- * literal "the card flies up" in the report. The hook is closed-loop,
149
- * so a top-anchored host measures zero drift and nothing is written.
144
+ * - the card is NOT top-edge pinned (2026-11-24 ruling, reversing the
145
+ * pin #1501 introduced on 11-23): a height morph inside a
146
+ * vertically centered host re-centers the box, so the top edge travels
147
+ * half the height delta in step with the 300 ms morph and the card
148
+ * ENDS the swap centered for its new height. `useAnchoredTop` used to
149
+ * hold the pre-morph top edge instead and keep holding it at rest,
150
+ * which left a taller step half the growth below the center for good
151
+ * (engine-measured in a 752 px stage: 219.6 px above vs 163.4 px below
152
+ * on the verify step) — the user read that as "the card sits too low".
153
+ * The pin also measured in viewport coordinates while scrolling fires
154
+ * no ResizeObserver, so a swap on a scrolled page folded the scroll
155
+ * offset into its translateY (a 60 px downward jump, painted outside
156
+ * the scroll range). What "do not let the card fly" still buys is
157
+ * everything else on this list: the frame node is the single static
158
+ * one, the swap is an in-card crossfade, and the box arrives BEFORE
159
+ * the entering generation fades in — content that has appeared never
160
+ * moves again.
150
161
  *
151
162
  * Copy rules locked by the chest blueprint (LoginView.test.ts, kept
152
163
  * verbatim here): segment labels are ALWAYS the panel's own locale keys,
@@ -275,13 +286,6 @@ export const HkLoginFlow = defineComponent({
275
286
  };
276
287
  const mfaRef = ref<MfaCardHandle | null>(null);
277
288
 
278
- /** The card frame's anchored box (see useAnchoredTop): the step and
279
- * channel swaps grow/shrink the card, and in a centered host that
280
- * reflows the frame — pinning the top edge is what keeps the panel
281
- * still while it grows downward. */
282
- const anchorRef = ref<HTMLElement | null>(null);
283
- useAnchoredTop(anchorRef);
284
-
285
289
  const currentChannel = computed(
286
290
  () =>
287
291
  props.channels.find((channel) => channel.key === props.modelValue) ??
@@ -464,13 +468,14 @@ export const HkLoginFlow = defineComponent({
464
468
  return (
465
469
  <div class="hk-login-flow">
466
470
  {slots.top?.()}
467
- {/* The anchored box: the card grows DOWNWARD from here, and the
468
- * hook paints it back onto this top whenever a centered host
469
- * re-centers the taller frame (see useAnchoredTop). Wrapping
470
- * the FRAME (rather than the panel root) keeps a notice
471
- * appearing above the card from dragging the card with it:
472
- * the notice takes its own row above this box. */}
473
- <div class="hk-login-flow-anchor" ref={anchorRef}>
471
+ {/* The frame box. It carries no transform: a centered host
472
+ * re-centers the taller card, by design (header note).
473
+ * Wrapping the FRAME (rather than the panel root) keeps a
474
+ * notice appearing above the card from dragging the card with
475
+ * it: the notice takes its own row above this box. The class
476
+ * name stays — hosts and probes address the frame through it —
477
+ * and no longer implies an anchor. */}
478
+ <div class="hk-login-flow-anchor">
474
479
  {/* ONE card frame for the whole session: the step swap below
475
480
  * is a swap of this frame's CONTENTS. .s-auth-card also
476
481
  * carries the panel's mount entrance, which therefore plays
@@ -16,16 +16,23 @@ import { fileURLToPath } from "node:url";
16
16
  * entry of HkAdminHeaderSlots):
17
17
  * 1. the slot is declared in the SlotsType aggregate (zero-param —
18
18
  * a static mark has no state to hand down);
19
- * 2. the desktop face renders the mark through ONE class,
20
- * .s-admin-header-brand, and only while avatarAction is "menu"
21
- * (the drawer face keeps its avatar trigger — that trigger IS the
22
- * drawer path, so the mobile wing is invariant under the props);
23
- * 3. the mark is NON-INTERACTIVE: rendered through the div variant
24
- * of HkLogo (no href ever passed), no button semantics;
25
- * 4. the face pins the pointer cursor OFF on the mark (HkLogo's
26
- * standalone div carries cursor: pointer for its own hosts — a
27
- * header identity must not promise a click) and drops the
28
- * container rounding (site marks ship their own shape);
19
+ * 2. the face renders the mark through the ONE base class,
20
+ * .s-admin-header-brand, only while avatarAction is "menu";
21
+ * DESKTOP keeps it a non-control span; MOBILE (showHamburger)
22
+ * promotes the same mark to the drawer trigger through the
23
+ * --trigger variant (brand-as-trigger, 2026-11-25 user direction:
24
+ * the standalone hamburger was redundant chrome and mounted only
25
+ * after JS, leaving pre-hydration phones with no nav affordance —
26
+ * the brand renders in SSR, so IT always carries the trigger).
27
+ * MUT:mut-brand-trigger — forcing the trigger branch off REDS the
28
+ * HkAdminHeader suite's mobile test (verified this PR).
29
+ * 3. the DESKTOP mark is NON-INTERACTIVE: div-variant HkLogo (no
30
+ * href ever passed), no button semantics; the MOBILE trigger is a
31
+ * real <button> with the --trigger variant stripping the
32
+ * user-agent chrome;
33
+ * 4. the face pins the pointer cursor OFF on the desktop mark and
34
+ * drops the container rounding (site marks ship their own shape);
35
+ * the mobile trigger restores the pointer (it promises a click);
29
36
  * 5. the mark rides the "sm" HkLogo step — the closest visual weight
30
37
  * to the 28px identity trigger it replaces inside the 48px band.
31
38
  */
@@ -42,10 +49,13 @@ describe("admin header brand slot contract", () => {
42
49
  );
43
50
  });
44
51
 
45
- it("renders the mark on the desktop face only, through the one brand class", () => {
46
- expect(adminHeader, "the render site must carry the brand class").toContain(
52
+ it("renders the mark through the one base class, desktop span + mobile trigger", () => {
53
+ expect(adminHeader, "the render site must carry the brand base class").toContain(
47
54
  'class="s-admin-header-brand"',
48
55
  );
56
+ expect(adminHeader, "the mobile trigger variant exists").toContain(
57
+ '"s-admin-header-brand s-admin-header-brand--trigger"',
58
+ );
49
59
  // Drawer-face invariance: the face condition lives in ONE computed
50
60
  // (brand mounted AND avatarAction "menu") that BOTH the mark render
51
61
  // and the trigger suppression read — dropping the computed, or
@@ -56,11 +66,14 @@ describe("admin header brand slot contract", () => {
56
66
  /brandedMenuFace = computed\(\s*\(\) => brandMounted\.value && props\.avatarAction === "menu",?\s*\)/,
57
67
  );
58
68
  expect(adminHeader).toMatch(
59
- /brandedMenuFace\.value && \(\s*<span class="s-admin-header-brand">/,
69
+ /brandedMenuFace\.value && \(\s*props\.showHamburger \? \([\s\S]*?<button\s+type="button"\s+class="s-admin-header-brand s-admin-header-brand--trigger"/,
60
70
  );
61
71
  expect(adminHeader).toMatch(
62
72
  /identityMounted\.value && !brandedMenuFace\.value && \(\s*<HkAvatarButton/,
63
73
  );
74
+ expect(adminHeader, "the standalone hamburger is suppressed whenever the brand carries the trigger").toMatch(
75
+ /props\.showHamburger && !brandedMenuFace\.value && \(\s*<HButton/,
76
+ );
64
77
  });
65
78
 
66
79
  it("renders the mark non-interactively (div-variant HkLogo, no href)", () => {
@@ -3,6 +3,7 @@
3
3
  "hikari::adminHeader.adminGroup": "المسؤولون",
4
4
  "hikari::adminHeader.avatar": "الصورة الرمزية",
5
5
  "hikari::adminHeader.avatarTrigger": "قائمة الحساب",
6
+ "hikari::adminHeader.openNav": "افتح التنقل",
6
7
  "hikari::adminHeader.forceSignOut": "تسجيل الخروج",
7
8
  "hikari::adminHeader.language": "اللغة",
8
9
  "hikari::adminHeader.login": "تسجيل الدخول",
@@ -98,5 +98,6 @@ hk.adminHeader.signingIn = "جارٍ تسجيل الدخول…"
98
98
  hk.adminHeader.forceSignOut = "تسجيل الخروج"
99
99
  hk.adminHeader.avatar = "الصورة الرمزية"
100
100
  hk.adminHeader.avatarTrigger = "قائمة الحساب"
101
+ hk.adminHeader.openNav = "افتح التنقل"
101
102
  hk.adminHeader.language = "اللغة"
102
103
  hk.adminHeader.adminGroup = "المسؤولون"
@@ -3,6 +3,7 @@
3
3
  "hikari::adminHeader.adminGroup": "Administratoren",
4
4
  "hikari::adminHeader.avatar": "Avatar",
5
5
  "hikari::adminHeader.avatarTrigger": "Kontomenü",
6
+ "hikari::adminHeader.openNav": "Navigation öffnen",
6
7
  "hikari::adminHeader.forceSignOut": "Abmelden",
7
8
  "hikari::adminHeader.language": "Sprache",
8
9
  "hikari::adminHeader.login": "Anmelden",
@@ -98,5 +98,6 @@ hk.adminHeader.signingIn = "Anmeldung läuft…"
98
98
  hk.adminHeader.forceSignOut = "Abmelden"
99
99
  hk.adminHeader.avatar = "Avatar"
100
100
  hk.adminHeader.avatarTrigger = "Kontomenü"
101
+ hk.adminHeader.openNav = "Navigation öffnen"
101
102
  hk.adminHeader.language = "Sprache"
102
103
  hk.adminHeader.adminGroup = "Administratoren"
@@ -3,6 +3,7 @@
3
3
  "hikari::adminHeader.adminGroup": "Administrators",
4
4
  "hikari::adminHeader.avatar": "Avatar",
5
5
  "hikari::adminHeader.avatarTrigger": "Account menu",
6
+ "hikari::adminHeader.openNav": "Open navigation",
6
7
  "hikari::adminHeader.forceSignOut": "Sign out",
7
8
  "hikari::adminHeader.language": "Language",
8
9
  "hikari::adminHeader.login": "Login",
@@ -98,5 +98,6 @@ hk.adminHeader.signingIn = "Signing in…"
98
98
  hk.adminHeader.forceSignOut = "Sign out"
99
99
  hk.adminHeader.avatar = "Avatar"
100
100
  hk.adminHeader.avatarTrigger = "Account menu"
101
+ hk.adminHeader.openNav = "Open navigation"
101
102
  hk.adminHeader.language = "Language"
102
103
  hk.adminHeader.adminGroup = "Administrators"
@@ -3,6 +3,7 @@
3
3
  "hikari::adminHeader.adminGroup": "Administradores",
4
4
  "hikari::adminHeader.avatar": "Avatar",
5
5
  "hikari::adminHeader.avatarTrigger": "Menú de cuenta",
6
+ "hikari::adminHeader.openNav": "Abrir navegación",
6
7
  "hikari::adminHeader.forceSignOut": "Cerrar sesión",
7
8
  "hikari::adminHeader.language": "Idioma",
8
9
  "hikari::adminHeader.login": "Iniciar sesión",
@@ -98,5 +98,6 @@ hk.adminHeader.signingIn = "Iniciando sesión…"
98
98
  hk.adminHeader.forceSignOut = "Cerrar sesión"
99
99
  hk.adminHeader.avatar = "Avatar"
100
100
  hk.adminHeader.avatarTrigger = "Menú de cuenta"
101
+ hk.adminHeader.openNav = "Abrir navegación"
101
102
  hk.adminHeader.language = "Idioma"
102
103
  hk.adminHeader.adminGroup = "Administradores"
@@ -3,6 +3,7 @@
3
3
  "hikari::adminHeader.adminGroup": "Administrateurs",
4
4
  "hikari::adminHeader.avatar": "Avatar",
5
5
  "hikari::adminHeader.avatarTrigger": "Menu du compte",
6
+ "hikari::adminHeader.openNav": "Ouvrir la navigation",
6
7
  "hikari::adminHeader.forceSignOut": "Se déconnecter",
7
8
  "hikari::adminHeader.language": "Langue",
8
9
  "hikari::adminHeader.login": "Se connecter",
@@ -98,5 +98,6 @@ hk.adminHeader.signingIn = "Connexion en cours…"
98
98
  hk.adminHeader.forceSignOut = "Se déconnecter"
99
99
  hk.adminHeader.avatar = "Avatar"
100
100
  hk.adminHeader.avatarTrigger = "Menu du compte"
101
+ hk.adminHeader.openNav = "Ouvrir la navigation"
101
102
  hk.adminHeader.language = "Langue"
102
103
  hk.adminHeader.adminGroup = "Administrateurs"
@@ -3,6 +3,7 @@
3
3
  "hikari::adminHeader.adminGroup": "管理者",
4
4
  "hikari::adminHeader.avatar": "アバター",
5
5
  "hikari::adminHeader.avatarTrigger": "アカウントメニュー",
6
+ "hikari::adminHeader.openNav": "ナビゲーションを開く",
6
7
  "hikari::adminHeader.forceSignOut": "サインアウト",
7
8
  "hikari::adminHeader.language": "言語",
8
9
  "hikari::adminHeader.login": "ログイン",
@@ -98,5 +98,6 @@ hk.adminHeader.signingIn = "サインイン中…"
98
98
  hk.adminHeader.forceSignOut = "サインアウト"
99
99
  hk.adminHeader.avatar = "アバター"
100
100
  hk.adminHeader.avatarTrigger = "アカウントメニュー"
101
+ hk.adminHeader.openNav = "ナビゲーションを開く"
101
102
  hk.adminHeader.language = "言語"
102
103
  hk.adminHeader.adminGroup = "管理者"
@@ -3,6 +3,7 @@
3
3
  "hikari::adminHeader.adminGroup": "관리자",
4
4
  "hikari::adminHeader.avatar": "아바타",
5
5
  "hikari::adminHeader.avatarTrigger": "계정 메뉴",
6
+ "hikari::adminHeader.openNav": "내비게이션 열기",
6
7
  "hikari::adminHeader.forceSignOut": "로그아웃",
7
8
  "hikari::adminHeader.language": "언어",
8
9
  "hikari::adminHeader.login": "로그인",
@@ -98,5 +98,6 @@ hk.adminHeader.signingIn = "로그인 중…"
98
98
  hk.adminHeader.forceSignOut = "로그아웃"
99
99
  hk.adminHeader.avatar = "아바타"
100
100
  hk.adminHeader.avatarTrigger = "계정 메뉴"
101
+ hk.adminHeader.openNav = "내비게이션 열기"
101
102
  hk.adminHeader.language = "언어"
102
103
  hk.adminHeader.adminGroup = "관리자"
@@ -3,6 +3,7 @@
3
3
  "hikari::adminHeader.adminGroup": "Administradores",
4
4
  "hikari::adminHeader.avatar": "Avatar",
5
5
  "hikari::adminHeader.avatarTrigger": "Menu da conta",
6
+ "hikari::adminHeader.openNav": "Abrir navegação",
6
7
  "hikari::adminHeader.forceSignOut": "Sair",
7
8
  "hikari::adminHeader.language": "Idioma",
8
9
  "hikari::adminHeader.login": "Entrar",
@@ -98,5 +98,6 @@ hk.adminHeader.signingIn = "Entrando…"
98
98
  hk.adminHeader.forceSignOut = "Sair"
99
99
  hk.adminHeader.avatar = "Avatar"
100
100
  hk.adminHeader.avatarTrigger = "Menu da conta"
101
+ hk.adminHeader.openNav = "Abrir navegação"
101
102
  hk.adminHeader.language = "Idioma"
102
103
  hk.adminHeader.adminGroup = "Administradores"
@@ -3,6 +3,7 @@
3
3
  "hikari::adminHeader.adminGroup": "Администраторы",
4
4
  "hikari::adminHeader.avatar": "Аватар",
5
5
  "hikari::adminHeader.avatarTrigger": "Меню учётной записи",
6
+ "hikari::adminHeader.openNav": "Открыть навигацию",
6
7
  "hikari::adminHeader.forceSignOut": "Выйти",
7
8
  "hikari::adminHeader.language": "Язык",
8
9
  "hikari::adminHeader.login": "Войти",
@@ -98,5 +98,6 @@ hk.adminHeader.signingIn = "Вход…"
98
98
  hk.adminHeader.forceSignOut = "Выйти"
99
99
  hk.adminHeader.avatar = "Аватар"
100
100
  hk.adminHeader.avatarTrigger = "Меню учётной записи"
101
+ hk.adminHeader.openNav = "Открыть навигацию"
101
102
  hk.adminHeader.language = "Язык"
102
103
  hk.adminHeader.adminGroup = "Администраторы"
@@ -3,6 +3,7 @@
3
3
  "hikari::adminHeader.adminGroup": "管理员",
4
4
  "hikari::adminHeader.avatar": "头像",
5
5
  "hikari::adminHeader.avatarTrigger": "账户菜单",
6
+ "hikari::adminHeader.openNav": "打开导航",
6
7
  "hikari::adminHeader.forceSignOut": "退出登录",
7
8
  "hikari::adminHeader.language": "语言",
8
9
  "hikari::adminHeader.login": "登录",
@@ -98,5 +98,6 @@ hk.adminHeader.signingIn = "正在登录…"
98
98
  hk.adminHeader.forceSignOut = "退出登录"
99
99
  hk.adminHeader.avatar = "头像"
100
100
  hk.adminHeader.avatarTrigger = "账户菜单"
101
+ hk.adminHeader.openNav = "打开导航"
101
102
  hk.adminHeader.language = "语言"
102
103
  hk.adminHeader.adminGroup = "管理员"
@@ -3,6 +3,7 @@
3
3
  "hikari::adminHeader.adminGroup": "管理員",
4
4
  "hikari::adminHeader.avatar": "頭像",
5
5
  "hikari::adminHeader.avatarTrigger": "帳戶選單",
6
+ "hikari::adminHeader.openNav": "開啟導覽",
6
7
  "hikari::adminHeader.forceSignOut": "登出",
7
8
  "hikari::adminHeader.language": "語言",
8
9
  "hikari::adminHeader.login": "登入",
@@ -98,5 +98,6 @@ hk.adminHeader.signingIn = "正在登入…"
98
98
  hk.adminHeader.forceSignOut = "登出"
99
99
  hk.adminHeader.avatar = "頭像"
100
100
  hk.adminHeader.avatarTrigger = "帳戶選單"
101
+ hk.adminHeader.openNav = "開啟導覽"
101
102
  hk.adminHeader.language = "語言"
102
103
  hk.adminHeader.adminGroup = "管理員"
@@ -693,6 +693,21 @@
693
693
  border-radius: 0;
694
694
  }
695
695
 
696
+ /* The mobile drawer face renders the brand AS the menu trigger (a real
697
+ * <button> — see the brand-as-trigger note in HkAdminHeader). A button's
698
+ * user-agent chrome (background, border, font) would distort the mark, so
699
+ * the trigger variant strips it and restores the pointer cursor the
700
+ * identity contract pins off. */
701
+ .s-admin-header-brand--trigger,
702
+ .s-admin-header-brand--trigger .hk-logo {
703
+ background: none;
704
+ border: 0;
705
+ padding: 0;
706
+ font: inherit;
707
+ color: inherit;
708
+ cursor: pointer;
709
+ }
710
+
696
711
  /* The old hover camera veil ("change avatar" affordance) is gone: the
697
712
  * avatar trigger opens the account MENU — the avatar edit is the Camera
698
713
  * item inside it — so the veil promised an action the click never