Skip to content

fix: restore button shape transitions and indicator animations in Safari 26 - #168

Merged
treeder merged 11 commits into
mainfrom
safari_animation_button_transitions
Nov 22, 2026
Merged

treeder merged 11 commits into
mainfrom
safari_animation_button_transitions

Conversation

@treeder

@treeder treeder commented Nov 22, 2026

Copy link
Copy Markdown
Member

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

  • Button & Icon Button Shape Transitions (md-button, md-icon-button):
    • Split buttons/button.js into modular buttons/button-styles.js and buttons/button-variant-styles.js (re-exporting buttonStyles).
    • Replaced border-radius: inherit across Shadow DOM :host boundaries with resolved --_resolved-shape-* custom properties and explicit transitions on both border-radius and all four logical border-*-*-radius longhands (including md-focus-ring, md-ripple, md-elevation, md-fab, and md-menu-item).
    • Replaced 9999px pill defaults with min(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.
    • Upgraded press tracking to Pointer Events (pointerdown, pointerup, pointercancel, pointerleave) with a 150ms minimum press window so fast macOS trackpad and iOS touch taps visibly paint the tactile corner morph.
    • Scoped @media (prefers-reduced-motion: reduce) to zero out shape morph duration while preserving 150ms color/opacity fades.
  • Connected Button Groups & Split Buttons (md-button-group, md-split-button):
    • Added M3 Expressive pill morphing (--_outer-radius on all 4 corners) for [selected] items and inner-corner sharpening on [pressed] items in connected button groups; omitted group-position on non-connected groups.
    • Updated md-split-button to use explicit 0px <length> tokens (valid inside CSS min()/calc()) and wired --md-icon-button-container-shape-* on .trailing-button.
  • Safari 26 Indicator Animations (md-progress, md-loading):
    • Removed content-visibility: auto and contain: strict from :host in md-loading and md-progress (replacing with contain: layout style / contain: layout style paint), preventing WebKit from skipping shadow-tree paint and animation initialization.
    • Replaced CSS.registerProperty custom-property @keyframes on indeterminate linear progress with direct standard left/right keyframes (-12% <-> 112%) and margin track gaps.
    • Replaced mask-position: var(--_wavelength) keyframes on wavy linear progress with GPU-composited transform: translate3d(0, 0, 0) -> translate3d(100%, 0, 0) over a cqi-sized masked pseudo-element, and used literal numbers (plus phase-locked WAAPI sync for custom sizes) on circular indeterminate tracks.

Verification

  • Added unit test suite in tests/safari_animations_test.js covering shape clamping, WebKit logical corner transitions, fast-tap press hold/cancel behavior, connected button group morphing, split-button 0px tokens, and indicator keyframes/containment.
  • Ran npm test (14/14 passing).

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://safari-animation-button-transitions-material.treeder.workers.dev (commit e1edf06)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://c857330f-material.treeder.workers.dev e1edf06 2026-11-22T19:13:25.298Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://df7362ce-material.treeder.workers.dev 3178bef 2026-11-22T19:09:58.997Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://6f116d6e-material.treeder.workers.dev 603af9d 2026-11-22T18:50:14.193Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://101f1b45-material.treeder.workers.dev d8e3d0f 2026-11-22T18:45:20.666Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://8dd942a6-material.treeder.workers.dev 60638fa 2026-11-22T18:17:58.983Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://662a34d9-material.treeder.workers.dev 7b75791 2026-11-22T18:11:47.943Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://fdfa1ba1-material.treeder.workers.dev 64083ff 2026-11-22T17:29:59.188Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://b0a29144-material.treeder.workers.dev c6dd036 2026-11-22T17:25:29.302Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://baf23275-material.treeder.workers.dev 8572e78 2026-11-22T17:13:58.752Z Visit the dashboard ↗

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📋 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 fixing size propagation (!button.hasAttribute('size')) and group-position removal when connected is false makes the component much cleaner.
  • Resolving indicator and container colours natively via getComputedStyle on .loading and #canvas in indicators/loading.js is a solid improvement over manual var() string parsing alone.
  • In tests/safari_animations_test.js, consider adding a test case that simulates pointerleave immediately following pointerup on 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.

Comment thread buttons/button.js Resolved
Comment thread buttons/icon-button.js Resolved
Comment thread indicators/progress-styles.js Resolved

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📋 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 #onPointerCancel in Button so a pointerleave event immediately following pointerup on touch taps no longer cancels the 150ms #releaseTimer hold. (buttons/button.js:251)
  • Guarded #onPointerCancel in IconButton with !this.pressed || this.#releaseTimer to preserve the 150ms press hold across touch pointerup -> pointerleave sequences. (buttons/icon-button.js:204)
  • Added direct m3-l1-tail-cqi and m3-l2-tail-cqi animations with margin-left: calc(-1 * var(--_wavelength)) on wavy indeterminate .bar-inner elements 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.js and buttons/button-variant-styles.js and centralising connected group corner mapping in buttons/button-group.js significantly improves maintainability.
  • Replacing mask-position keyframes with GPU-composited translate3d() for wavy linear progress and using getComputedStyle() colour resolution in md-loading are solid, standards-compliant improvements.
  • The new tests/safari_animations_test.js suite 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.

Comment thread buttons/button-styles.js Resolved
Comment thread buttons/icon-button-styles.js Resolved

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📋 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.#onPointerCancel with !this.pressed || this.#releaseTimer so pointerleave immediately following pointerup does not cancel the 150ms minimum press hold timer. (buttons/button.js:251)
  • Guarded IconButton.#onPointerCancel with !this.pressed || this.#releaseTimer so pointerleave immediately following pointerup preserves the 150ms minimum press hold timer. (buttons/icon-button.js:204)
  • Added direct m3-l1-tail-cqi and m3-l2-tail-cqi keyframes paired with margin-left: calc(-1 * var(--_wavelength)) on .wavy.indeterminate.registered-props .bar-inner so track-anchoring animates in Safari 26 without relying on custom-property calc() invalidation. (indicators/progress-styles.js:400)
  • Added :not([pressed]) to standalone shape='square' and selected shape rules in buttons/button-styles.js so pressed corner morphing takes precedence. (buttons/button-styles.js:373)
  • Added :not([pressed]) to standalone shape='square' and selected shape rules in buttons/icon-button-styles.js so pressed corner morphing takes precedence. (buttons/icon-button-styles.js:814)

🔍 General Feedback

  • Extracting button styles into buttons/button-styles.js and buttons/button-variant-styles.js while re-exporting buttonStyles from buttons/button.js keeps the component logic concise and preserves backwards compatibility.
  • Fixing ButtonGroup.updateConnectedPositions() to check !button.hasAttribute('size') instead of !button.size resolves a bug where size on <md-button-group> was ignored because Button initialises this.size = 'small'.
  • Resolving indicator and container colours via getComputedStyle on rendered elements in Loading.updateResolvedColors() avoids brittle manual var() parsing for modern CSS colour functions and theme tokens.
  • Replacing 9999px pill tokens with min(..., calc(var(--_container-height) / 2)) and using 0px units in SplitButton ensures 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.

Comment thread menu/menu-item.js Resolved

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📋 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 #onPointerCancel in Button with if (!this.pressed || this.#releaseTimer) return so pointerleave fired immediately after pointerup on touch taps preserves the 150ms press hold. (buttons/button.js:251)
  • Guarded #onPointerCancel in IconButton with if (!this.pressed || this.#releaseTimer) return so pointerleave fired immediately after pointerup on touch taps preserves the 150ms press hold. (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 .linear.progress.wavy.indeterminate.registered-props .bar-inner so 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 in buttons/button-styles.js so pressed corner morphing takes precedence. (buttons/button-styles.js:373)
  • Excluded [pressed] from standalone square and selected shape selectors in buttons/icon-button-styles.js so pressed corner morphing takes precedence. (buttons/icon-button-styles.js:814)
  • Aligned selected md-menu-item and md-select-option inner shape tokens (md-item, md-ripple, md-focus-ring, and .list-item) via --_shape-* without relying on cross-host inherit. (menu/menu-item.js:96)

🔍 General Feedback

  • Extracting button styles into buttons/button-styles.js and buttons/button-variant-styles.js and collapsing the duplicated corner variable mappings in buttons/button-group.js significantly improves readability and maintainability.
  • Fixing Button.handleSlotChange() to populate hasIcon and updating ButtonGroup.updateConnectedPositions() to check !button.hasAttribute('size') and remove group-position when not connected resolve real layout and token-propagation bugs.
  • Resolving indicator and container colours in md-loading via getComputedStyle on .loading and #canvas cleanly handles CSS functions such as light-dark() and color-mix() that 2D canvas cannot parse directly.
  • Unit tests in tests/safari_animations_test.js thoroughly 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.

Comment thread indicators/progress.js Resolved

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📋 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.

Comment thread buttons/button-group.js Resolved

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📋 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) return so a touch pointerleave fired immediately after pointerup preserves the 150ms minimum press hold. (buttons/button.js:251)
  • Guarded IconButton.#onPointerCancel with if (!this.pressed || this.#releaseTimer) return to preserve the 150ms minimum 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.registered-props .bar-inner so 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 in buttons/button-styles.js so pressed corner morphing takes precedence. (buttons/button-styles.js:373)
  • Excluded [pressed] from standalone square and selected shape selectors in buttons/icon-button-styles.js so pressed corner morphing takes precedence. (buttons/icon-button-styles.js:814)
  • Updated menu/menu-item.js so selected items drive --_shape-* on :host, .list-item, md-ripple, md-item, and md-focus-ring consistently without relying on 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 in indicators/progress.js. (indicators/progress.js:193)
  • Tracked group-managed child button sizing with #groupSizedButtons (WeakMap) in buttons/button-group.js so dynamic size changes on <md-button-group> propagate while preserving explicit child size attributes. (buttons/button-group.js:318)

🔍 General Feedback

  • Extracting button styles into buttons/button-styles.js and buttons/button-variant-styles.js cleanly separates shared shape/size logic from colour variant tokens and removes duplicate md-elevation and [selected] CSS blocks.
  • The half-height --_full-shape clamping paired with 0px tokens in buttons/split-button.js and layer-promoted md-ripple / md-elevation corner transitions provides a solid cross-browser foundation for M3 Expressive shape morphing.
  • Using tests/safari_animations_test.js to verify pointer press-hold sequencing, WAAPI startTime synchronisation under four-color, and selector invariants is a strong addition alongside tests/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.

Comment thread buttons/button-group.js Resolved
Comment thread indicators/progress-styles.js Resolved

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📋 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 #onPointerCancel in Button so pointerleave immediately following pointerup does not cancel #releaseTimer during the 150ms minimum press hold. (buttons/button.js:272)
  • Guarded #onPointerCancel in IconButton so pointerleave immediately following pointerup preserves the 150ms minimum press hold. (buttons/icon-button.js:225)
  • Added direct m3-l1-tail-cqi / m3-l2-tail-cqi keyframes and margin-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 in buttons/button-styles.js so pressed corner morphing takes precedence. (buttons/button-styles.js:374)
  • Added :not([pressed]) to standalone square and selected shape selectors in buttons/icon-button-styles.js so pressed corner morphing takes precedence. (buttons/icon-button-styles.js:815)
  • Unified corner radius tokens via --_shape-* on md-menu-item and md-select-option so selected and positional items keep consistent radii across .list-item, md-item, md-ripple, and md-focus-ring. (menu/menu-item.js:96)
  • Matched animationName === 'circular-indeterminate-active' before falling back to activeAnims?.[0] when synchronising custom-sized circular indeterminate track startTime. (indicators/progress.js:193)
  • Tracked group-propagated child sizing in #groupSizedButtons (WeakMap) so dynamic size updates on <md-button-group> propagate to inherited children whilst preserving 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 onto :host. (buttons/button-group.js:337)
  • Wrapped indeterminate linear track segments in .indeterminate-tracks with border-radius: var(--_track-shape) and overflow: hidden so outer track ends remain pill-rounded in wavy mode. (indicators/progress-styles.js:443)

🔍 General Feedback

  • Extracting button-styles.js and button-variant-styles.js cleanly separates styling from component logic whilst preserving the buttonStyles export.
  • Resolving indicator and container colours via computed styles on .loading and #canvas in indicators/loading.js cleanly supports CSS custom properties and modern colour functions.
  • The new unit test suite in tests/safari_animations_test.js thoroughly 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.

Comment thread indicators/progress.js Resolved
Comment thread buttons/button-group.js Resolved

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📋 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.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📋 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.

Comment thread buttons/button.js Resolved
Comment thread indicators/loading.js Resolved

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📋 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.

@treeder
treeder merged commit 1e58619 into main Nov 22, 2026
2 checks passed
@treeder
treeder deleted the safari_animation_button_transitions branch November 22, 2026 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant