- SUMMARY.md: tooltip placement fix and hover+pin behavior documented - STATE.md: decisions added, session updated, progress at 100% - ROADMAP.md: Phase 9 plan 5/5 complete
6.1 KiB
6.1 KiB
phase, plan, subsystem, tags, requires, provides, affects, tech-stack, key-files, key-decisions, patterns-established, requirements-completed, duration, completed
| phase | plan | subsystem | tags | requires | provides | affects | tech-stack | key-files | key-decisions | patterns-established | requirements-completed | duration | completed | |||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 09-md3-components | 05 | ui |
|
|
|
|
|
|
|
|
|
10min | 2026-04-01 |
Phase 9 Plan 05: Tooltip Placement and Hover Fix Summary
Tooltip icon moved from above field to inline with helpText below it, with hover-to-preview and click-to-pin behavior via dual hoverTooltip+showTooltip state
Performance
- Duration: ~10 min
- Started: 2026-04-01T09:10:00Z
- Completed: 2026-04-01T09:20:34Z
- Tasks: 2
- Files modified: 5
Accomplishments
- Added
helpTextPrefixprop to TextFieldMD3 for rendering inline content (tooltip icon) left of helpText below the field - Fixed tooltip icon position: moved from above the floating-label input to beside helpText below it
- Implemented hover-to-preview (mouseEnter shows, mouseLeave hides) and click-to-pin (stays open through mouseLeave) in FieldRenderer and PasswordField
- Fixed click-unpin edge case: second click explicitly clears hoverTooltip so tooltip dismisses even when mouse stays on button
- Added 7 new tests covering all tooltip hover/pin/unpin behaviors and helpTextPrefix rendering
Task Commits
Each task was committed atomically:
- Task 1: Add helpTextPrefix prop and fix tooltip placement + hover -
23617c0(feat) - Task 2: Add tests for tooltip hover behavior and helpTextPrefix rendering -
d2b6da2(test)
Files Created/Modified
src/components/ui/TextFieldMD3.tsx- AddedhelpTextPrefix?: React.ReactNodeprop; changed helpText guard to(helpText || helpTextPrefix) && !error; renders<div className="flex items-start gap-1">wrapping prefix + helpTextsrc/components/ui/FieldRenderer.tsx- AddedhoverTooltipstate; moved tooltip icon from above-field totooltipIconelement passed ashelpTextPrefix; tooltip content rendered below TextFieldMD3; select-branch also gains hover supportsrc/components/ui/PasswordField.tsx- Same dual-state tooltip fix as FieldRenderer text-branchsrc/components/ui/FieldRenderer.test.tsx- AddedfireEventimport; added 4 hover behavior tests (hover shows, leave hides, click pins, second-click unpins)src/components/ui/TextFieldMD3.test.tsx- Added Tests 9-11 for helpTextPrefix with helpText, without, and prefix-only
Decisions Made
- Click-to-unpin must explicitly clear
hoverTooltipbecauseuserEvent.click()simulates hover before click, leavinghoverTooltip=trueafter second click — requiredsetShowTooltip(v => { if (v) setHoverTooltip(false); return !v; }) - Tooltip content stays outside TextFieldMD3 (rendered after the component in FieldRenderer/PasswordField) — keeps TextFieldMD3 self-contained, tooltip is a consumer concern
Deviations from Plan
Auto-fixed Issues
1. [Rule 1 - Bug] Fixed click-unpin leaving tooltip visible due to hoverTooltip race
- Found during: Task 1 verification (RemoteConfigStep.test.tsx "hides tooltip panel when clicked again")
- Issue:
userEvent.click()simulates mouseEnter before click; second click setshowTooltip=falsebuthoverTooltipstayed true, so tooltip remained visible - Fix: Changed click handler to
setShowTooltip(v => { if (v) setHoverTooltip(false); return !v; })— clears hover state when unpinning - Files modified: src/components/ui/FieldRenderer.tsx, src/components/ui/PasswordField.tsx
- Verification: All 186 tests pass including RemoteConfigStep "hides tooltip panel when clicked again"
- Committed in:
23617c0(Task 1 commit)
Total deviations: 1 auto-fixed (Rule 1 - bug) Impact on plan: Required for correctness — without this fix, tooltip could not be dismissed by click when mouse was over the button.
Issues Encountered
- Click-unpin sticky tooltip:
userEvent.clicktriggers hover state before click event. Resolved by clearinghoverTooltipin the unpin branch of the click handler.
User Setup Required
None - no external service configuration required.
Next Phase Readiness
- UAT test 7 (Tooltip Info Buttons Accessibility) now satisfies all criteria: hover shows, mouseLeave hides, click pins, click again unpins, icon beside helpText below field
- Phase 9 (09-md3-components) fully complete — all must-have truths and requirements satisfied
- Ready for Phase 10
Phase: 09-md3-components Completed: 2026-04-01