Skip to content

Commit 2373092

Browse files
fix(ui): remove transition-opacity from page icon hover reveal (#191)
Co-authored-by: Ona <no-reply@ona.com>
1 parent 5df0ce5 commit 2373092

2 files changed

Lines changed: 28 additions & 1 deletion

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { describe, it, expect } from "vitest";
2+
import { readFileSync } from "fs";
3+
import { join } from "path";
4+
5+
/**
6+
* Regression test for issue #191: the "Add icon" hover-reveal button
7+
* must not use transition-opacity. Design spec requires instant hover states.
8+
*/
9+
describe("page-icon design spec compliance", () => {
10+
const source = readFileSync(join(__dirname, "page-icon.tsx"), "utf-8");
11+
12+
it("hover-reveal wrapper does not use transition classes", () => {
13+
// Design spec: "Hover states: no transition (instant)."
14+
// The opacity-0 → opacity-100 hover reveal must be instant.
15+
const lines = source.split("\n");
16+
const hoverRevealLines = lines.filter(
17+
(line) =>
18+
line.includes("opacity-0") &&
19+
line.includes("group-hover")
20+
);
21+
22+
for (const line of hoverRevealLines) {
23+
expect(line).not.toContain("transition-opacity");
24+
expect(line).not.toMatch(/duration-\d+/);
25+
}
26+
});
27+
});

src/components/page-icon.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export function PageIcon({ pageId, initialIcon }: PageIconProps) {
6666
}
6767

6868
return (
69-
<div className="mb-1 opacity-0 group-hover/page-header:opacity-100 transition-opacity">
69+
<div className="mb-1 opacity-0 group-hover/page-header:opacity-100">
7070
<EmojiPicker
7171
open={open}
7272
onOpenChange={setOpen}

0 commit comments

Comments
 (0)