Skip to content

Create hover managers with the shared hook - #17232

Draft
dhruvisompura wants to merge 2 commits into
15879-tooltipsfrom
dhruvi/share-hover-manager-hook
Draft

dhruvisompura wants to merge 2 commits into
15879-tooltipsfrom
dhruvi/share-hover-manager-hook

Conversation

@dhruvisompura

@dhruvisompura dhruvisompura commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #17165. This PR targets that branch, so merge #17165 first.

Summary

#17165 adds usePositronActionBarHoverManager, a hook that creates a PositronActionBarHoverManager for a React component and disposes it on unmount. Four components already did the same thing with a copied useState + useEffect block. This PR switches them to the hook:

  • positronActionBarState.tsx (the manager every Positron action bar shares)
  • consoleTabList.tsx (console session tabs)
  • environmentHealthSection.tsx (welcome page environment health section)
  • dataConnectionNodeDetailsPage.tsx (Data Connections details page)

There is no behavior change. Each component still creates one manager with the same settings, at the same time.

PositronActionBarState.hoverManager is now typed IHoverManager | undefined. The manager is created in an effect, so it has always been undefined on the first render. The old code hid that with useState<IHoverManager>(undefined!). Every reader already handled undefined except currentWorkingDirectory.tsx, which now uses ?..

Touching currentWorkingDirectory.tsx makes the pre-commit hook lint the whole file, and it fails on an existing jsx-a11y/no-static-element-interactions error. The working-directory label is a div with mouse handlers, and its right-click copy menu has no keyboard path. Fixing that is out of scope here, so this PR adds an eslint-disable-next-line comment that names it as existing debt.

Release Notes

New Features

  • N/A

Bug Fixes

  • N/A

Validation Steps

@:console @:sessions @:welcome @:connections @:editor-action-bar @:variables

Hover over buttons in a pane action bar, the console session tabs, the welcome page environment health section, and the Data Connections details page. Each tooltip should look and behave the same as before.

The action bar state, console tab list, welcome page environment health section, and Data Connections details page each built a PositronActionBarHoverManager with the same useState and useEffect block. Use usePositronActionBarHoverManager instead.
@github-actions

Copy link
Copy Markdown
Contributor

E2E Tests 🚀
This PR will run tests tagged with: @:critical @:console @:sessions @:welcome @:connections @:editor-action-bar @:variables

Why these tags?
Tag Source
@:critical Always runs (required)
@:console PR description
@:sessions PR description
@:welcome PR description
@:connections PR description
@:editor-action-bar PR description
@:variables PR description

More on automatic tags from changed files.

Test count: Linux: 244 tests across 2 shards.

readme  valid tags

The action bar creates its hover manager in an effect, so it is undefined on the first render. Type it that way instead of asserting it exists, and guard the one reader that called it directly.
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.

1 participant