Skip to content

feat: [1013] FrzReturnの拡張設定のコード整理、設定拡張#1998

Merged
cwtickle merged 6 commits intodevelopfrom
feature/1013-frzReturn-variable
Mar 4, 2026
Merged

feat: [1013] FrzReturnの拡張設定のコード整理、設定拡張#1998
cwtickle merged 6 commits intodevelopfrom
feature/1013-frzReturn-variable

Conversation

@cwtickle
Copy link
Owner

@cwtickle cwtickle commented Mar 4, 2026

🔨 変更内容 / Details of Changes

1. FrzReturnの拡張設定のコード整理、設定拡張

  • FrzReturnの移動配列作成関数をMapオブジェクトに変更し、設定を全体的に見直しました。
拡張設定 内容
+60deg 0 ⇒ 60 ⇒ 0 の軌道で回転(イージングあり、約50frame)
+120deg 0 ⇒ 120 ⇒ 0 の軌道で回転(イージングあり、約80frame)
+360deg 0 ⇒ 360 の軌道で回転(イージングなし、90frame)
Pendulum 0 ⇒ -60 ⇒ 60 ⇒ 0
または 0 ⇒ -70 ⇒ 70 ⇒ 0
または 0 ⇒ -80 ⇒ 80 ⇒ 0の軌道で回転
(イージングあり、約100frame)
±120deg 0 ⇒ 120 ⇒ 0 または 0 ⇒ -120 ⇒ 0 の軌道で回転
(イージングあり、約80frame)
±360deg 0 ⇒ 360 または 0 ⇒ -360の軌道で回転(イージングなし、90frame)

2. 機能別の制御関数について、定義が必要なキー名の補足コメントを追記

  • 今回の g_frzReturnSeqFunc のように、対応するキー名がわかるように補足コメントを入れました。

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

  1. 今後の設定の拡張につながるため。
  2. 今後、類似の拡張を行う場合の参考になるため。

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

image

📝 その他コメント / Other Comments

@cwtickle cwtickle added the func10:Settings 設定画面全般 label Mar 4, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 4, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 7ae783ec-6007-4b60-9e02-87a54201e24e

📥 Commits

Reviewing files that changed from the base of the PR and between 2f18261 and 842412b.

📒 Files selected for processing (2)
  • js/danoni_main.js
  • js/lib/danoni_constants.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • js/danoni_main.js

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added new freeze-return movement types: Pendulum, ±120deg, and ±360deg variants.
    • Freeze-return sequences now randomly select from available movement options when multiple exist.
  • Refactor

    • Restructured freeze-return type handling for improved modularity and extensibility.

Walkthrough

Replaces direct getReturnSequence usage with a Map-based provider g_frzReturnSeqFunc; expands frzReturn types to include +60deg, +120deg, +360deg, Pendulum, ±120deg, ±360deg; adds g_effectFunc; updates startFrzReturn to fetch sequences from the Map and randomly pick an entry when multiple sequences exist.

Changes

Cohort / File(s) Summary
FrzReturn Sequence Provider
js/lib/danoni_constants.js
Removed getReturnSequence; added g_frzReturnSeqFunc (Map) returning sequence-generator functions for +60deg, +120deg, +360deg, Pendulum, ±120deg, ±360deg. Updated g_settings.frzReturnTypes. Added g_effectFunc mapping and adjusted comments/docs.
Runtime Selection / Caller
js/danoni_main.js
Replaced direct sequence retrieval with g_frzReturnSeqFunc.get(type)(...). In startFrzReturn, compute seqLen and choose a random index when seqLen > 1, else use index 0, then use the selected sequence for the freeze-return behavior.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

code-refactoring

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title directly describes the main changes: code organization and settings extension for FrzReturn feature, which matches the changeset's focus on refactoring freeze-return sequences into a map-based provider.
Description check ✅ Passed The description is comprehensive and directly related to the changeset, detailing the FrzReturn extension configuration, new settings types, implementation approach, and rationale.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/1013-frzReturn-variable

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ast-grep (0.41.0)
js/danoni_main.js
js/lib/danoni_constants.js

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 and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
js/lib/danoni_constants.js (1)

1913-1945: JSDoc comment describes old function signature, not the Map constant.

The JSDoc block references @param {string} _type which appears to be leftover from the previous function-based getReturnSequence implementation. This parameter doesn't apply to a Map constant. Consider updating the documentation to reflect the new structure.

📝 Suggested JSDoc update
 /**
- * FrzReturnの種別ごとの移動配列を作成
- * `@param` {string} _type 
- * `@returns` {number[][]}
+ * FrzReturnの種別ごとの移動配列を作成するMap
+ * - キー: FrzReturn種別 (例: "60deg", "120deg+")
+ * - 値: 移動配列を返す関数 (オプション引数 _dir で方向指定、デフォルト 1)
+ * `@type` {Map<string, (dir?: number) => number[][]>}
  */
 const g_frzReturnSeqFunc = new Map([
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@js/lib/danoni_constants.js` around lines 1913 - 1945, The JSDoc above
g_frzReturnSeqFunc is stale (mentions a `@param` {_type} for an old function);
remove the param and replace the comment to document the Map constant itself
(g_frzReturnSeqFunc) and its value shape—e.g. that it is a Map from string keys
to functions that accept an optional direction number and return number[][] (or
list the specific keys like "60deg","120deg","360deg" and the "+" variants);
update the `@returns` to reflect the Map's type signature (or use `@type`
{Map<string, (dir?: number) => number[][]>}) and keep a short description of
what the map provides.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@js/danoni_main.js`:
- Line 11958: The code calls g_frzReturnSeqFunc.get(g_stateObj.frzReturnType)()
directly which will throw if the Map has no entry for that key; change to first
retrieve the provider with g_frzReturnSeqFunc.get(g_stateObj.frzReturnType),
check that the provider exists and is a function, then invoke it and assign to
g_workObj.frzReturnSeq; if missing, assign a safe default (e.g. null or an empty
sequence) and optionally log or handle the error so initialization continues
gracefully.

---

Nitpick comments:
In `@js/lib/danoni_constants.js`:
- Around line 1913-1945: The JSDoc above g_frzReturnSeqFunc is stale (mentions a
`@param` {_type} for an old function); remove the param and replace the comment to
document the Map constant itself (g_frzReturnSeqFunc) and its value shape—e.g.
that it is a Map from string keys to functions that accept an optional direction
number and return number[][] (or list the specific keys like
"60deg","120deg","360deg" and the "+" variants); update the `@returns` to reflect
the Map's type signature (or use `@type` {Map<string, (dir?: number) =>
number[][]>}) and keep a short description of what the map provides.

ℹ️ Review info
Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: e2a776a0-8387-4d64-a058-5df7ed930833

📥 Commits

Reviewing files that changed from the base of the PR and between cec2385 and 0bf3e24.

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
js/lib/danoni_constants.js (1)

1926-1954: LGTM!

The Map-based sequence provider is well-structured. The "+" variants elegantly compose bidirectional rotation sequences by calling the base function with both directions and concatenating the results.

One minor observation: the variable names stepF40 = 25 and stepF120 = 40 don't directly correspond to their values, which could be slightly confusing for future maintainers. Consider renaming to reflect the actual step counts (e.g., stepCount = 25) if the names don't have specific historical meaning.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@js/lib/danoni_constants.js` around lines 1926 - 1954, Rename the confusing
stepF40 and stepF120 variables inside the g_frzReturnSeqFunc entries to clearer
names that reflect their numeric values or purpose (e.g., stepCount25 or
stepCount40, or simply stepCount) and update their uses in the `60deg` and
`120deg` arrow functions so the variable name matches everywhere; ensure only
the variable identifier changes (no logic change) in the `60deg` function where
stepF40 is used and in the `120deg` function where stepF120 is used.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@js/lib/danoni_constants.js`:
- Around line 1926-1954: Rename the confusing stepF40 and stepF120 variables
inside the g_frzReturnSeqFunc entries to clearer names that reflect their
numeric values or purpose (e.g., stepCount25 or stepCount40, or simply
stepCount) and update their uses in the `60deg` and `120deg` arrow functions so
the variable name matches everywhere; ensure only the variable identifier
changes (no logic change) in the `60deg` function where stepF40 is used and in
the `120deg` function where stepF120 is used.

ℹ️ Review info
Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: a6c3f12c-a641-44c7-89fa-f983b47aa2c3

📥 Commits

Reviewing files that changed from the base of the PR and between 0bf3e24 and bc6b45b.

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@js/lib/danoni_constants.js`:
- Around line 1951-1965: The Pendulum entry references an undefined _dir
variable; change its function signature to accept _dir with a default (e.g.,
(_dir = 1) => {) so the body can use _dir safely, mirroring other entries like
'+60deg'; update the Pendulum arrow function declaration to include the
parameter and keep the rest of the makeEaseSequence(...) calls intact so runtime
ReferenceError is avoided.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: dee9e31d-3d08-46dc-a399-21452a9054f1

📥 Commits

Reviewing files that changed from the base of the PR and between bc6b45b and 59f7dca.

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@js/lib/danoni_constants.js`:
- Around line 1928-1963: The easing concatenations for presets like '+60deg',
'+120deg' and 'Pendulum' are duplicating junction frames because
makeEaseSequence includes both endpoints; fix by deduping boundaries when
concatenating: for each subsequent makeEaseSequence call drop its first element
(e.g., use .slice(1)) so sequences join without repeating the shared frame;
apply this for all concatenations inside the '+60deg', '+120deg' and 'Pendulum'
handlers (and any other places using multiple makeEaseSequence calls) so total
frame counts match the intended 50/80/100 targets.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: eb67cdcb-252d-486e-b472-fabe7deaf17a

📥 Commits

Reviewing files that changed from the base of the PR and between 59f7dca and 2f18261.

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

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

Labels

func10:Settings 設定画面全般

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant