Skip to content

feat: [1122] 譜面名の複数行・リサイズ対応#2157

Merged
cwtickle merged 4 commits into
developfrom
feature/1122-flap-font-size
Jun 22, 2026
Merged

feat: [1122] 譜面名の複数行・リサイズ対応#2157
cwtickle merged 4 commits into
developfrom
feature/1122-flap-font-size

Conversation

@cwtickle

@cwtickle cwtickle commented Jun 22, 2026

Copy link
Copy Markdown
Owner

🔨 変更内容 / Details of Changes

1. 譜面名の複数行・リサイズ対応

  • 譜面名が長い場合に設定画面や結果画面で自動でリサイズするように変更しました。
  • 設定画面については幅が狭いため、自動で折り返しができるように変更しています。
  • 結果画面のPlayStyleの複数行処理と類似処理のため、関数化してまとめました。

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

  1. Discordでの指摘より。
    設定画面のヘルプボタンにより譜面名がボタンに重なる可能性があったため。

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

image image image image image

📝 その他コメント / Other Comments

@cwtickle cwtickle added func10:Settings 設定画面全般 func21:Result 結果画面及びその周辺の機能 code-refactoring Discord / Gitter Discord (Gitter)での議論あり labels Jun 22, 2026
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

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: 70ba7aba-fcd6-4cfc-8d03-b4759b30987e

📥 Commits

Reviewing files that changed from the base of the PR and between 15208ff and f3f1825.

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

📝 Walkthrough

Summary by CodeRabbit

  • Style
    • Improved text sizing for difficulty names and result labels to ensure proper multi-line formatting across displays.
    • Enhanced visual consistency in result screens and generated images with optimized text rendering.

Walkthrough

getFontSizeMulti() is added to split long strings near a space boundary into two <br>-separated lines and compute a font size. getFontSize2() is updated to measure every <br>-split line against a max width. Both helpers are applied to the difficulty label in settings, lblDifData/lblStyleData on the result screen, and difficulty/style text in result image generation.

Changes

Multi-line font sizing helpers and callsites

Layer / File(s) Summary
getFontSize2() and getFontSizeMulti() implementation
js/danoni_main.js
getFontSize2() is reworked to split input on <br> and require every line to fit within _maxWidth before accepting a font size. New getFontSizeMulti() wraps it: splits long text near the midpoint at a space boundary, prepends an optional prefix, and returns both the display string and computed font size.
Settings UI, result screen, and result image callsites
js/danoni_main.js
makeDifList builds difficulty labels with getFontSizeMulti() using ${key} / ${dif} prefix format. lnkDifficulty label uses getFontSizeMulti() with key-name prefix and applies the returned font size. lblDifData on the result screen sizes via getFontSize2(). lblStyleData replaces manual comma-based breaks with getFontSizeMulti() output. Result image introduces flapWidth = 370 constant and applies both helpers to difDataForImage and two-line playStyleData rendering.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • cwtickle/danoniplus#1871: Earlier refactor of getFontSize to getFontSize2 that introduced the call signature and wrapper pattern the new multi-line <br> measurement and getFontSizeMulti helper build directly upon.
  • cwtickle/danoniplus#2052: Also modifies difficulty/info label sizing and positioning in js/danoni_main.js using getFontSize2(), with overlapping changes to result-screen and settings label rendering.
  • cwtickle/danoniplus#2073: Also modifies result-image canvas text sizing and layout (including flapWidth, <br>-split text handling, and getFontSize2() calls), touching the same result-canvas drawing logic updated here.

Suggested labels

Layout Changes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly refers to the main feature of supporting multi-line and resizing for difficulty names (譜面名の複数行・リサイズ対応), which matches the core changes in the changeset.
Description check ✅ Passed The description comprehensively covers the changes: multi-line and resizing support for difficulty names, automatic wrapping on settings screen, refactoring into reusable functions, and the Discord issue that motivated these changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/1122-flap-font-size

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.44.0)
js/danoni_main.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.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@js/danoni_main.js`:
- Around line 1518-1520: The code uses hard-coded space character checks (`' '`)
instead of using the `delim` parameter that is part of the function contract,
causing the function to ignore custom delimiters. Replace the direct comparison
`_targetStr[j] === ' '` with a comparison using the `delim` variable in the loop
starting at halfIndex (around line 1519), and also apply the same fix to the
similar check mentioned at line 1528-1530. This ensures the function respects
the delimiter option passed by the caller.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 42d708a3-55c2-4322-b927-0765cb5e3321

📥 Commits

Reviewing files that changed from the base of the PR and between bdb95ed and 15208ff.

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

Comment thread js/danoni_main.js
@cwtickle cwtickle merged commit 0480a01 into develop Jun 22, 2026
4 checks passed
@cwtickle cwtickle deleted the feature/1122-flap-font-size branch June 23, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-refactoring Discord / Gitter Discord (Gitter)での議論あり func10:Settings 設定画面全般 func21:Result 結果画面及びその周辺の機能

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant