-
Notifications
You must be signed in to change notification settings - Fork 1
[Task] Modern API Polish Pass #21
Copy link
Copy link
Open
Labels
P3Polish and low-urgency itemsPolish and low-urgency itemsblast:3Cross-domain — touches shared code or 2+ feature domainsCross-domain — touches shared code or 2+ feature domainsclarity:3Direction known, details TBD — can start with questionsDirection known, details TBD — can start with questionsneeds-designRequires design work before implementationRequires design work before implementationrisk:2Small surface area, existing patterns, minor regression chanceSmall surface area, existing patterns, minor regression chanceseq:05Sequence step 5Sequence step 5size:MModerate scope, some design neededModerate scope, some design neededtype:featureNew functionality or capabilityNew functionality or capability
Description
Activity
Metadata
Metadata
Assignees
Labels
P3Polish and low-urgency itemsPolish and low-urgency itemsblast:3Cross-domain — touches shared code or 2+ feature domainsCross-domain — touches shared code or 2+ feature domainsclarity:3Direction known, details TBD — can start with questionsDirection known, details TBD — can start with questionsneeds-designRequires design work before implementationRequires design work before implementationrisk:2Small surface area, existing patterns, minor regression chanceSmall surface area, existing patterns, minor regression chanceseq:05Sequence step 5Sequence step 5size:MModerate scope, some design neededModerate scope, some design neededtype:featureNew functionality or capabilityNew functionality or capability
Context
Part of #8 (Web Components Migration).
Progressive enhancement layer — applying modern browser APIs for polish, performance, and delight. These are non-blocking improvements applied after the core migration works.
Scope
Modify:
src/styles/tokens.css— CSSlight-dark()migrationsrc/styles/tokens.css— CSScolor-mix(in oklch)for derived colorssrc/components/tb-tab-bar.js— View Transitions for tab switchingsrc/components/tb-preset-bar.js— View Transitions for preset selectionsrc/components/tb-flag-row.js— Popover API for flag description tooltipssrc/components/tb-flag-group.js—scheduler.postTask()for chunked renderingCurrent State
After the core migration (issues #9-#20), the app works with standard CSS and synchronous rendering. Theme switching uses
[data-theme="light"]overrides. Hover colors are hardcoded hex. Flag tooltips usetitleattribute. All 226 flag rows render synchronously. Tab switching is instant (no transition).Target State
CSS
light-dark()+color-schemeReplace
[data-theme="light"] { ... }override block with:Theme toggle sets
document.documentElement.style.colorScheme.CSS
color-mix(in oklch)Replace hardcoded hover/pressed colors:
View Transitions API
Wrap tab content swaps in
document.startViewTransition():With
::view-transition-old/::view-transition-newCSS for crossfade.Popover API
Replace
titleattribute on flag rows with styleable popover:scheduler.postTask()In
<tb-flag-group>, chunk flag row creation:Fallback:
requestIdleCallback.Implementation Hints
light-dark()inverts the argument order from the current theme — verify colors map correctlycolor-mix()inoklchgives perceptually uniform results (better thansrgbfor derived states)id— use the flag keyscheduler.postTask()may not be available in all browsers — feature-detect and fallbackDependencies
Definition of Done
light-dark()for all theme-varying tokenscolor-mix(in oklch)for hover/derived statesVerification