Skip to content

enhance(frontend): 複雑なCSSアニメーションをWeb Animations APIに置き換え - #18152

Draft
kakkokari-gtyih wants to merge 1 commit into
misskey-dev:developfrom
kakkokari-gtyih:enh-use-web-animations-api
Draft

kakkokari-gtyih wants to merge 1 commit into
misskey-dev:developfrom
kakkokari-gtyih:enh-use-web-animations-api

Conversation

@kakkokari-gtyih

Copy link
Copy Markdown
Member

What

CSSアニメーションを何とかして使っているような部分を、Web Animations APIに変更してプログラマブルにアニメーションできるように

  • MkAnalogClock: 秒針の59秒→0秒の処理(transitionend待ち、requestAnimationFrame、transitionの一時無効化)をやめ、前の角度から時計回りに進める animate() に置き換え
  • MkDigitalClock: コロンの点滅を transition: 0s のクラス切り替えと setTimeout(30ms) から、秒が変わるたびの animate() 再生に置き換え
  • MkButton: リップルの setTimeout(1ms後に開始、1000ms後に透明化、2000ms後に削除)を animate() にまとめ、finished でDOMから削除するように変更
  • MkPlusOneEffect: setTimeout(10ms) による開始と setTimeout(1100ms) による終了を廃止し、ランダム角度を v-bind() ではなくキーフレームへ直接渡して、finished で end を発火するように
  • MkReactionEffect.vue: MkPlusOneEffect と同様に、setTimeout による開始・終了と v-bind() の角度を animate() と finished に置き換え
  • MkSparkle.vue: CSS変数経由の値渡しと infinite なアニメーションを dur - 100ms で削除する処理を廃止し、粒子ごとに1回だけ再生して finished で削除
  • directives/anim.ts: setTimeout(1ms) でtransitionを起こしてインラインstyleを残す方式から、要素本来のスタイルへ戻る animate() に変更
  • directives/click-anime.ts: バウンスをクラス付け外しと animationend から click 時の animate() に変更
    (子要素からバブリングしてきた animationend でバウンスが途中で止まる不具合も解消)

Why

  • setTimeout によるアニメーション制御を解消するため(パフォーマンス向上)
  • CSS変数経由で値を渡す形でのアニメーション制御を解消するため
  • アニメーションを本来表現したい形により忠実にするため

Additional info (optional)

Checklist

  • Read the contribution guide
  • Test working in a local environment
  • (If needed) Add story of storybook
  • (If needed) Update CHANGELOG.md
  • (If possible) Add tests

@coderabbitai

coderabbitai Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions github-actions Bot added the packages/frontend Client side specific issue/PR label Nov 16, 2026
@codecov

codecov Bot commented Nov 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 3.84615% with 25 lines in your changes missing coverage. Please review.
✅ Project coverage is 12.82%. Comparing base (c696bf0) to head (fa3dc19).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
packages/frontend/src/components/MkSparkle.vue 0.00% 9 Missing and 2 partials ⚠️
...kages/frontend/src/components/MkReactionEffect.vue 0.00% 4 Missing and 1 partial ⚠️
packages/frontend/src/directives/click-anime.ts 16.66% 5 Missing ⚠️
packages/frontend/src/components/MkButton.vue 0.00% 3 Missing ⚠️
packages/frontend/src/directives/anim.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #18152      +/-   ##
===========================================
+ Coverage    12.81%   12.82%   +0.01%     
===========================================
  Files          228      228              
  Lines        11181    11179       -2     
  Branches      3699     3701       +2     
===========================================
+ Hits          1433     1434       +1     
+ Misses        7661     7656       -5     
- Partials      2087     2089       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown
Contributor

🖥 Frontend Diagnostics Report

(No significant changes)

View details

Requests by resource type
Type Requests Encoded bytes
Base Head Δ Base Head Δ
Document 2 2 0 33 KB 33 KB 0 B
Script 146 146 0 2 MB 2 MB $\color{orange}{\text{+814 B}}$
Stylesheet 57 57 0 280 KB 279 KB $\color{green}{\text{-1.6 KB}}$
Fetch 20 20 0 46 KB 46 KB 0 B
Image 10 10 0 254 KB 254 KB 0 B
Font 2 2 0 118 KB 118 KB 0 B
Other 9 9 0 421 KB 421 KB $\color{green}{\text{-1 B}}$
V8 heap snapshot statistics
Metric @ Base @ Head Δ MAD
$\color{gray}{\rule{8pt}{8pt}}$ Total 11 MB
± 21 KB
11 MB
± 2.4 KB
$\text{-9.4 KB}$
$\text{-0.1\%}$
21 KB
$\color{orange}{\rule{8pt}{8pt}}$ Code 2.8 MB 2.8 MB $\text{-11 KB}$ 3.1 KB
$\color{red}{\rule{8pt}{8pt}}$ Strings 1.3 MB 1.3 MB $\text{+660 B}$ 68 B
$\color{cyan}{\rule{8pt}{8pt}}$ JS arrays 112 KB 112 KB $\text{+132 B}$ 92 B
$\color{green}{\rule{8pt}{8pt}}$ Typed arrays 0 B 0 B 0 B 0 B
$\color{yellow}{\rule{8pt}{8pt}}$ System objects 0 B 0 B 0 B 0 B
$\color{violet}{\rule{8pt}{8pt}}$ Other JS objs 2 MB 2 MB $\text{+364 B}$ 1.3 KB
$\color{pink}{\rule{8pt}{8pt}}$ Other non-JS objs 4.9 MB 4.9 MB $\text{+2.4 KB}$ 3 KB

Download representative heap snapshot: base / head

📦 Bundle Stats

Chunk size diff (2 updated, 0 added, 0 removed)
Chunk Base Head Δ Δ (%)
(total) 6 MB 6 MB $\text{+766 B}$ $\text{+0\%}$
src/widgets/WidgetClock.vue ja-JP/gmWUURLNV-DT8cG3Eo.js → ja-JP/gmWUURLNV-N7MxHegz.js
6.9 KB 6.9 KB $\text{+47 B}$ $\color{orange}{\text{+0.7\%}}$
src/_boot_.ts ja-JP/gmWUURLNV-D4NRfFgU.js → ja-JP/gmWUURLNV-CrCi5hac.js
65 KB 65 KB $\text{-46 B}$ $\text{-0.1\%}$
(other generated chunks) 2.1 MB 2.1 MB $\text{+765 B}$ $\text{+0\%}$
Startup chunk size (1 updated, 0 added, 0 removed)
Chunk Base Head Δ Δ (%)
(total) 1 MB 1 MB $\text{+407 B}$ $\text{+0\%}$
src/_boot_.ts ja-JP/gmWUURLNV-D4NRfFgU.js → ja-JP/gmWUURLNV-CrCi5hac.js
65 KB 65 KB $\text{-46 B}$ $\text{-0.1\%}$
(other generated chunks) 718 KB 719 KB $\text{+453 B}$ $\text{+0.1\%}$
(other) 219 KB 219 KB 0 B 0%

Startup chunks are the Vite entry for src/_boot_.ts and its static imports.

Bundles Modules Entries Imports Size
Static Dynamic Rendered Gzip Brotli
Base 474 2,881 22 10,565 339 10 MB 2.8 MB 2.4 MB
Head 474 2,881 22 10,565 339 10 MB 2.8 MB 2.4 MB
Δ 0 0 0 0 0 $\color{orange}{\text{+1.1 KB}}$ $\text{+611 B}$ $\text{+587 B}$
Δ (%) 0% 0% 0% 0% 0% $\text{+0\%}$ $\text{+0\%}$ $\text{+0\%}$

Open treemap HTML

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

packages/frontend Client side specific issue/PR

Projects

Development

Successfully merging this pull request may close these issues.

1 participant