Skip to content

feat: show innermost component and computed styles on hover (opt-in)#192

Open
kainulla wants to merge 6 commits into
benjitaylor:mainfrom
kainulla:feat/hover-component-and-styles
Open

feat: show innermost component and computed styles on hover (opt-in)#192
kainulla wants to merge 6 commits into
benjitaylor:mainfrom
kainulla:feat/hover-component-and-styles

Conversation

@kainulla

@kainulla kainulla commented Jul 7, 2026

Copy link
Copy Markdown

Two opt-in hover tooltip improvements.

What changed

Show component on hover — when enabled, the tooltip shows only the innermost React component (e.g. <NavLink>) instead of the full tree (<App> <Layout> <Sidebar> <NavLink>) which gets truncated by the 280px max-width and hides the most relevant component.

Show styles on hover — when enabled, the tooltip shows computed CSS styles (reusing getDetailedComputedStyles) directly on hover, so you don't have to click the element and expand the accordion every time.

Both settings are off by default and live in the settings panel below "Block page interactions".

Commits

  1. Add hoverShowComponent / hoverShowStyles to ToolbarSettings + defaults
  2. Extend HoverInfo type with innermostComponent and computedStylesObj
  3. Populate the new fields in the mousemove handler
  4. Render them in the hover tooltip JSX
  5. Add SCSS classes for the styles block
  6. Add the two checkbox toggles to the settings panel

Closes #191

kainulla added 6 commits July 7, 2026 13:12
Two new boolean fields on ToolbarSettings, both default to false.
Persisted in localStorage alongside existing settings.
…sObj

Adds two optional fields to HoverInfo so the hover handler can pass
computed data to the tooltip renderer.
The mousemove handler now:
- Splits the React component path and keeps the last (innermost) entry
- Calls getDetailedComputedStyles when hoverShowStyles is enabled
- Passes both to setHoverInfo for the tooltip to consume
When hoverShowComponent is on, the tooltip shows only the innermost
React component instead of the full truncated tree.

When hoverShowStyles is on, computed CSS styles are rendered below
the element name in a monospace block. Tooltip Y position adjusts
dynamically based on the number of style lines.
Adds .hoverStyles, .hoverStyleLine, .hoverStyleProp, .hoverStyleVal
with monospace font, subtle separator, and dimmed property names.
Two new CheckboxField entries in the settings panel:
- 'Show component on hover' with help tooltip
- 'Show styles on hover' with help tooltip

Both unchecked by default, placed below 'Block page interactions'.
@vercel

vercel Bot commented Jul 7, 2026

Copy link
Copy Markdown

@kainulla is attempting to deploy a commit to the Benji Taylor's Projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hover tooltip: show only the innermost component + show computed styles

1 participant