Skip to content

refactor: [1176] 矢印・フリーズアロー生成/移動部分のコード整理、g_transformsの組み立て処理見直し - #2252

Merged
cwtickle merged 1 commit into
developfrom
feature/1176-cr-flow-notes
Oct 3, 2026
Merged

cwtickle merged 1 commit into
developfrom
feature/1176-cr-flow-notes

Conversation

@cwtickle

@cwtickle cwtickle commented Oct 3, 2026

Copy link
Copy Markdown
Owner

🔨 変更内容 / Details of Changes

1. refactor: 矢印・フリーズアロー生成/移動部分のコード整理

  • 矢印・フリーズアローの生成/移動部分のコードを部分統合し、文字列組み立てしている箇所を減らしました。
  • 関数分岐部分について、プレイ開始後に確定するため毎回組み立てる処理を無くしています。

2. refactor: g_transformsの組み立て処理の見直し

  • joinTransforms関数を追加し、組み立て処理を見直しました。処理内容は変わりません。

🔖 関連Issue, 変更理由 / Related Issues, Reason for Changes

  1. 毎回組み立てる処理を減らすことで速度遅延のリスクを下げるため。
  2. 1.と同じです。

📷 スクリーンショット / Screenshot

📝 その他コメント / Other Comments

@cwtickle cwtickle added func20:Main プレイ画面全般 code-refactoring labels Oct 3, 2026
@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 655d6edf-2bda-4985-b80c-ccef588e0cd8
📥 Commits

Reviewing files that changed from the base of the PR and between f6c36ed and af9cebf.

📒 Files selected for processing (2)
  • js/lib/danoni_constants.js
  • js/lib/mainWindow.js

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Summary

Summary by CodeRabbit

  • Visual Updates
    • When multiple motion effects are active, they are applied in priority order. Effects with the same priority retain their registration order.
  • Gameplay
    • Arrow and freeze-arrow movement, animation, judgment, and hold behavior continue to work as before.

Walkthrough

Transform composition now uses shared priority-ordering logic. Arrow and freeze-arrow setup and per-frame processing now use extracted helpers and cached handlers.

Changes

Runtime transform and arrow processing

Layer / File(s) Summary
Transform composition and cleanup
js/lib/danoni_constants.js, js/lib/mainWindow.js
Transform addition and deletion use shared formatting logic. Judged-object deletion removes its root transform entry directly from the map. motionAlphaToggle caches the target style object.
Shared arrow construction
js/lib/mainWindow.js
Arrow and freeze-arrow constructors use shared helpers for attributes, CSS motion, initial positioning, and sprites. The constructors retain their custom-hook calls.
Per-frame movement and state handling
js/lib/mainWindow.js
Arrow and freeze-arrow movement uses extracted update functions and cached AutoPlay-specific handlers. Freeze-arrow processing delegates moving, holding, and ended states to separate functions.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Refactor

Merge Risk: ⚪ Minimal · up to af9ce

No actionable issue is established from the available evidence. The refactor is mergeable after normal gameplay checks.

Architecture Summary

Architecture risk: 🟠 High · up to af9ce

The change affects 1 system.

Changed systems: js

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — js (service) was modified; 2 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in js/lib/danoni_constants.js: Added joinTransforms to format map entries: it returns the sole transform directly, orders two entries by descending priority while preserving their map order on ties, and sorts larger sets by descending priority before joining with spaces.
  • observed — Modified behavior in js/lib/danoni_constants.js: addTransform now stores the per-element map in a local variable and updates an existing entry’s transform in place when its priority is unchanged, preserving its registration order. New entries or entries with a changed priority are set in the map; the resulting DOM transform is generated through joinTransforms instead of sorting and joining inline.
  • observed — Modified behavior in js/lib/danoni_constants.js: delTransform now uses a local map reference and joinTransforms for the remaining entries. Deleting the last entry still removes the element’s map, clears its DOM transform, and returns.
  • observed — Modified behavior in js/lib/danoni_constants.js: motionAlphaToggle caches $id(_obj) in style and uses that reference for opacity checks and assignments; the direction and opacity conditions and their effects are unchanged.

Reliability and maintainability

  • inferred — Risk-relevant change factors for js: blast_radius_1; blast_radius_2; blast_radius_3; blast_radius_4; direct_dependents_1; direct_dependents_2; direct_dependents_3
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the arrow and freeze-arrow refactor and the review of g_transforms assembly.
Description check ✅ Passed The description explains both refactoring areas and states the performance motivation, which matches the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

🔧 ast-grep (0.45.3)
js/lib/danoni_constants.js

ast-grep timed out on this file


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

Comment @coderabbitai help to get the list of available commands.

@cwtickle
cwtickle merged commit 95960f9 into develop Oct 3, 2026
4 checks passed
@cwtickle
cwtickle deleted the feature/1176-cr-flow-notes branch October 3, 2026 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-refactoring func20:Main プレイ画面全般

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant