Skip to content

Commit e41acf1

Browse files
committed
Add deep select: Cmd+hover to pierce through overlays and wrappers
Hold Cmd (Mac) / Ctrl (Win) while hovering to scan through invisible overlays, empty container wrappers, and opacity:0 animation ghosts to select the actual content underneath. Two-pass pierce algorithm: 1. Find elements with direct text content (skips empty wrappers) 2. Smallest visible element fallback (catches visual-only elements) Also improves element identification: direct text content is now checked before class names, so "$54" shows instead of "styles.price". Visual indicators: dashed highlight border and "⇣ deep select" label in the hover tooltip when pierce mode is active. Adds animated demo to the features page with keyboard shortcut entry.
1 parent 6a83b72 commit e41acf1

File tree

8 files changed

+803
-16
lines changed

8 files changed

+803
-16
lines changed

package/example/src/app/SideNav.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@ export function SideNav() {
391391
{ id: 'smart-identification', text: 'Smart Identification' },
392392
{ id: 'computed-styles', text: 'Computed Styles' },
393393
{ id: 'react-detection', text: 'React Detection' },
394+
{ id: 'deep-select', text: 'Deep Select' },
394395
{ id: 'keyboard-shortcuts', text: 'Keyboard Shortcuts' },
395396
{ id: 'agent-sync', text: 'Agent Sync' },
396397
{ id: 'settings', text: 'Settings' },
Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
/* ─────────────────────────────────────────────────────────
2+
* Deep Select Demo
3+
* Reuses shared demo-window / demo-browser-bar / demo-content
4+
* from FeaturesDemo.css
5+
* ───────────────────────────────────────────────────────── */
6+
7+
/* Page layout — sidebar + main */
8+
.dsd-page-layout {
9+
display: flex;
10+
gap: 12px;
11+
height: 100%;
12+
}
13+
14+
.dsd-sidebar {
15+
display: flex;
16+
flex-direction: column;
17+
gap: 6px;
18+
padding-top: 2px;
19+
}
20+
21+
.dsd-sidebar-item {
22+
width: 28px;
23+
height: 28px;
24+
border-radius: 6px;
25+
background: rgba(0,0,0,0.06);
26+
}
27+
28+
.dsd-sidebar-item.active {
29+
background: rgba(0,0,0,0.12);
30+
}
31+
32+
.dsd-main {
33+
flex: 1;
34+
min-width: 0;
35+
}
36+
37+
.dsd-faux-title {
38+
width: 90px;
39+
height: 8px;
40+
background: rgba(0,0,0,0.1);
41+
border-radius: 4px;
42+
margin-bottom: 10px;
43+
}
44+
45+
/* Dashboard card */
46+
.dsd-card {
47+
position: relative;
48+
background: white;
49+
border-radius: 10px;
50+
padding: 12px 14px;
51+
box-shadow: 0 1px 3px rgba(0,0,0,0.06);
52+
}
53+
54+
.dsd-card-header {
55+
display: flex;
56+
align-items: center;
57+
gap: 6px;
58+
margin-bottom: 6px;
59+
}
60+
61+
.dsd-card-icon {
62+
width: 24px;
63+
height: 24px;
64+
background: #3b82f6;
65+
border-radius: 6px;
66+
opacity: 0.15;
67+
}
68+
69+
.dsd-card-label {
70+
font-size: 11px;
71+
font-weight: 500;
72+
color: rgba(0,0,0,0.4);
73+
font-family: system-ui, sans-serif;
74+
}
75+
76+
.dsd-card-value {
77+
font-size: 20px;
78+
font-weight: 700;
79+
color: rgba(0,0,0,0.8);
80+
font-family: system-ui, sans-serif;
81+
margin-bottom: 8px;
82+
letter-spacing: -0.5px;
83+
}
84+
85+
/* Mini bar chart — stronger opacity so bars read as data */
86+
.dsd-chart {
87+
display: flex;
88+
align-items: flex-end;
89+
gap: 4px;
90+
height: 28px;
91+
margin-bottom: 10px;
92+
}
93+
94+
.dsd-chart-bar {
95+
flex: 1;
96+
background: #3b82f6;
97+
border-radius: 3px 3px 0 0;
98+
opacity: 0.22;
99+
}
100+
101+
.dsd-chart-bar:nth-child(n+5) {
102+
opacity: 0.35;
103+
}
104+
105+
/* Export button — the target element */
106+
.dsd-export-btn {
107+
display: inline-block;
108+
padding: 6px 14px;
109+
background: rgba(0,0,0,0.8);
110+
color: white;
111+
font-size: 10px;
112+
font-weight: 600;
113+
font-family: system-ui, sans-serif;
114+
border-radius: 6px;
115+
}
116+
117+
/* Secondary metric cards below the main card */
118+
.dsd-mini-cards {
119+
display: flex;
120+
gap: 6px;
121+
margin-top: 6px;
122+
}
123+
124+
.dsd-mini-card {
125+
flex: 1;
126+
background: white;
127+
border-radius: 8px;
128+
padding: 8px 10px;
129+
box-shadow: 0 1px 3px rgba(0,0,0,0.06);
130+
}
131+
132+
.dsd-mini-label {
133+
font-size: 9px;
134+
font-weight: 500;
135+
color: rgba(0,0,0,0.35);
136+
font-family: system-ui, sans-serif;
137+
margin-bottom: 2px;
138+
}
139+
140+
.dsd-mini-value {
141+
font-size: 14px;
142+
font-weight: 700;
143+
color: rgba(0,0,0,0.7);
144+
font-family: system-ui, sans-serif;
145+
letter-spacing: -0.3px;
146+
}
147+
148+
/* Invisible overlay — the problem this feature solves */
149+
.dsd-overlay {
150+
position: absolute;
151+
inset: 0;
152+
border-radius: 10px;
153+
z-index: 2;
154+
background: rgba(239, 68, 68, 0);
155+
transition: background 0.3s ease;
156+
}
157+
158+
.dsd-overlay.flash {
159+
background: rgba(239, 68, 68, 0.05);
160+
}
161+
162+
/* Hover highlight */
163+
.ds-highlight {
164+
position: absolute;
165+
border-radius: 6px;
166+
pointer-events: none;
167+
z-index: 30;
168+
opacity: 0;
169+
transition: opacity 0.15s ease, border-color 0.15s ease;
170+
}
171+
172+
.ds-highlight.visible {
173+
opacity: 1;
174+
}
175+
176+
.ds-highlight.normal {
177+
border: 2px solid #3b82f6;
178+
}
179+
180+
.ds-highlight.pierce {
181+
border: 2px dashed #3b82f6;
182+
}
183+
184+
/* Hover tooltip — shows element name */
185+
.ds-tooltip {
186+
position: absolute;
187+
padding: 3px 8px;
188+
border-radius: 6px;
189+
font-size: 10px;
190+
font-weight: 500;
191+
font-family: 'SF Mono', SFMono-Regular, ui-monospace, monospace;
192+
white-space: nowrap;
193+
pointer-events: none;
194+
z-index: 35;
195+
opacity: 0;
196+
transform: translateY(2px);
197+
transition: opacity 0.15s ease, transform 0.15s ease;
198+
}
199+
200+
.ds-tooltip.visible {
201+
opacity: 1;
202+
transform: translateY(0);
203+
}
204+
205+
.ds-tooltip.wrong {
206+
background: rgba(0,0,0,0.75);
207+
color: rgba(255,255,255,0.5);
208+
}
209+
210+
.ds-tooltip.correct {
211+
background: rgba(0,0,0,0.85);
212+
color: rgba(255,255,255,0.95);
213+
}
214+
215+
/* Pierce label on tooltip — readable, not decorative */
216+
.ds-pierce-label {
217+
font-size: 9px;
218+
color: rgba(255,255,255,0.5);
219+
letter-spacing: 0.03em;
220+
margin-bottom: 1px;
221+
}

0 commit comments

Comments
 (0)