Skip to content

Commit 0cf0f15

Browse files
committed
fix(opal): stop hidden Hoverable items from swallowing clicks
An `appear-on-hover` item only set `opacity: 0`, so at rest it was invisible but still hit-testable. In the sidebar that put a transparent popover trigger above the row's navigation overlay, which is `z-99` to the actions slot's `z-100`: clicking the right edge of a row opened the menu instead of opening the chat. This is why the classes it replaced worked — both `display: none` and `visibility: hidden` take the element out of hit-testing, and opacity does not. Every opacity rule now moves `pointer-events` with it. Local mode is deliberately excluded. It reveals on its own hover, so an item that could not be hovered could never be revealed. Also forwards `style` to the send button's spinner. Opal's iconWrapper sizes icons through `style`, not classes, so dropping it left the loader at its own default size. LineItem sizes with classes instead, which is why the file picker's loader does not need this.
1 parent 61cf55a commit 0cf0f15

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

web/lib/opal/src/core/animations/styles.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,23 @@
1919
opacity: 0;
2020
}
2121

22+
/* An invisible item must not intercept clicks aimed at what sits under it.
23+
Local mode is excluded: it reveals on its own hover, so taking its pointer
24+
events away would leave it permanently hidden. */
25+
.hoverable-item[data-hoverable-variant="appear-on-hover"]:not(
26+
[data-hoverable-local]
27+
) {
28+
pointer-events: none;
29+
}
30+
2231
/* Group mode — Root :hover controls descendant item visibility via CSS.
2332
Exclude local-mode items so they aren't revealed by an ancestor root. */
2433
[data-hover-group]:hover
2534
.hoverable-item[data-hoverable-variant="appear-on-hover"]:not(
2635
[data-hoverable-local]
2736
) {
2837
opacity: 1;
38+
pointer-events: auto;
2939
}
3040

3141
/* Local mode — item handles its own :hover */
@@ -40,6 +50,7 @@
4050
[data-hoverable-local]
4151
) {
4252
opacity: 1;
53+
pointer-events: auto;
4354
}
4455

4556
/* Group focus — any focusable descendant of the Root receives keyboard focus,
@@ -49,11 +60,13 @@
4960
[data-hoverable-local]
5061
) {
5162
opacity: 1;
63+
pointer-events: auto;
5264
}
5365

5466
/* Local focus — item (or a focusable descendant) receives keyboard focus */
5567
.hoverable-item[data-hoverable-variant="appear-on-hover"]:has(:focus-visible) {
5668
opacity: 1;
69+
pointer-events: auto;
5770
}
5871

5972
/* ---------------------------------------------------------------------------
@@ -71,6 +84,7 @@
7184
[data-hoverable-local]
7285
) {
7386
opacity: 0;
87+
pointer-events: none;
7488
}
7589

7690
/* Local mode */
@@ -85,6 +99,7 @@
8599
[data-hoverable-local]
86100
) {
87101
opacity: 0;
102+
pointer-events: none;
88103
}
89104

90105
/* Group focus */
@@ -93,6 +108,7 @@
93108
[data-hoverable-local]
94109
) {
95110
opacity: 0;
111+
pointer-events: none;
96112
}
97113

98114
/* Local focus */

web/src/sections/input/BaseInputBar.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,10 @@ const BaseInputBar = memo(
371371
<Button
372372
icon={
373373
sandboxInitializing
374-
? ({ className }) => (
374+
? ({ className, style }) => (
375375
<SvgLoader
376376
className={cn(className, "animate-spin")}
377+
style={style}
377378
/>
378379
)
379380
: SvgArrowUp

0 commit comments

Comments
 (0)