Repository navigation
fix: restore button shape transitions and indicator animations in Safari 26 - #168
Conversation
There was a problem hiding this comment.
📋 Review Summary
This PR addresses Safari 26 / WebKit rendering and animation issues across button shape morphing, menu item corner transitions, and progress/loading indicators. Key improvements include replacing 9999px pill radii and border-radius: inherit with explicit half-height min() clamping and logical corner radius properties, refactoring md-button styles into dedicated modules (button-styles.js and button-variant-styles.js), removing content-visibility: auto and contain: strict from indicators, and switching linear indeterminate progress to direct left/right and translate3d animations alongside WAAPI fallback for non-default circular tracks. Most changes are well-structured and backed by unit tests in tests/safari_animations_test.js, though there is a high-priority pointer-lifecycle bug in Button and IconButton where pointerleave after pointerup cancels the minimum press hold on touch taps, as well as a potential visual gap in wavy indeterminate linear progress if Safari 26 does not update --_l1-tail/--_l2-tail on .bar-inner.
🔍 General Feedback
- Good architectural clean-up in
buttons/button-group.js: consolidating the repeated corner shape variables via--_group-*custom properties and fixingsizepropagation (!button.hasAttribute('size')) andgroup-positionremoval whenconnectedis false makes the component much cleaner. - Resolving indicator and container colours natively via
getComputedStyleon.loadingand#canvasinindicators/loading.jsis a solid improvement over manualvar()string parsing alone. - In
tests/safari_animations_test.js, consider adding a test case that simulatespointerleaveimmediately followingpointerupon a fast tap to ensure the 150ms minimum press hold is preserved on touch devices.
📊 Token Usage & Cost Efficiency
| Metric | Value |
|---|---|
| Input Tokens (uncached) | 3,134 |
| Input Tokens (cached) | 611,498 (⚡ 99.4% cached) |
| PR Comments History Tokens | 547 |
| Thinking / Reasoning Tokens | 25,886 |
| Output Tokens | 1,280 |
| Total Session Tokens | 642,345 |
| Cost (uncached input) | $0.0055 |
| Cost (cached input) | $0.0459 |
| Cost (thinking / reasoning) | $0.1941 |
| Cost (response output) | $0.0096 |
| Estimated Total Cost | $0.2551 |
Gemini 4 Hydrogen: standard tier, global endpoint; regional endpoints are 10% higher.
Cache reads are priced here, but context-cache STORAGE, where the model charges for it separately per token-hour, is not included, so the figure can run slightly low.
There was a problem hiding this comment.
📋 Review Summary
This pull request resolves Safari 26 animation and shape-transition issues across Material 3 buttons, button groups, split buttons, ripples, elevation, menu items, and progress/loading indicators. Key improvements include clamping pill radii to half-height rather than 9999px, transitioning explicit logical corner radii instead of relying on border-radius: inherit, unifying pointer press handling with a 150ms minimum hold, removing content-visibility: auto and contain: strict from indicator hosts, and replacing custom-property keyframe animations with direct CSS properties and WAAPI fallbacks. The previously raised pointer-release race conditions in Button and IconButton as well as the indeterminate wavy linear track-anchoring issue have been cleanly addressed, though one CSS selector specificity conflict remains for pressed square and selected buttons.
✅ Resolved Items from Prior Reviews
- Guarded
#onPointerCancelinButtonso apointerleaveevent immediately followingpointerupon touch taps no longer cancels the 150ms#releaseTimerhold. (buttons/button.js:251) - Guarded
#onPointerCancelinIconButtonwith!this.pressed || this.#releaseTimerto preserve the 150ms press hold across touchpointerup->pointerleavesequences. (buttons/icon-button.js:204) - Added direct
m3-l1-tail-cqiandm3-l2-tail-cqianimations withmargin-left: calc(-1 * var(--_wavelength))on wavy indeterminate.bar-innerelements so track-anchoring animates reliably in Safari 26 without a trailing gap. (indicators/progress-styles.js:400)
🔍 General Feedback
- Extracting button styles into
buttons/button-styles.jsandbuttons/button-variant-styles.jsand centralising connected group corner mapping inbuttons/button-group.jssignificantly improves maintainability. - Replacing
mask-positionkeyframes with GPU-compositedtranslate3d()for wavy linear progress and usinggetComputedStyle()colour resolution inmd-loadingare solid, standards-compliant improvements. - The new
tests/safari_animations_test.jssuite provides focused coverage for the CSS transition contracts, press-hold timer lifecycle, and indicator animation rules.
📊 Token Usage & Cost Efficiency
| Metric | Value |
|---|---|
| Input Tokens (uncached) | 2,199 |
| Input Tokens (cached) | 615,905 (⚡ 99.4% cached) |
| PR Comments History Tokens | 1,482 |
| Thinking / Reasoning Tokens | 26,311 |
| Output Tokens | 1,645 |
| Total Session Tokens | 647,542 |
| Cost (uncached input) | $0.0055 |
| Cost (cached input) | $0.0462 |
| Cost (thinking / reasoning) | $0.1973 |
| Cost (response output) | $0.0123 |
| Estimated Total Cost | $0.2614 |
Gemini 4 Hydrogen: standard tier, global endpoint; regional endpoints are 10% higher.
Cache reads are priced here, but context-cache STORAGE, where the model charges for it separately per token-hour, is not included, so the figure can run slightly low.
There was a problem hiding this comment.
📋 Review Summary
This PR addresses Safari 26 animation and rendering regressions across buttons, ripples, elevation, menu items, and progress/loading indicators. Key fixes include replacing 9999px pill radii and border-radius: inherit on :host with half-height clamped logical corner variables, enforcing a 150ms minimum press hold with pointer-cancel guards, replacing CSS.registerProperty calc() animations and mask-position animations with direct left/right/cqi and GPU translate3d keyframes, and removing contain: strict / content-visibility: auto from indicators. The changes are well-structured—extracting button-styles.js and button-variant-styles.js improves modularity—and are backed by unit tests in tests/safari_animations_test.js.
✅ Resolved Items from Prior Reviews
- Guarded
Button.#onPointerCancelwith!this.pressed || this.#releaseTimersopointerleaveimmediately followingpointerupdoes not cancel the 150ms minimum press hold timer. (buttons/button.js:251) - Guarded
IconButton.#onPointerCancelwith!this.pressed || this.#releaseTimersopointerleaveimmediately followingpointeruppreserves the 150ms minimum press hold timer. (buttons/icon-button.js:204) - Added direct
m3-l1-tail-cqiandm3-l2-tail-cqikeyframes paired withmargin-left: calc(-1 * var(--_wavelength))on.wavy.indeterminate.registered-props .bar-innerso track-anchoring animates in Safari 26 without relying on custom-propertycalc()invalidation. (indicators/progress-styles.js:400) - Added
:not([pressed])to standaloneshape='square'andselectedshape rules inbuttons/button-styles.jsso pressed corner morphing takes precedence. (buttons/button-styles.js:373) - Added
:not([pressed])to standaloneshape='square'andselectedshape rules inbuttons/icon-button-styles.jsso pressed corner morphing takes precedence. (buttons/icon-button-styles.js:814)
🔍 General Feedback
- Extracting button styles into
buttons/button-styles.jsandbuttons/button-variant-styles.jswhile re-exportingbuttonStylesfrombuttons/button.jskeeps the component logic concise and preserves backwards compatibility. - Fixing
ButtonGroup.updateConnectedPositions()to check!button.hasAttribute('size')instead of!button.sizeresolves a bug wheresizeon<md-button-group>was ignored becauseButtoninitialisesthis.size = 'small'. - Resolving indicator and container colours via
getComputedStyleon rendered elements inLoading.updateResolvedColors()avoids brittle manualvar()parsing for modern CSS colour functions and theme tokens. - Replacing
9999pxpill tokens withmin(..., calc(var(--_container-height) / 2))and using0pxunits inSplitButtonensures corner morph transitions interpolate smoothly in WebKit/Safari without stalling.
📊 Token Usage & Cost Efficiency
| Metric | Value |
|---|---|
| Input Tokens (uncached) | 896 |
| Input Tokens (cached) | 617,735 (⚡ 99.4% cached) |
| PR Comments History Tokens | 2,835 |
| Thinking / Reasoning Tokens | 24,052 |
| Output Tokens | 1,116 |
| Total Session Tokens | 646,634 |
| Cost (uncached input) | $0.0056 |
| Cost (cached input) | $0.0463 |
| Cost (thinking / reasoning) | $0.1804 |
| Cost (response output) | $0.0084 |
| Estimated Total Cost | $0.2407 |
Gemini 4 Hydrogen: standard tier, global endpoint; regional endpoints are 10% higher.
Cache reads are priced here, but context-cache STORAGE, where the model charges for it separately per token-hour, is not included, so the figure can run slightly low.
There was a problem hiding this comment.
📋 Review Summary
This PR resolves animation and shape-transition issues in Safari 26 across Material 3 buttons, button groups, split buttons, menu items, ripples, elevation, and loading/progress indicators. Key changes include clamping pill radii to half the container height (--_full-shape) instead of 9999px, transitioning explicit logical corner radii without cross-host border-radius: inherit, adding a 150ms pointer press hold on buttons and icon buttons, removing content-visibility: auto and contain: strict from md-loading and md-progress, and replacing custom-property @keyframes in md-progress with direct left/right/cqi keyframes, translate3d, and a WAAPI fallback for custom circular track sizes. All six previously raised review threads have been addressed cleanly, and unit test coverage in tests/safari_animations_test.js validates the CSS rules and pointer press state machine.
✅ Resolved Items from Prior Reviews
- Guarded
#onPointerCancelinButtonwithif (!this.pressed || this.#releaseTimer) returnsopointerleavefired immediately afterpointerupon touch taps preserves the 150ms press hold. (buttons/button.js:251) - Guarded
#onPointerCancelinIconButtonwithif (!this.pressed || this.#releaseTimer) returnsopointerleavefired immediately afterpointerupon touch taps preserves the 150ms press hold. (buttons/icon-button.js:204) - Added direct
m3-l1-tail-cqiandm3-l2-tail-cqikeyframes withmargin-left: calc(-1 * var(--_wavelength))on.linear.progress.wavy.indeterminate.registered-props .bar-innerso track-anchoring animates natively in Safari 26 without a trailing gap. (indicators/progress-styles.js:400) - Excluded
[pressed]from standalone square and selected shape selectors inbuttons/button-styles.jsso pressed corner morphing takes precedence. (buttons/button-styles.js:373) - Excluded
[pressed]from standalone square and selected shape selectors inbuttons/icon-button-styles.jsso pressed corner morphing takes precedence. (buttons/icon-button-styles.js:814) - Aligned selected
md-menu-itemandmd-select-optioninner shape tokens (md-item,md-ripple,md-focus-ring, and.list-item) via--_shape-*without relying on cross-hostinherit. (menu/menu-item.js:96)
🔍 General Feedback
- Extracting button styles into
buttons/button-styles.jsandbuttons/button-variant-styles.jsand collapsing the duplicated corner variable mappings inbuttons/button-group.jssignificantly improves readability and maintainability. - Fixing
Button.handleSlotChange()to populatehasIconand updatingButtonGroup.updateConnectedPositions()to check!button.hasAttribute('size')and removegroup-positionwhen not connected resolve real layout and token-propagation bugs. - Resolving indicator and container colours in
md-loadingviagetComputedStyleon.loadingand#canvascleanly handles CSS functions such aslight-dark()andcolor-mix()that 2D canvas cannot parse directly. - Unit tests in
tests/safari_animations_test.jsthoroughly verify the press-hold and drag-off pointer behaviour, CSS token invariants, and reduced-motion rules.
📊 Token Usage & Cost Efficiency
| Metric | Value |
|---|---|
| Input Tokens (uncached) | 260 |
| Input Tokens (cached) | 619,823 (⚡ 99.4% cached) |
| PR Comments History Tokens | 3,435 |
| Thinking / Reasoning Tokens | 27,991 |
| Output Tokens | 1,186 |
| Total Session Tokens | 652,695 |
| Cost (uncached input) | $0.0055 |
| Cost (cached input) | $0.0465 |
| Cost (thinking / reasoning) | $0.2099 |
| Cost (response output) | $0.0089 |
| Estimated Total Cost | $0.2709 |
Gemini 4 Hydrogen: standard tier, global endpoint; regional endpoints are 10% higher.
Cache reads are priced here, but context-cache STORAGE, where the model charges for it separately per token-hour, is not included, so the figure can run slightly low.
There was a problem hiding this comment.
📋 Review Summary
This PR resolves Safari 26 animation, corner-morphing, and painting issues across buttons, button groups, split buttons, ripples, elevation, menu items, and progress/loading indicators. Key fixes include replacing 9999px pill radii with half-height calc() clamping and explicit logical border-radius transitions, holding the pressed state for 150ms across touch tap pointerup/pointerleave sequences, and replacing custom-property calc() animations in linear and circular indeterminate progress indicators with direct keyframes, GPU translate3d transforms, and a WAAPI fallback for custom-sized circular tracks. All seven previously raised review items have been addressed cleanly, and the new unit tests in tests/safari_animations_test.js thoroughly verify the fixes.
✅ Resolved Items from Prior Reviews
- Guarded Button.#onPointerCancel with !this.pressed || this.#releaseTimer so pointerleave immediately following pointerup preserves the 150ms press hold while drag-off still clears immediately. (
buttons/button.js:251) - Guarded IconButton.#onPointerCancel with !this.pressed || this.#releaseTimer to preserve the 150ms press hold on touch taps. (
buttons/icon-button.js:204) - Added direct m3-l1-tail-cqi and m3-l2-tail-cqi keyframes with margin-left: calc(-1 * var(--_wavelength)) on wavy indeterminate .bar-inner elements so track-anchoring animates natively in Safari 26 without a +10cqi gap. (
indicators/progress-styles.js:400) - Excluded [pressed] from standalone square and selected shape rules in buttons/button-styles.js so pressed corner morphing takes precedence. (
buttons/button-styles.js:373) - Excluded [pressed] from standalone square and selected shape rules in buttons/icon-button-styles.js so pressed corner morphing takes precedence. (
buttons/icon-button-styles.js:814) - Unified corner radius tokens (--_shape-*) in menu/menu-item.js across :host, .list-item, md-ripple, md-item, and md-focus-ring for both positional and non-positional selected items. (
menu/menu-item.js:96) - Updated Progress._syncCustomCircularTrackAnimation to match animationName === 'circular-indeterminate-active' before falling back to activeAnims?.[0] when synchronising startTime under four-color mode. (
indicators/progress.js:193)
🔍 General Feedback
- Extracting button-styles.js and button-variant-styles.js makes Button much easier to read and keeps shape-morphing rules well structured alongside IconButton.
- Replacing string-only CSS variable parsing in Loading with getComputedStyle() on .loading and #canvas is a clean way to support modern CSS colour functions (such as light-dark() and color-mix()) in Canvas2D rendering.
- The added tests in tests/safari_animations_test.js provide solid regression coverage for the Safari 26 button shape transitions, press-hold timer behaviour, and indicator animation fixes.
📊 Token Usage & Cost Efficiency
| Metric | Value |
|---|---|
| Input Tokens (uncached) | 0 |
| Input Tokens (cached) | 621,330 (⚡ 99.4% cached) |
| PR Comments History Tokens | 3,693 |
| Thinking / Reasoning Tokens | 19,630 |
| Output Tokens | 1,041 |
| Total Session Tokens | 645,691 |
| Cost (uncached input) | $0.0055 |
| Cost (cached input) | $0.0466 |
| Cost (thinking / reasoning) | $0.1472 |
| Cost (response output) | $0.0078 |
| Estimated Total Cost | $0.2072 |
Gemini 4 Hydrogen: standard tier, global endpoint; regional endpoints are 10% higher.
Cache reads are priced here, but context-cache STORAGE, where the model charges for it separately per token-hour, is not included, so the figure can run slightly low.
There was a problem hiding this comment.
📋 Review Summary
This PR fixes Safari 26 / WebKit animation and shape-transition issues across Material 3 buttons, button groups, split buttons, menu items, ripples, elevation, and progress/loading indicators, accompanied by unit test coverage in tests/safari_animations_test.js. Key changes include replacing un-transitionable 9999px pill radii with half-height clamping and explicit logical corner transitions, introducing pointerdown/pointerup/pointerleave press-hold handling for tactile button morphing, moving md-loading colour resolution to computed styles, and replacing custom-property keyframe animations in md-progress with direct CSS/WAAPI animations. All eight prior review comments have been cleanly addressed in recent commits, and the remaining observations are a dynamic size-propagation edge case in md-button-group and minor outer-cap clipping in wavy linear indeterminate tracks.
✅ Resolved Items from Prior Reviews
- Guarded Button.#onPointerCancel with
if (!this.pressed || this.#releaseTimer) returnso a touchpointerleavefired immediately afterpointeruppreserves the 150ms minimum press hold. (buttons/button.js:251) - Guarded IconButton.#onPointerCancel with
if (!this.pressed || this.#releaseTimer) returnto preserve the 150ms minimum press hold on touch taps. (buttons/icon-button.js:204) - Added direct
m3-l1-tail-cqiandm3-l2-tail-cqikeyframes withmargin-left: calc(-1 * var(--_wavelength))on.wavy.indeterminate.registered-props .bar-innerso track-anchoring animates natively in Safari 26 without leaving a trailing gap. (indicators/progress-styles.js:400) - Excluded
[pressed]from standalone square and selected shape selectors inbuttons/button-styles.jsso pressed corner morphing takes precedence. (buttons/button-styles.js:373) - Excluded
[pressed]from standalone square and selected shape selectors inbuttons/icon-button-styles.jsso pressed corner morphing takes precedence. (buttons/icon-button-styles.js:814) - Updated
menu/menu-item.jsso selected items drive--_shape-*on:host,.list-item,md-ripple,md-item, andmd-focus-ringconsistently without relying on cross-hostinherit. (menu/menu-item.js:96) - Matched
animationName === 'circular-indeterminate-active'before falling back to[0]when synchronising custom circular indeterminate trackstartTimeinindicators/progress.js. (indicators/progress.js:193) - Tracked group-managed child button sizing with
#groupSizedButtons(WeakMap) inbuttons/button-group.jsso dynamicsizechanges on<md-button-group>propagate while preserving explicit childsizeattributes. (buttons/button-group.js:318)
🔍 General Feedback
- Extracting button styles into
buttons/button-styles.jsandbuttons/button-variant-styles.jscleanly separates shared shape/size logic from colour variant tokens and removes duplicatemd-elevationand[selected]CSS blocks. - The half-height
--_full-shapeclamping paired with0pxtokens inbuttons/split-button.jsand layer-promotedmd-ripple/md-elevationcorner transitions provides a solid cross-browser foundation for M3 Expressive shape morphing. - Using
tests/safari_animations_test.jsto verify pointer press-hold sequencing, WAAPIstartTimesynchronisation underfour-color, and selector invariants is a strong addition alongsidetests/progress_test.js.
📊 Token Usage & Cost Efficiency
| Metric | Value |
|---|---|
| Input Tokens (uncached) | 0 |
| Input Tokens (cached) | 623,246 (⚡ 99.4% cached) |
| PR Comments History Tokens | 4,213 |
| Thinking / Reasoning Tokens | 28,503 |
| Output Tokens | 1,576 |
| Total Session Tokens | 657,052 |
| Cost (uncached input) | $0.0063 |
| Cost (cached input) | $0.0467 |
| Cost (thinking / reasoning) | $0.2138 |
| Cost (response output) | $0.0118 |
| Estimated Total Cost | $0.2787 |
Gemini 4 Hydrogen: standard tier, global endpoint; regional endpoints are 10% higher.
Cache reads are priced here, but context-cache STORAGE, where the model charges for it separately per token-hour, is not included, so the figure can run slightly low.
There was a problem hiding this comment.
📋 Review Summary
This PR resolves Safari 26 / WebKit animation and transition stalls across expressive buttons, button groups, split buttons, ripples, elevation, menu items, and progress/loading indicators. Key fixes include clamping pill radii to half-height rather than 9999px, introducing explicit logical corner transitions and 150ms minimum press holds, switching indeterminate linear and wavy progress animations away from descendant custom-property calc() invalidation, and replacing content-visibility: auto / contain: strict with safer containment. All previously raised review comments have been addressed and covered by the new tests/safari_animations_test.js suite, with two minor issues remaining around WAAPI keyframe easing in indicators/progress.js and shape='square' specificity in buttons/button-group.js.
✅ Resolved Items from Prior Reviews
- Guarded
#onPointerCancelinButtonsopointerleaveimmediately followingpointerupdoes not cancel#releaseTimerduring the 150ms minimum press hold. (buttons/button.js:272) - Guarded
#onPointerCancelinIconButtonsopointerleaveimmediately followingpointeruppreserves the 150ms minimum press hold. (buttons/icon-button.js:225) - Added direct
m3-l1-tail-cqi/m3-l2-tail-cqikeyframes andmargin-left: calc(-1 * var(--_wavelength))on wavy indeterminate linear bars so track-anchoring animates natively without leaving a trailing gap. (indicators/progress-styles.js:413) - Added
:not([pressed])to standalone square and selected shape selectors inbuttons/button-styles.jsso pressed corner morphing takes precedence. (buttons/button-styles.js:374) - Added
:not([pressed])to standalone square and selected shape selectors inbuttons/icon-button-styles.jsso pressed corner morphing takes precedence. (buttons/icon-button-styles.js:815) - Unified corner radius tokens via
--_shape-*onmd-menu-itemandmd-select-optionso selected and positional items keep consistent radii across.list-item,md-item,md-ripple, andmd-focus-ring. (menu/menu-item.js:96) - Matched
animationName === 'circular-indeterminate-active'before falling back toactiveAnims?.[0]when synchronising custom-sized circular indeterminate trackstartTime. (indicators/progress.js:193) - Tracked group-propagated child sizing in
#groupSizedButtons(WeakMap) so dynamicsizeupdates on<md-button-group>propagate to inherited children whilst preserving explicit child sizes. (buttons/button-group.js:318) - Converted
sizeonButtonandIconButtonto an attribute-backed accessor (noAccessor: true) so default'small'does not spuriously reflect onto:host. (buttons/button-group.js:337) - Wrapped indeterminate linear track segments in
.indeterminate-trackswithborder-radius: var(--_track-shape)andoverflow: hiddenso outer track ends remain pill-rounded in wavy mode. (indicators/progress-styles.js:443)
🔍 General Feedback
- Extracting
button-styles.jsandbutton-variant-styles.jscleanly separates styling from component logic whilst preserving thebuttonStylesexport. - Resolving indicator and container colours via computed styles on
.loadingand#canvasinindicators/loading.jscleanly supports CSS custom properties and modern colour functions. - The new unit test suite in
tests/safari_animations_test.jsthoroughly covers the press-hold timing, button-group size inheritance, CSS transition properties, and WAAPI synchronisation.
📊 Token Usage & Cost Efficiency
| Metric | Value |
|---|---|
| Input Tokens (uncached) | 0 |
| Input Tokens (cached) | 628,008 (⚡ 99.4% cached) |
| PR Comments History Tokens | 5,145 |
| Thinking / Reasoning Tokens | 28,144 |
| Output Tokens | 1,954 |
| Total Session Tokens | 661,793 |
| Cost (uncached input) | $0.0077 |
| Cost (cached input) | $0.0471 |
| Cost (thinking / reasoning) | $0.2111 |
| Cost (response output) | $0.0147 |
| Estimated Total Cost | $0.2806 |
Gemini 4 Hydrogen: standard tier, global endpoint; regional endpoints are 10% higher.
Cache reads are priced here, but context-cache STORAGE, where the model charges for it separately per token-hour, is not included, so the figure can run slightly low.
There was a problem hiding this comment.
📋 Review Summary
This pull request resolves Safari 26 animation, clipping, and corner-radius transition issues across buttons, button groups, split buttons, FABs, elevation/ripple internals, menu items, and progress/loading indicators, backed by unit tests in tests/safari_animations_test.js. Buttons and icon buttons replace 9999px and cross-host border-radius inheritance with half-height --_full-shape clamping, attribute-backed size handling, and a 150ms minimum pointer press hold. Indicators remove content-visibility: auto and strict containment, switch linear indeterminate animations to direct left/right and GPU translate3d keyframes, and synchronise custom-sized circular track animations via WAAPI. All previously raised review comments have been addressed cleanly.
✅ Resolved Items from Prior Reviews
- Guarded #onPointerCancel in Button against clearing pressed while a release-hold timer is active, preserving the 150ms minimum press hold across touch pointerup to pointerleave sequences. (
buttons/button.js:272) - Added the same !this.pressed || this.#releaseTimer guard to #onPointerCancel in IconButton. (
buttons/icon-button.js:225) - Added direct m3-l1-tail-cqi and m3-l2-tail-cqi track-anchoring keyframes on .wavy.indeterminate.registered-props .bar-inner so Safari 26 animates wavy indeterminate bars without a trailing gap. (
indicators/progress-styles.js:413) - Excluded [pressed] from standalone square and selected shape selectors in button-styles.js so pressed corner morphing takes precedence. (
buttons/button-styles.js:374) - Excluded [pressed] from standalone square and selected shape selectors in icon-button-styles.js so pressed corner morphing takes precedence. (
buttons/icon-button-styles.js:815) - Aligned selected menu-item and select-option inner corner radii with --_shape-* custom properties instead of cross-host inherit. (
menu/menu-item.js:96) - Matched animationName === 'circular-indeterminate-active' before falling back to index 0 when synchronising custom circular track WAAPI startTime. (
indicators/progress.js:193) - Tracked group-propagated sizing via #groupSizedButtons WeakMap in ButtonGroup so dynamic size changes propagate whilst preserving explicit child size overrides. (
buttons/button-group.js:318) - Converted size on Button and IconButton to an attribute-backed accessor (noAccessor: true) so default 'small' no longer reflects onto the host or interferes with ButtonGroup sizing. (
buttons/button-group.js:332) - Wrapped indeterminate linear track segments in .indeterminate-tracks with pill border-radius clipping so -10% offsets remain rounded in wavy mode. (
indicators/progress-styles.js:443) - Moved cubic-bezier(0.4, 0, 0.2, 1) easing onto the first two WAAPI keyframes with linear overall timing to match CSS @Keyframes circular-indeterminate-active. (
indicators/progress.js:193) - Split --_round-outer-radius and --_square-outer-radius in ButtonGroup so square outer radii resolve correctly regardless of whether shape or size is set on the group or child. (
buttons/button-group.js:90)
🔍 General Feedback
- Good refactoring of Button and IconButton styles into dedicated style modules with consistent reduced-motion handling and explicit logical corner transitions.
- Solid unit test coverage in tests/safari_animations_test.js covering pointer press lifecycles, dynamic ButtonGroup sizing, CSS custom property clamping, and WAAPI startTime/easing synchronisation.
- Minor follow-up opportunity outside the diff: in indicators/progress.js (lines 452-458), the seven --_ind-track-* and --_ind-offset-* variables in renderCircularIndicator() are now unused by @Keyframes circular-indeterminate-track and can be removed in a future tidy-up.
- Minor consistency note: in buttons/split-button.js (lines 66-69), the @media (prefers-reduced-motion: reduce) block is nested inside .trailing-button md-icon, whereas the other updated stylesheets place it at top level.
📊 Token Usage & Cost Efficiency
| Metric | Value |
|---|---|
| Input Tokens (uncached) | 0 |
| Input Tokens (cached) | 629,840 (⚡ 99.4% cached) |
| PR Comments History Tokens | 6,386 |
| Thinking / Reasoning Tokens | 27,469 |
| Output Tokens | 1,064 |
| Total Session Tokens | 662,068 |
| Cost (uncached input) | $0.0096 |
| Cost (cached input) | $0.0472 |
| Cost (thinking / reasoning) | $0.2060 |
| Cost (response output) | $0.0080 |
| Estimated Total Cost | $0.2708 |
Gemini 4 Hydrogen: standard tier, global endpoint; regional endpoints are 10% higher.
Cache reads are priced here, but context-cache STORAGE, where the model charges for it separately per token-hour, is not included, so the figure can run slightly low.
There was a problem hiding this comment.
📋 Review Summary
This pull request resolves Safari 26 animation and shape-morphing issues across buttons, ripples, elevation, menu items, and progress/loading indicators while keeping all components aligned with the repository's co-located pure-ESM architecture. Key updates include replacing 9999px pill radii and cross-host border-radius inheritance with half-height clamping and explicit logical corner transitions, adding a 150ms pointer release hold, restoring connected button group shape morphing, switching linear indeterminate progress to direct left/right and cqi keyframes, and synchronising custom-sized circular track animations via WAAPI. All twelve previously raised review threads have been addressed, with only a stray comma in Button.styles and a minor custom-property edge case in Loading.render() remaining.
✅ Resolved Items from Prior Reviews
- Guarded #onPointerCancel with !this.pressed || this.#releaseTimer in buttons/button.js so a touch pointerleave fired immediately after pointerup no longer cancels the 150ms press hold. (
buttons/button.js:269) - Guarded #onPointerCancel with !this.pressed || this.#releaseTimer in buttons/icon-button.js to preserve the 150ms press hold across pointerup -> pointerleave. (
buttons/icon-button.js:1053) - Added direct m3-l1-tail-cqi / m3-l2-tail-cqi and margin-left animations on wavy indeterminate linear .bar-inner elements so track anchoring works without relying on descendant calc() invalidation in Safari 26. (
indicators/progress-styles.js:399) - Added :not([pressed]) to standalone square and selected shape selectors in Button styles so pressed corner morphing takes precedence. (
buttons/button-styles.js:373) - Added :not([pressed]) to standalone square and selected shape selectors in IconButton styles so pressed corner morphing takes precedence. (
buttons/icon-button-styles.js:814) - Aligned selected menu-item and select-option inner md-item, ripple, and focus-ring corner radii with --_shape-* tokens in menu/menu-item.js. (
menu/menu-item.js:96) - Matched animationName === 'circular-indeterminate-active' before falling back to activeAnims?.[0] when synchronising custom circular indeterminate track startTime. (
indicators/progress.js:193) - Tracked group-propagated sizing with #groupSizedButtons (WeakMap) in buttons/button-group.js so dynamic group size updates propagate while respecting explicit child sizes. (
buttons/button-group.js:318) - Converted size on Button and IconButton to an attribute-backed accessor (noAccessor: true) so default 'small' does not spuriously reflect size="small" or override dynamic group sizing. (
buttons/button-group.js:332) - Wrapped indeterminate linear track segments in .indeterminate-tracks with overflow: hidden and border-radius: var(--_track-shape) so off-screen -10% segments remain pill-rounded in wavy mode. (
indicators/progress-styles.js:430) - Moved easing: 'cubic-bezier(0.4, 0, 0.2, 1)' onto the first two WAAPI keyframes with easing: 'linear' in options to match @Keyframes circular-indeterminate-active. (
indicators/progress.js:1033) - Split --_round-outer-radius and --_square-outer-radius in ButtonGroup so square outer radii apply regardless of whether shape or size is set on the group or child buttons. (
buttons/button-group.js:90)
🔍 General Feedback
- Good alignment with AGENTS.md: styles remain co-located inside component modules rather than split into separate *-styles.js files, avoiding extra ESM HTTP waterfall requests.
- Combining IntersectionObserver with contentvisibilityautostatechange via separate _cvSkipped and _ioOffscreen flags in both md-loading and md-progress ensures off-screen rAF loops still pause reliably after removing content-visibility: auto from host styles.
- The new tests/safari_animations_test.js suite provides thorough regression coverage for the Safari 26 fixes, pointer press-hold edge cases, ButtonGroup size propagation, and WAAPI easing synchronisation.
📊 Token Usage & Cost Efficiency
| Metric | Value |
|---|---|
| Input Tokens (uncached) | 0 |
| Input Tokens (cached) | 606,898 (⚡ 99.4% cached) |
| PR Comments History Tokens | 6,680 |
| Thinking / Reasoning Tokens | 20,177 |
| Output Tokens | 1,649 |
| Total Session Tokens | 632,446 |
| Cost (uncached input) | $0.0100 |
| Cost (cached input) | $0.0455 |
| Cost (thinking / reasoning) | $0.1513 |
| Cost (response output) | $0.0124 |
| Estimated Total Cost | $0.2192 |
Gemini 4 Hydrogen: standard tier, global endpoint; regional endpoints are 10% higher.
Cache reads are priced here, but context-cache STORAGE, where the model charges for it separately per token-hour, is not included, so the figure can run slightly low.
There was a problem hiding this comment.
📋 Review Summary
This pull request resolves Safari 26 animation and rendering regressions across button components, ripple/elevation helpers, menu items, and progress/loading indicators. Key fixes include replacing 9999px pill radii with half-height calc() expressions, transitioning explicit logical border-radius properties without cross-shadow-DOM inherit, protecting the 150ms press-hold timer against immediate pointerleave after pointerup, using 0px units in split buttons, and removing content-visibility: auto and contain: strict from md-loading and md-progress while keeping IntersectionObserver and contentvisibilityautostatechange off-screen pausing. Indeterminate linear progress and custom-sized circular tracks also avoid CSS custom-property keyframe limitations via direct keyframes, GPU-composited wavy translations, and per-segment WAAPI easing. All 14 prior review threads have been addressed and are backed by unit tests in tests/safari_animations_test.js.
✅ Resolved Items from Prior Reviews
- Guarded #onPointerCancel in Button with if (!this.pressed || this.#releaseTimer) return so pointerleave following pointerup preserves the 150ms press hold. (
buttons/button.js:269) - Guarded #onPointerCancel in IconButton with if (!this.pressed || this.#releaseTimer) return so pointerleave following pointerup preserves the 150ms press hold. (
buttons/icon-button.js:1053) - Added direct cqi track-anchoring keyframes (m3-l1-tail-cqi / m3-l2-tail-cqi) and margin-left offset on wavy indeterminate linear bars in indicators/progress.js. (
indicators/progress-styles.js:399) - Added :not([pressed]) to standalone square and selected shape selectors in buttons/button.js so pressed corner morphing takes precedence. (
buttons/button-styles.js:373) - Added :not([pressed]) to standalone square and selected shape selectors in buttons/icon-button.js so pressed corner morphing takes precedence. (
buttons/icon-button-styles.js:814) - Aligned selected menu-item and select-option inner corner radii via --_shape-* without cross-host inherit. (
menu/menu-item.js:96) - Matched animationName === 'circular-indeterminate-active' before falling back to [0] when synchronising custom circular indeterminate track startTime. (
indicators/progress.js:193) - Tracked group-propagated sizing via #groupSizedButtons WeakMap so dynamic size updates on md-button-group propagate to group-sized children while preserving explicit child overrides. (
buttons/button-group.js:318) - Replaced reflected size property with an attribute-backed accessor (noAccessor: true) on Button and IconButton so default 'small' does not spuriously reflect onto the host. (
buttons/button-group.js:332) - Wrapped indeterminate linear track segments in .indeterminate-tracks with pill border-radius and overflow: hidden so -10% endpoints remain rounded in wavy mode. (
indicators/progress-styles.js:430) - Moved cubic-bezier(0.4, 0, 0.2, 1) easing onto individual WAAPI keyframes with linear overall options easing to keep custom-sized circular tracks in phase. (
indicators/progress.js:1033) - Split --_round-outer-radius and --_square-outer-radius in ButtonGroup so square outer radii apply regardless of which element carries shape or size. (
buttons/button-group.js:90) - Removed the stray comma in Button.styles that created a sparse array slot. (
buttons/button.js:1059) - Wrapped bare --* custom property names in var(...) in Loading.render() so getComputedStyle() and _resolveColor() resolve colours consistently. (
indicators/loading.js:397)
🔍 General Feedback
- Co-locating styles directly in button.js, icon-button.js, loading.js, and progress.js keeps the unbundled ESM module graph lean and adheres to AGENTS.md.
- Replacing 9999px radii with calc(height / 2) and explicit logical corner transitions cleanly addresses WebKit transition stalls whilst respecting prefers-reduced-motion.
- The new tests/safari_animations_test.js suite provides thorough regression coverage across button press-hold states, ButtonGroup size propagation, SplitButton 0px tokens, MenuItem corner alignment, and indicator keyframes/WAAPI synchronisation.
📊 Token Usage & Cost Efficiency
| Metric | Value |
|---|---|
| Input Tokens (uncached) | 0 |
| Input Tokens (cached) | 607,926 (⚡ 99.4% cached) |
| PR Comments History Tokens | 7,410 |
| Thinking / Reasoning Tokens | 25,047 |
| Output Tokens | 1,305 |
| Total Session Tokens | 637,986 |
| Cost (uncached input) | $0.0111 |
| Cost (cached input) | $0.0456 |
| Cost (thinking / reasoning) | $0.1879 |
| Cost (response output) | $0.0098 |
| Estimated Total Cost | $0.2543 |
Gemini 4 Hydrogen: standard tier, global endpoint; regional endpoints are 10% higher.
Cache reads are priced here, but context-cache STORAGE, where the model charges for it separately per token-hour, is not included, so the figure can run slightly low.
Summary
Restores smooth Material 3 Expressive button shape morphing and progress/loading indicator animations across browsers with full compatibility for Safari 26 / WebKit.
Key Changes
md-button,md-icon-button):buttons/button.jsinto modularbuttons/button-styles.jsandbuttons/button-variant-styles.js(re-exportingbuttonStyles).border-radius: inheritacross Shadow DOM:hostboundaries with resolved--_resolved-shape-*custom properties and explicit transitions on bothborder-radiusand all four logicalborder-*-*-radiuslonghands (includingmd-focus-ring,md-ripple,md-elevation,md-fab, andmd-menu-item).9999pxpill defaults withmin(var(--_container-shape-*), calc(var(--_container-height) / 2))so corner interpolation is immediately visible instead of spending ~99% of the curve clamped above half-height.pointerdown,pointerup,pointercancel,pointerleave) with a150msminimum press window so fast macOS trackpad and iOS touch taps visibly paint the tactile corner morph.@media (prefers-reduced-motion: reduce)to zero out shape morph duration while preserving150mscolor/opacity fades.md-button-group,md-split-button):--_outer-radiuson all 4 corners) for[selected]items and inner-corner sharpening on[pressed]items in connected button groups; omittedgroup-positionon non-connected groups.md-split-buttonto use explicit0px<length>tokens (valid inside CSSmin()/calc()) and wired--md-icon-button-container-shape-*on.trailing-button.md-progress,md-loading):content-visibility: autoandcontain: strictfrom:hostinmd-loadingandmd-progress(replacing withcontain: layout style/contain: layout style paint), preventing WebKit from skipping shadow-tree paint and animation initialization.CSS.registerPropertycustom-property@keyframeson indeterminate linear progress with direct standardleft/rightkeyframes (-12%<->112%) andmargintrack gaps.mask-position: var(--_wavelength)keyframes on wavy linear progress with GPU-compositedtransform: translate3d(0, 0, 0)->translate3d(100%, 0, 0)over acqi-sized masked pseudo-element, and used literal numbers (plus phase-locked WAAPI sync for custom sizes) on circular indeterminate tracks.Verification
tests/safari_animations_test.jscovering shape clamping, WebKit logical corner transitions, fast-tap press hold/cancel behavior, connected button group morphing, split-button0pxtokens, and indicator keyframes/containment.npm test(14/14 passing).