@celestia-island/hikari 0.55.423 → 0.55.425
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/HkNotificationBell.scss +4 -0
- package/src/components/HkNotificationBell.styles.test.ts +11 -0
- package/src/components/HkNotificationBell.test.tsx +106 -8
- package/src/components/HkNotificationBell.tsx +61 -9
- package/src/components/HkSlideConfirm.scss +137 -0
- package/src/components/HkSlideConfirm.test.tsx +418 -0
- package/src/components/HkSlideConfirm.tsx +439 -0
- package/src/components/slideConfirmPath.test.ts +179 -0
- package/src/components/slideConfirmPath.ts +192 -0
- package/src/i18n/locales/ar/components.json +3 -1
- package/src/i18n/locales/de/components.json +3 -1
- package/src/i18n/locales/en/components.json +3 -1
- package/src/i18n/locales/es/components.json +3 -1
- package/src/i18n/locales/fr/components.json +3 -1
- package/src/i18n/locales/ja/components.json +3 -1
- package/src/i18n/locales/ko/components.json +3 -1
- package/src/i18n/locales/pt/components.json +3 -1
- package/src/i18n/locales/ru/components.json +3 -1
- package/src/i18n/locales/zh-Hans/components.json +3 -1
- package/src/i18n/locales/zh-Hant/components.json +3 -1
- package/src/index.ts +12 -0
package/package.json
CHANGED
|
@@ -74,6 +74,10 @@
|
|
|
74
74
|
display: flex;
|
|
75
75
|
justify-content: flex-end;
|
|
76
76
|
padding-top: var(--space-8, 0.5rem);
|
|
77
|
+
/* Breathing room BELOW the clear-all (user direction 2026-11-19):
|
|
78
|
+
the popover panel's own pad is a bare 4px, which glued the button
|
|
79
|
+
to the glass edge — the foot owns the extra bottom inset. */
|
|
80
|
+
padding-bottom: var(--space-8, 0.5rem);
|
|
77
81
|
border-top: 1px solid rgb(var(--color-border) / 10%);
|
|
78
82
|
margin-top: var(--space-8, 0.5rem);
|
|
79
83
|
}
|
|
@@ -25,6 +25,17 @@ describe("HkNotificationBell scss contract", () => {
|
|
|
25
25
|
);
|
|
26
26
|
});
|
|
27
27
|
|
|
28
|
+
it("the clear-all foot carries bottom padding (the glass edge gap)", () => {
|
|
29
|
+
// User direction 2026-11-19: the popover panel's own 4px pad glued
|
|
30
|
+
// the clear-all button to the panel's bottom edge — the foot owns
|
|
31
|
+
// the extra bottom inset. The VALUE is pinned (round-3 review,
|
|
32
|
+
// mutant M4): a presence-only match let `padding-bottom: 0` — a
|
|
33
|
+
// no-op revert — stay green.
|
|
34
|
+
const footBlock = scss.match(/^\.hk-notification-center__foot \{([^}]*)\}/m);
|
|
35
|
+
expect(footBlock).toBeTruthy();
|
|
36
|
+
expect(footBlock![1]).toContain("padding-bottom: var(--space-8, 0.5rem)");
|
|
37
|
+
});
|
|
38
|
+
|
|
28
39
|
it("the row centers its columns against the ROW height (one-line rows included)", () => {
|
|
29
40
|
// Default stretch stretched a one-line body to the 24px dismiss
|
|
30
41
|
// button and hugged the title to the body's top — visibly off the
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { afterEach, describe, expect, it } from "vitest";
|
|
1
|
+
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
2
2
|
import { createApp, h, nextTick } from "vue";
|
|
3
3
|
|
|
4
4
|
import HkNotificationBell from "./HkNotificationBell";
|
|
@@ -13,9 +13,12 @@ import { setLocale } from "../i18n/context";
|
|
|
13
13
|
* - clicking the bell opens the panel (HkPopover panel mounts) and
|
|
14
14
|
* opening IS the read receipt (dot goes dark)
|
|
15
15
|
* - rows render title / time / detail / code chip
|
|
16
|
+
* - error/warning rows carry the toast-family copy button (user
|
|
17
|
+
* direction 2026-11-19) and copy the FULL record to the clipboard;
|
|
18
|
+
* the other tones stay non-copyable like their surfaces
|
|
16
19
|
* - a snoozed emergency entry shows the Hidden state chip and its
|
|
17
20
|
* restore button unsnoozes through the journal's resummon path
|
|
18
|
-
* - Clear all empties the journal
|
|
21
|
+
* - Clear all (icon + label) empties the journal
|
|
19
22
|
*
|
|
20
23
|
* (Repo test convention: raw createApp + document queries, no
|
|
21
24
|
* @vue/test-utils dependency.)
|
|
@@ -50,6 +53,16 @@ function rows(): HTMLElement[] {
|
|
|
50
53
|
return Array.from(document.querySelectorAll<HTMLElement>(".hk-notification-row"));
|
|
51
54
|
}
|
|
52
55
|
|
|
56
|
+
/** The toast family's clipboard write, stubbed at navigator level
|
|
57
|
+
* (same shape HkTable/HkErrorLanding tests use) — jsdom has no
|
|
58
|
+
* clipboard, and the fallback execCommand path would not tell us
|
|
59
|
+
* WHAT text was copied. */
|
|
60
|
+
function stubClipboard() {
|
|
61
|
+
const writeText = vi.fn().mockResolvedValue(undefined);
|
|
62
|
+
Object.defineProperty(navigator, "clipboard", { value: { writeText }, configurable: true });
|
|
63
|
+
return writeText;
|
|
64
|
+
}
|
|
65
|
+
|
|
53
66
|
afterEach(() => {
|
|
54
67
|
for (const { app, container } of mounts) {
|
|
55
68
|
app.unmount();
|
|
@@ -122,6 +135,77 @@ describe("panel rows", () => {
|
|
|
122
135
|
expect(row.querySelector(".hk-notification-row__time")).toBeTruthy();
|
|
123
136
|
});
|
|
124
137
|
|
|
138
|
+
it("error AND warning rows carry the toast's copy button; the payload is the FULL record", async () => {
|
|
139
|
+
// User direction 2026-11-19: beside dismiss, error/warning rows get
|
|
140
|
+
// the toast family's own copy affordance (same button shape, same
|
|
141
|
+
// `hikari::toast.copy` label, same clipboard write). The row clips
|
|
142
|
+
// its text, so the copied payload must be the complete record —
|
|
143
|
+
// title / code / detail, whatever fields exist, one per line.
|
|
144
|
+
// BOTH tones are pinned positively (round-2 review): dropping the
|
|
145
|
+
// warning arm of rowCopyable must go red here, not just the error
|
|
146
|
+
// arm.
|
|
147
|
+
await setLocale("en");
|
|
148
|
+
const writeText = stubClipboard();
|
|
149
|
+
recordNotification({
|
|
150
|
+
id: "toast:e:1:1",
|
|
151
|
+
kind: "toast",
|
|
152
|
+
tone: "error",
|
|
153
|
+
title: "billing.quota.snapshot: billing.quota.bad_gate",
|
|
154
|
+
detail: "The gate returned an unrecoverable verdict",
|
|
155
|
+
code: "billing.quota.bad_gate",
|
|
156
|
+
});
|
|
157
|
+
recordNotification({ id: "toast:w:1:2", kind: "toast", tone: "warning", title: "disk almost full" });
|
|
158
|
+
mountBell();
|
|
159
|
+
await settle();
|
|
160
|
+
bellButton().dispatchEvent(new MouseEvent("click", { bubbles: true }));
|
|
161
|
+
await settle();
|
|
162
|
+
const byLabel = (row: HTMLElement, label: string) =>
|
|
163
|
+
row.querySelector<HTMLButtonElement>(
|
|
164
|
+
`.hk-notification-row__actions .hk-icon-button[aria-label="${label}"]`,
|
|
165
|
+
);
|
|
166
|
+
const errorRow = rows().find((r) => r.textContent?.includes("billing.quota"))!;
|
|
167
|
+
const copy = byLabel(errorRow, "Copy");
|
|
168
|
+
expect(copy, "copy button renders on an error row").toBeTruthy();
|
|
169
|
+
// LEFT of dismiss: the copy button is the actions lane's first child.
|
|
170
|
+
expect(copy!.parentElement!.firstElementChild).toBe(copy);
|
|
171
|
+
copy!.dispatchEvent(new MouseEvent("click", { bubbles: true }));
|
|
172
|
+
await settle();
|
|
173
|
+
expect(writeText).toHaveBeenCalledTimes(1);
|
|
174
|
+
expect(writeText).toHaveBeenCalledWith(
|
|
175
|
+
"billing.quota.snapshot: billing.quota.bad_gate\nbilling.quota.bad_gate\nThe gate returned an unrecoverable verdict",
|
|
176
|
+
);
|
|
177
|
+
|
|
178
|
+
// The warning arm: same button, and the title-only payload proves
|
|
179
|
+
// the optional code/detail guards skip MISSING fields instead of
|
|
180
|
+
// joining empty lines.
|
|
181
|
+
const warningRow = rows().find((r) => r.textContent?.includes("disk almost full"))!;
|
|
182
|
+
const warningCopy = byLabel(warningRow, "Copy");
|
|
183
|
+
expect(warningCopy, "copy button renders on a warning row").toBeTruthy();
|
|
184
|
+
warningCopy!.dispatchEvent(new MouseEvent("click", { bubbles: true }));
|
|
185
|
+
await settle();
|
|
186
|
+
expect(writeText).toHaveBeenCalledTimes(2);
|
|
187
|
+
expect(writeText).toHaveBeenLastCalledWith("disk almost full");
|
|
188
|
+
// The toast seat's hover hint rides along (claim pin — round-3
|
|
189
|
+
// mutant M3 deleted it green): aria-label AND title, same key.
|
|
190
|
+
expect(copy!.getAttribute("title")).toBe("Copy");
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
it("tones the toast family treats as non-copyable get NO copy button", async () => {
|
|
194
|
+
await setLocale("en");
|
|
195
|
+
stubClipboard();
|
|
196
|
+
recordNotification({ id: "s1", kind: "toast", tone: "success", title: "saved" });
|
|
197
|
+
recordNotification({ id: "i1", kind: "toast", tone: "info", title: "heads up" });
|
|
198
|
+
mountBell();
|
|
199
|
+
await settle();
|
|
200
|
+
bellButton().dispatchEvent(new MouseEvent("click", { bubbles: true }));
|
|
201
|
+
await settle();
|
|
202
|
+
expect(rows()).toHaveLength(2);
|
|
203
|
+
expect(
|
|
204
|
+
document.querySelector('.hk-notification-row__actions .hk-icon-button[aria-label="Copy"]'),
|
|
205
|
+
"success/info records stay non-copyable, like their surfaces",
|
|
206
|
+
).toBeNull();
|
|
207
|
+
});
|
|
208
|
+
|
|
125
209
|
it("a snoozed emergency shows Hidden + a working restore button", async () => {
|
|
126
210
|
await setLocale("en");
|
|
127
211
|
raiseEmergencyAlert({ id: "quota", severity: "warning", title: "quota out" });
|
|
@@ -159,6 +243,13 @@ describe("panel rows", () => {
|
|
|
159
243
|
expect(row.classList.contains("is-active")).toBe(true);
|
|
160
244
|
expect(row.querySelector('.hk-notification-row__actions .hk-icon-button[aria-label="Show again"]')).toBeFalsy();
|
|
161
245
|
expect(row.querySelector(".hk-notification-row__state")).toBeFalsy();
|
|
246
|
+
// Emergency records inherit the copy affordance through their tone
|
|
247
|
+
// (round-3 intent-drift pin): a warning-severity emergency IS a
|
|
248
|
+
// copyable diagnostic record — its whole action lane is exactly
|
|
249
|
+
// [Copy] (live episodes carry no dismiss, and an active band has
|
|
250
|
+
// no restore).
|
|
251
|
+
expect(row.querySelector('.hk-notification-row__actions .hk-icon-button[aria-label="Copy"]')).toBeTruthy();
|
|
252
|
+
expect(row.querySelectorAll(".hk-notification-row__actions .hk-icon-button")).toHaveLength(1);
|
|
162
253
|
});
|
|
163
254
|
|
|
164
255
|
it("an emergency row carries NO dismiss button (live episode is not user-dismissable)", async () => {
|
|
@@ -217,9 +308,12 @@ describe("panel rows", () => {
|
|
|
217
308
|
expect(row.querySelector('.hk-notification-row__actions .hk-icon-button[aria-label="Show again"]')).toBeFalsy();
|
|
218
309
|
// R10 (PR #1333): the state-scoped gate means a CLEARED emergency
|
|
219
310
|
// row IS dismissable — this is the pin that was lost in eb492e44's
|
|
220
|
-
// wrong-sibling deletion.
|
|
311
|
+
// wrong-sibling deletion. Pinned by LABEL (round-2 review): the row
|
|
312
|
+
// now also carries a copy button, and a bare `.hk-icon-button`
|
|
313
|
+
// first-match resolves to THAT, so dropping the dismiss gate would
|
|
314
|
+
// have stayed green.
|
|
221
315
|
expect(
|
|
222
|
-
row.querySelector(
|
|
316
|
+
row.querySelector('.hk-notification-row__actions .hk-icon-button[aria-label="Dismiss"]'),
|
|
223
317
|
"a resolved record is dismissable",
|
|
224
318
|
).not.toBeNull();
|
|
225
319
|
});
|
|
@@ -237,7 +331,9 @@ describe("panel rows", () => {
|
|
|
237
331
|
await settle();
|
|
238
332
|
expect(rows()).toHaveLength(2);
|
|
239
333
|
const dropRow = rows().find((r) => r.textContent?.includes("drop me"))!;
|
|
240
|
-
const dismiss = dropRow.querySelector<HTMLButtonElement>(
|
|
334
|
+
const dismiss = dropRow.querySelector<HTMLButtonElement>(
|
|
335
|
+
'.hk-notification-row__actions .hk-icon-button[aria-label="Dismiss"]',
|
|
336
|
+
)!;
|
|
241
337
|
expect(dismiss.getAttribute("aria-label")).toBe("Dismiss");
|
|
242
338
|
dismiss.dispatchEvent(new MouseEvent("click", { bubbles: true }));
|
|
243
339
|
await settle();
|
|
@@ -260,9 +356,11 @@ describe("panel rows", () => {
|
|
|
260
356
|
const titles = rows().map((r) => r.querySelector(".hk-notification-row__title")?.textContent);
|
|
261
357
|
expect(titles).toEqual(["newer", "older"]);
|
|
262
358
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
)
|
|
359
|
+
// The clear-all affordance announces itself by its glyph (user
|
|
360
|
+
// direction 2026-11-19): a leading icon inside the label button.
|
|
361
|
+
const clearBtn = document.querySelector<HTMLButtonElement>(".hk-notification-center__foot .hk-btn")!;
|
|
362
|
+
expect(clearBtn.querySelector(".hk-btn-icon")).toBeTruthy();
|
|
363
|
+
clearBtn.dispatchEvent(new MouseEvent("click", { bubbles: true }));
|
|
266
364
|
await settle();
|
|
267
365
|
expect(document.querySelector(".hk-notification-center__empty")).toBeTruthy();
|
|
268
366
|
expect(rows()).toHaveLength(0);
|
|
@@ -23,11 +23,29 @@
|
|
|
23
23
|
* (`onResummon`, wired by useEmergencyAlert); the button reuses the
|
|
24
24
|
* emergency family's own "Show again" copy.
|
|
25
25
|
*
|
|
26
|
+
* Per-row copy (user direction 2026-11-19): rows whose tone the toast
|
|
27
|
+
* family already deems copyable by default (error/warning —
|
|
28
|
+
* useToast's `defaultCopyable`) carry the toast's own copy icon
|
|
29
|
+
* button (same HkIconButton shape, same `hikari::toast.copy` label,
|
|
30
|
+
* same useClipboard write) to the LEFT of dismiss, copying the full
|
|
31
|
+
* untruncated record (title / code / detail, one per line) — the row
|
|
32
|
+
* clips its text, so the clipboard is the only place the whole thing
|
|
33
|
+
* still exists.
|
|
34
|
+
*
|
|
26
35
|
* Renders nothing extra while the journal is empty beyond the bell
|
|
27
36
|
* itself — an empty notification center still shows its (disabled-
|
|
28
37
|
* looking) trigger so the host chrome never reflows on first use.
|
|
29
38
|
*/
|
|
30
|
-
import {
|
|
39
|
+
import {
|
|
40
|
+
CircleCheck as CheckCircle,
|
|
41
|
+
Copy,
|
|
42
|
+
Info,
|
|
43
|
+
LoaderCircle,
|
|
44
|
+
RotateCcw,
|
|
45
|
+
Trash2,
|
|
46
|
+
TriangleAlert as AlertTriangle,
|
|
47
|
+
X,
|
|
48
|
+
} from "lucide-vue-next";
|
|
31
49
|
import { computed, defineComponent, h, ref, watch, type Component } from "vue";
|
|
32
50
|
|
|
33
51
|
import { useChromeActionSize } from "../composables/useChromeActionSize";
|
|
@@ -37,6 +55,7 @@ import {
|
|
|
37
55
|
type HkNotificationEntry,
|
|
38
56
|
type HkNotificationTone,
|
|
39
57
|
} from "../runtime/notificationCenter";
|
|
58
|
+
import { useClipboard } from "../runtime/useClipboard";
|
|
40
59
|
import HkIconButton from "./HkIconButton";
|
|
41
60
|
import HkButton from "./HkButton";
|
|
42
61
|
import HkPopover from "./HkPopover";
|
|
@@ -51,6 +70,13 @@ const TONE_ICONS: Record<HkNotificationTone, Component> = {
|
|
|
51
70
|
loading: LoaderCircle,
|
|
52
71
|
};
|
|
53
72
|
|
|
73
|
+
/** The toast family's own copyable-by-default set (useToast
|
|
74
|
+
* `defaultCopyable`): error and warning records get the per-row copy
|
|
75
|
+
* button, the other tones mirror their non-copyable surfaces. */
|
|
76
|
+
function rowCopyable(entry: HkNotificationEntry): boolean {
|
|
77
|
+
return entry.tone === "error" || entry.tone === "warning";
|
|
78
|
+
}
|
|
79
|
+
|
|
54
80
|
/** `HH:mm` today, `MM-dd HH:mm` otherwise — Intl does the locale work
|
|
55
81
|
* (the journal stores epoch ms; formatting is a view concern). */
|
|
56
82
|
function formatRowTime(ts: number, locale: string): string {
|
|
@@ -70,6 +96,7 @@ export default defineComponent({
|
|
|
70
96
|
const { t } = useI18n();
|
|
71
97
|
const { entries, forget, markAllRead, reset } = useNotificationCenter();
|
|
72
98
|
const chromeSize = useChromeActionSize();
|
|
99
|
+
const clipboard = useClipboard();
|
|
73
100
|
const open = ref(false);
|
|
74
101
|
const anchorRef = ref<HTMLElement | null>(null);
|
|
75
102
|
|
|
@@ -90,6 +117,18 @@ export default defineComponent({
|
|
|
90
117
|
if (v) markAllRead();
|
|
91
118
|
});
|
|
92
119
|
|
|
120
|
+
/** The toast's copy affordance, carried over: same clipboard write
|
|
121
|
+
* path (useClipboard), but the payload is the journal's own shape —
|
|
122
|
+
* the FULL untruncated record, one field per line (title / code /
|
|
123
|
+
* detail — whatever the entry carries). The row itself ellipsizes,
|
|
124
|
+
* so the clipboard is the only complete copy of what was shown. */
|
|
125
|
+
function copyEntry(entry: HkNotificationEntry) {
|
|
126
|
+
const parts = [entry.title];
|
|
127
|
+
if (entry.code) parts.push(entry.code);
|
|
128
|
+
if (entry.detail) parts.push(entry.detail);
|
|
129
|
+
void clipboard.copy(parts.join("\n"));
|
|
130
|
+
}
|
|
131
|
+
|
|
93
132
|
function renderRow(entry: HkNotificationEntry) {
|
|
94
133
|
const Icon = TONE_ICONS[entry.tone] ?? Info;
|
|
95
134
|
const isLive = entry.kind === "emergency" && entry.state !== "cleared";
|
|
@@ -137,9 +176,22 @@ export default defineComponent({
|
|
|
137
176
|
)}
|
|
138
177
|
</div>
|
|
139
178
|
<div class="hk-notification-row__actions">
|
|
140
|
-
{/*
|
|
141
|
-
|
|
142
|
-
|
|
179
|
+
{/* Copy (toast-family tones, left of dismiss per user
|
|
180
|
+
direction 2026-11-19) → dismiss → restore. Dismiss is
|
|
181
|
+
gated OFF for live emergency episodes (round-6 S1: a
|
|
182
|
+
snoozed alert's entry carries the ONLY restore handle).
|
|
183
|
+
Restore is gated ON only for snoozed entries. */}
|
|
184
|
+
{rowCopyable(entry) && (
|
|
185
|
+
<HkIconButton
|
|
186
|
+
size={24}
|
|
187
|
+
variant="ghost"
|
|
188
|
+
aria-label={t("hikari::toast.copy", "Copy")}
|
|
189
|
+
{...{ title: t("hikari::toast.copy", "Copy") }}
|
|
190
|
+
onClick={() => copyEntry(entry)}
|
|
191
|
+
>
|
|
192
|
+
{{ icon: () => <Copy size={14} /> }}
|
|
193
|
+
</HkIconButton>
|
|
194
|
+
)}
|
|
143
195
|
{!isLive && (
|
|
144
196
|
<HkIconButton
|
|
145
197
|
size={24}
|
|
@@ -207,11 +259,11 @@ export default defineComponent({
|
|
|
207
259
|
{sorted.value.map(renderRow)}
|
|
208
260
|
</ul>
|
|
209
261
|
<div class="hk-notification-center__foot">
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
>
|
|
262
|
+
{/* The wipe glyph reads before the label is parsed —
|
|
263
|
+
a destructive affordance announced by its icon
|
|
264
|
+
(user direction 2026-11-19), from the same lucide
|
|
265
|
+
family the row glyphs already speak. */}
|
|
266
|
+
<HkButton variant="ghost" size="sm" icon="Trash2" onClick={() => reset()}>
|
|
215
267
|
{t("hikari::notificationCenter.clearAll", "Clear all")}
|
|
216
268
|
</HkButton>
|
|
217
269
|
</div>
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
@use "../styles/polyfill" as *;
|
|
2
|
+
|
|
3
|
+
// HkSlideConfirm (components/HkSlideConfirm.tsx) — the fat slide-to-
|
|
4
|
+
// confirm: a three-standard-row block whose orthogonal lane carries ≥3
|
|
5
|
+
// random right-angle turns; the knob is grabbed and TRACED from the left
|
|
6
|
+
// edge to the right edge; a premature release or a corridor exit snaps it
|
|
7
|
+
// back at once. Tokens follow the house scale (--space-*, --radius-*,
|
|
8
|
+
// rgb(var(--color-*)), --hi-color-*).
|
|
9
|
+
//
|
|
10
|
+
// GEOMETRY: the block's height is THREE standard control rows
|
|
11
|
+
// (calc(var(--space-40, 2.5rem) * 3)) — the 2026-11-19 user direction
|
|
12
|
+
// that makes the confirmation feel deliberate instead of reflexive. The
|
|
13
|
+
// lane svg is inset by the same TRACK_PAD the tsx maps coordinates with;
|
|
14
|
+
// the knob rides the lane's px frame (transform from the track corner,
|
|
15
|
+
// centered by the negative half-margin below).
|
|
16
|
+
|
|
17
|
+
.hk-slide-confirm {
|
|
18
|
+
position: relative;
|
|
19
|
+
height: calc(var(--space-40, 2.5rem) * 3);
|
|
20
|
+
border-radius: var(--radius-lg, 0.75rem);
|
|
21
|
+
background: var(--hi-color-surface, rgba(255, 255, 255, 0.95));
|
|
22
|
+
border: 1px solid rgb(var(--color-border) / 8%);
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
transition: border-color 0.2s ease, background 0.2s ease;
|
|
25
|
+
|
|
26
|
+
&:hover:not(.is-disabled) {
|
|
27
|
+
border-color: rgb(var(--color-border) / 20%);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&.is-done {
|
|
31
|
+
border-color: rgb(var(--color-primary) / 35%);
|
|
32
|
+
background: color-mix(in srgb, var(--hi-color-primary, #7aa2f7) 8%, transparent);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&.is-disabled {
|
|
36
|
+
opacity: 0.55;
|
|
37
|
+
pointer-events: none;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* The lane: an svg inset by TRACK_PAD (the tsx maps coordinates in the
|
|
42
|
+
* same frame). One polyline, thick round stroke — a corridor to trace,
|
|
43
|
+
* not a line to read. */
|
|
44
|
+
.hk-slide-confirm-lane {
|
|
45
|
+
position: absolute;
|
|
46
|
+
overflow: visible;
|
|
47
|
+
pointer-events: none;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.hk-slide-confirm-lane-path {
|
|
51
|
+
fill: none;
|
|
52
|
+
stroke: rgb(var(--color-text) / 14%);
|
|
53
|
+
stroke-width: 1.25rem;
|
|
54
|
+
stroke-linecap: round;
|
|
55
|
+
stroke-linejoin: round;
|
|
56
|
+
|
|
57
|
+
&.is-done {
|
|
58
|
+
stroke: color-mix(in srgb, var(--hi-color-primary, #7aa2f7) 45%, transparent);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.hk-slide-confirm-label,
|
|
63
|
+
.hk-slide-confirm-done-label {
|
|
64
|
+
position: absolute;
|
|
65
|
+
inset: 0;
|
|
66
|
+
display: flex;
|
|
67
|
+
align-items: center;
|
|
68
|
+
justify-content: center;
|
|
69
|
+
padding: 0 var(--space-32, 2rem);
|
|
70
|
+
font-size: 0.75rem;
|
|
71
|
+
color: rgb(var(--color-text) / 45%);
|
|
72
|
+
text-align: center;
|
|
73
|
+
pointer-events: none;
|
|
74
|
+
@include user-select(none);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.hk-slide-confirm-done-label {
|
|
78
|
+
color: var(--hi-color-primary, #7aa2f7);
|
|
79
|
+
font-weight: 600;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* The knob: a joystick-sized circle, centered on the lane point by the
|
|
83
|
+
* negative half-margin, riding the transform the tsx writes. While
|
|
84
|
+
* snapping it transitions back to the start (the "一下子回去" — the
|
|
85
|
+
* instant return reads as refusal, not as a reset). */
|
|
86
|
+
.hk-slide-confirm-knob {
|
|
87
|
+
position: absolute;
|
|
88
|
+
top: 0;
|
|
89
|
+
left: 0;
|
|
90
|
+
display: flex;
|
|
91
|
+
align-items: center;
|
|
92
|
+
justify-content: center;
|
|
93
|
+
width: 2.4rem;
|
|
94
|
+
height: 2.4rem;
|
|
95
|
+
margin: -1.2rem; /* center the knob on the lane point */
|
|
96
|
+
border-radius: 50%;
|
|
97
|
+
background: var(--hi-color-surface, rgba(255, 255, 255, 0.98));
|
|
98
|
+
border: 1px solid rgb(var(--color-border) / 22%);
|
|
99
|
+
box-shadow: 0 2px 8px rgb(0 0 0 / 22%);
|
|
100
|
+
cursor: grab;
|
|
101
|
+
touch-action: none;
|
|
102
|
+
transition: transform 0.24s cubic-bezier(0.3, 0, 0.5, 1), border-color 0.2s ease;
|
|
103
|
+
|
|
104
|
+
&.is-done {
|
|
105
|
+
cursor: default;
|
|
106
|
+
border-color: var(--hi-color-primary, #7aa2f7);
|
|
107
|
+
background: color-mix(in srgb, var(--hi-color-primary, #7aa2f7) 18%, var(--hi-color-surface, rgba(255, 255, 255, 0.95)));
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.hk-slide-confirm.is-dragging .hk-slide-confirm-knob {
|
|
112
|
+
cursor: grabbing;
|
|
113
|
+
/* While tracing, the knob follows the pointer 1:1 — no transition (a
|
|
114
|
+
* transitioned follow would lag the hand). Only the snap-back transition
|
|
115
|
+
* above applies, and only once .is-dragging is gone. */
|
|
116
|
+
transition: border-color 0.2s ease;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/* The grip: three horizontal pills — the joystick affordance. */
|
|
120
|
+
.hk-slide-confirm-knob-grip {
|
|
121
|
+
width: 0.9rem;
|
|
122
|
+
height: 0.55rem;
|
|
123
|
+
background:
|
|
124
|
+
linear-gradient(to bottom,
|
|
125
|
+
rgb(var(--color-text) / 45%) 0 2px, transparent 2px 4px,
|
|
126
|
+
rgb(var(--color-text) / 45%) 4px 6px, transparent 6px 8px,
|
|
127
|
+
rgb(var(--color-text) / 45%) 8px 10px, transparent 10px);
|
|
128
|
+
border-radius: 1px;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* Reduced motion: the snap-back must SNAP (the whole point of the refusal
|
|
132
|
+
* read), not glide — the transition is the only animated part. */
|
|
133
|
+
@media (prefers-reduced-motion: reduce) {
|
|
134
|
+
.hk-slide-confirm-knob {
|
|
135
|
+
transition: border-color 0.2s ease;
|
|
136
|
+
}
|
|
137
|
+
}
|