cloudfoundry / cloudfoundry/stratos

Polish CustomTooltipDirective styling + consolidate theme-toggle off native title

Open
#5,347 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
267
Forks
137
Avg merge
5h 14m
Merged PRs (30d)
77

Description

Context

While adding tooltips to icon-only buttons in the page-header (PR #5345 follow-up branch feature/ui-missing-tooltips), two facts surfaced:

  1. Two tooltip mechanisms in treeCustomTooltipDirective (selector [matTooltip], ~36 .html files use it) and a single native HTML title="" on the theme-toggle button. The theme-toggle case is the only native holdout in the page chrome.
  2. CustomTooltipDirective's current visual style is heavier than the OS-native equivalent — 12px font, 8px×12px padding, opaque #333 background. The native browser tooltip on the theme-toggle is visibly lighter and more compact, which reads better against both light and dark page backgrounds.

We picked the custom directive over native for three reasons that should stay: 250ms show delay (vs ~1.5s native), consistent OS/browser appearance, and themeability under dark/light. The fix is to polish the directive's look — not switch mechanisms.

Scope

  • src/frontend/packages/core/src/shared/components/custom-tooltip/custom-tooltip.directive.ts
    • Font size 12px → 11px
    • Padding 8px×12px → 4px×8px
    • Background #333 → semi-transparent black (e.g. rgba(0,0,0,0.78)) so it doesn't render heavy on light page backgrounds
    • Consider reading a CSS custom property for the background so the value can vary across light/dark themes via the existing theme variables (cf. theme-toggle for a peer that already swaps style by mode)
  • src/frontend/packages/core/src/shared/components/theme-toggle/theme-toggle.component.html
    • Replace title=\"Toggle theme ({{ getLabel() }})\" with matTooltip=\"Toggle theme ({{ getLabel() }})\"
    • Add CustomTooltipDirective to the component's imports[]
    • Result: a single mechanism handles all tooltips across stratos

Why deferred

The team has a hard sequencing pin on V2 retirement + remaining @ngrx removal waves landing first. This is small visual polish on top of a working mechanism — not blocking any user. Picking it up mid-V2-or-ngrx work risks dragging attention off the load-bearing migration.

Acceptance

  • All 36 (+ theme-toggle = 37) tooltip sites render with the new lighter style
  • Native browser tooltip no longer used anywhere in the page chrome
  • Visual parity verified across both light and dark themes
  • No regression in show delay / positioning / auto-flip behavior

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/frontend/packages/core/src/shared/components/custom-tooltip/custom-tooltip.directive.ts and inspect its current styling, then read theme-toggle.component.html and its imports. Update the directive’s visual treatment and replace the theme-toggle native title with matTooltip using CustomTooltipDirective. Done means all 37 page-chrome tooltip sites use the lighter style, both themes look consistent, and delay, positioning, auto-flip, and native-title removal meet the acceptance criteria.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
design, frontend
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
67/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.