Skip to content

Commit 6552b40

Browse files
ryan-williamsclaude
andcommitted
feat: add KbdTooltip adapter for use-kbd's pluggable tooltip
Add adapter component that bridges our Floating UI tooltip to use-kbd's `TooltipComponent` interface. This provides rich tooltips for digit placeholders in keyboard sequences (e.g., "One or more digits" for `##`). Also updates use-kbd and use-prms to latest GitHub dist branches. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 87c84c6 commit 6552b40

File tree

4 files changed

+35
-18
lines changed

4 files changed

+35
-18
lines changed

www/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
"react-plotly.js": "^2.6.0",
3838
"recharts": "^3.1.0",
3939
"uplot": "^1.6.32",
40-
"use-kbd": "github:runsascoded/use-kbd#d51354bbde2bf134570d81a5f8eee69ed730c0d8",
41-
"use-prms": "^0.4.0",
40+
"use-kbd": "github:runsascoded/use-kbd#caa1afd04827fe79ff3f313cd7e01b2c08372f78",
41+
"use-prms": "github:runsascoded/use-prms#cf28edc59fea41899aca2ada69499cd11604f60e",
4242
"use-session-storage-state": "^19.0.1"
4343
},
4444
"devDependencies": {

www/pnpm-lock.yaml

Lines changed: 14 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

www/src/App.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { AwairChart } from './components/AwairChart'
77
import { DevicePoller, type DeviceDataResult } from './components/DevicePoller'
88
import { TableNavigationRenderer, YAxisMetricsRenderer } from './components/groupRenderers'
99
import { ThemeToggle } from './components/ThemeToggle'
10+
import { KbdTooltip } from './components/Tooltip'
1011
import { HOTKEY_GROUPS, HOTKEY_GROUP_ORDER } from './config/hotkeyConfig'
1112
import { ThemeProvider } from './contexts/ThemeContext'
1213
import { useDevices } from './hooks/useDevices'
@@ -218,6 +219,7 @@ function AppContent() {
218219
groupRenderers={GROUP_RENDERERS}
219220
editable
220221
hint="Click any key to customize"
222+
TooltipComponent={KbdTooltip}
221223
/>
222224
<Omnibar placeholder="Search actions..." maxResults={15} />
223225
<LookupModal />

www/src/components/Tooltip.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,23 @@ interface TooltipProps {
1919
maxWidth?: number
2020
}
2121

22+
/**
23+
* Adapter for use-kbd's TooltipComponent interface.
24+
* Wraps children in a span to ensure cloneability.
25+
*/
26+
interface KbdTooltipProps {
27+
title: string
28+
children: ReactNode
29+
}
30+
31+
export function KbdTooltip({ title, children }: KbdTooltipProps) {
32+
return (
33+
<Tooltip content={title}>
34+
<span style={{ display: 'contents' }}>{children}</span>
35+
</Tooltip>
36+
)
37+
}
38+
2239
export function Tooltip({ children, content, maxWidth = 300 }: TooltipProps) {
2340
const [isOpen, setIsOpen] = useState(false)
2441

0 commit comments

Comments
 (0)