UI Tooltip System Plan
+ +Task Summary
+
+ Make project tooltips readable by default and replace remaining browser-native
+ title tooltips with one consistent DOM/CSS tooltip pattern.
+
Current Behavior
+-
+
- The new readiness tooltip pattern uses
.ui-tooltipwithdata-tooltip, but the surface is visually too transparent or too close to the page background, so text is hard to read.
+ - Some dashboard elements still use browser-native
titleonly, including EnergyBank helper/marker UI.
+ - Navigation icon actions and admin readiness tables still rely on
titlefor tooltip text.
+ - Chart.js has its own canvas tooltip plugin configuration in
internal/ui/static/charts.js; that is a separate mechanism and not the source of the transparent DOM tooltip problem.
+
Desired Behavior
+-
+
- All DOM tooltips use a shared
.ui-tooltippattern with an opaque, high-contrast background in light and dark themes.
+ - Tooltip text appears on hover and keyboard focus, with
aria-labelpreserving accessible names.
+ - Converted elements use
data-tooltipfor the visible tooltip text. Nativetitleshould be removed from converted controls to avoid duplicate browser bubbles.
+ - The old browser tooltip must be disabled wherever the new tooltip is used; there should never be two competing tooltip layers on the same element. +
- Tooltips should not clip at common dashboard edges, including the right side of hero cards and table cells. +
- Chart.js canvas tooltips remain unchanged in this PR unless we find a direct visual regression there. +
Assumptions
+-
+
- "Replace all Tooltips" means all HTML/browser
titletooltips in the Go templates, not Chart.js internal canvas tooltips.
+ - It is acceptable to add keyboard focusability via
tabindex="0"to non-interactive elements that expose explanatory tooltip text.
+ - Admin-only readiness pages should be included because they currently contain title-only tooltip content. +
Likely File Changes
+-
+
internal/ui/style.go— harden shared tooltip CSS: opaque surface, readable contrast, shadow, border, max-width, alignment helpers, focus behavior.
+ internal/ui/templates/pages/dashboard.html— convert remaining dashboardtitlehelpers/markers todata-tooltip.
+ internal/ui/templates/nav.html— convert navigation icon tooltips to the shared pattern.
+ internal/ui/templates/partials/admin_readiness_contract.html— convert admin readiness contract cell titles.
+ internal/ui/templates/partials/admin_readiness_monitoring.html— convert monitoring reason titles.
+ internal/ui/dashboard_illness_template_test.goandinternal/ui/admin_readiness_redesign_contract_test.go— update expectations fromtitletodata-tooltip/aria-labelwhere needed.
+
Implementation Steps
+-
+
- Inventory template-level
title=usage again and classify each as DOM tooltip, accessibility label, or non-tooltip metadata.
+ - Update
.ui-tooltipCSS so the tooltip bubble uses an explicit opaque background and readable foreground instead of relying only on potentially translucent surface tokens.
+ - Add small alignment modifiers if needed, for example right-aligned tooltips near card edges or table cells. +
- Convert title-only tooltip elements to
class="ui-tooltip",data-tooltip, andaria-label; addtabindex="0"for focusable explanatory spans/cells.
+ - Remove converted native
titleattributes to prevent duplicate tooltip UI.
+ - Search the touched templates after conversion and verify that no converted
.ui-tooltipelement still carriestitle.
+ - Update tests to assert the new tooltip contract. +
- Update this plan with actual changes, checks run, limitations, and follow-up notes after implementation. +
Test Plan
+-
+
- Run
git diff --check.
+ - Run
go test ./internal/ui -count=1.
+ - Run
go test ./... -count=1if the localized UI test pass is clean.
+ - Manual QA in browser: readiness confidence badge, readiness methodology badge, EnergyBank helper/marker, nav settings/admin/logout controls, admin readiness contract table, admin readiness monitoring table. +
- Manual QA light and dark modes where possible, including long Russian/Serbian tooltip text and narrow viewport behavior. +
Manual QA Checklist
+-
+
- Tooltip background is opaque enough that text is readable over dashboard cards and charts. +
- Hover and keyboard focus both show tooltip content. +
- No browser-native duplicate tooltip appears on converted elements. +
- Converted elements expose exactly one visible tooltip layer: the shared
.ui-tooltipbubble.
+ - Tooltip does not resize or shift the underlying layout. +
- Tooltip is not clipped by hero/dashboard containers or table wrappers in the common desktop viewport. +
Risks
+-
+
- Table-cell tooltips may need careful positioning so they do not hide neighboring values or create awkward keyboard tab stops. +
- Removing
titlechanges browser-native fallback behavior; accessibility is preserved througharia-label, but visual behavior now depends on CSS.
+ - Fixing clipping with
overflow: visibleor z-index changes can accidentally let tooltips overlap nearby controls. This needs manual QA.
+ - Touch screens do not have hover. Focus/tap behavior improves this, but it will not be identical to desktop hover. +
Rollback Plan
+-
+
- Revert the tooltip CSS and template conversion commit. +
- Because this is UI-only template/CSS work, rollback does not require database or deployment-state migration. +
- If only one converted area misbehaves, restore that area to the previous
titlebehavior while keeping the opaque tooltip CSS fix.
+
Open Questions
+-
+
- Should admin table-cell tooltips be focusable with
tabindex="0", or should we only show them on mouse hover to keep keyboard navigation shorter? Recommendation: make them focusable because the content is explanatory.
+ - Should Chart.js canvas tooltips be redesigned in a separate pass? Recommendation: no for this PR; leave canvas chart behavior untouched unless QA reveals the same readability problem there. +
Approval Gate
+
+ Production code should not be changed until this plan is approved.
+ After approval, implementation will proceed on a new codex/
+ branch and be delivered through a pull request.
+
Implementation Update
+Status: implemented on codex/ui-tooltip-system.
-
+
- Added dedicated opaque tooltip tokens in
internal/ui/style.gofor light and dark mode.
+ - Updated
.ui-tooltipto use a high-contrast opaque surface, higher z-index, hidden visibility while inactive, and alignment helpers.
+ - Removed native
titlefrom converted dashboard readiness tooltips so only the shared tooltip appears.
+ - Converted EnergyBank helper/marker, navigation actions, and admin readiness table cells from
titletodata-tooltip+aria-label.
+ - Updated the admin readiness contract test to assert the new
data-tooltipcontract.
+ - Left Chart.js canvas tooltips unchanged because they are a separate plugin mechanism. +
Checks Run
+-
+
rg -n "title=|data-tooltip|ui-tooltip" internal/ui/templates internal/ui/style.go internal/ui/*_test.go— no templatetitle=attributes remain.
+ gofmt -w internal/ui/admin_readiness_redesign_contract_test.go
+ git diff --check
+ go test ./internal/ui -count=1
+ go test ./... -count=1
+
Known Limitations
+-
+
- Manual visual QA in an authenticated browser is still recommended before or immediately after deployment, especially for admin table cells and narrow viewports. +
- Touch behavior remains inherently different from desktop hover; converted explanatory elements are keyboard-focusable where they are not already interactive. +