Repository navigation
Create hover managers with the shared hook - #17232
Draft
dhruvisompura wants to merge 2 commits into
Draft
dhruvisompura wants to merge 2 commits into
dhruvisompura wants to merge 2 commits into
Conversation
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.
Contributor
|
E2E Tests 🚀 Why these tags?
More on automatic tags from changed files. Test count: Linux: 244 tests across 2 shards. |
dhruvisompura
marked this pull request as draft
November 10, 2026 01:20
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #17165. This PR targets that branch, so merge #17165 first.
Summary
#17165 adds
usePositronActionBarHoverManager, a hook that creates aPositronActionBarHoverManagerfor a React component and disposes it on unmount. Four components already did the same thing with a copieduseState+useEffectblock. 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.hoverManageris now typedIHoverManager | undefined. The manager is created in an effect, so it has always beenundefinedon the first render. The old code hid that withuseState<IHoverManager>(undefined!). Every reader already handledundefinedexceptcurrentWorkingDirectory.tsx, which now uses?..Touching
currentWorkingDirectory.tsxmakes the pre-commit hook lint the whole file, and it fails on an existingjsx-a11y/no-static-element-interactionserror. The working-directory label is adivwith mouse handlers, and its right-click copy menu has no keyboard path. Fixing that is out of scope here, so this PR adds aneslint-disable-next-linecomment that names it as existing debt.Release Notes
New Features
Bug Fixes
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.