Skip to content

fix(settings): width-check the Playing Icon like the other fixed-cell icons - #644

Merged
LargeModGames merged 1 commit into
LargeModGames:mainfrom
kapok-4o:fix/playing-icon-width
Sep 28, 2026
Merged

LargeModGames merged 1 commit into
LargeModGames:mainfrom
kapok-4o:fix/playing-icon-width

Conversation

@kapok-4o

@kapok-4o kapok-4o commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fixes #597. "behavior.playing_icon" moves into the one-cell group in apply_settings_changes, with an inner arm above the existing _ => {}; the old separate arm is gone. The error path is unchanged (settings_error → set_status_message). The row description in settings_schema.rs now reads "Single-cell icon for the playing row". A rejected value stays in the Settings row, like the gauge icons.

Tests: saving_a_two_cell_playing_icon_keeps_the_default_and_reports_it (">>" and "" keep "▶", status message mentions "one terminal cell") and saving_a_one_cell_playing_icon_applies_it ("»" is saved, no status message).

Testing

  • cargo fmt --all -- --check: clean
  • cargo clippy --no-default-features --features telemetry,tui -- -D warnings: clean
  • cargo test --no-default-features --features telemetry,tui: 1311 passed, 0 failed
  • cargo test --no-default-features --features telemetry,tui settings_apply: 6 passed, including both new tests
  • With the old separate arm put back, the two-cell test fails.

Additional notes

This is one of five small PRs I opened together (for #606, #598, #597, #596 and #601). Each changelog entry sits at a different spot in [Unreleased], and I test-merged all five in three orders without conflicts; together they pass the slim checks (1327 tests).

Written with AI coding assistants: Codex drafted fixes for these issues, and Claude Code rebuilt each one on current main against the issue text and re-tested it.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Invalid playing icons that are empty or wider than one terminal cell are rejected, and the current icon is retained with a status message.
  • Documentation
    • Clarified that the playing-row icon must be exactly one terminal cell wide.

… icons

The loader and the docs require playing_icon to be one terminal cell,
but its Settings arm saved any value, so `>>` widened the playing row
and was then dropped on the next launch. Move it into the one-cell
group that already checks the gauge and sort icons, and say so in the
row description.

Fixes LargeModGames#597

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Sep 28, 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: LargeModGames/spotatui/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 00981796-8aae-4bb8-b6a1-ae9b54b3075a

📥 Commits

Reviewing files that changed from the base of the PR and between ea356a0 and 100e63d.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • src/core/app/settings_apply.rs
  • src/core/app/settings_schema.rs

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


📝 Walkthrough

Walkthrough

Settings validates behavior.playing_icon against terminal width. It applies one-cell values and rejects empty or multi-cell values without changing the configured icon.

Changes

Playing icon validation

Layer / File(s) Summary
Validate and apply the playing icon
src/core/app/settings_schema.rs, src/core/app/settings_apply.rs, CHANGELOG.md
The setting description identifies the playing icon as single-cell. Settings applies values with a terminal width of one cell and rejects other values with a status message. Tests cover empty, multi-cell, and one-cell values. The changelog records the validation.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 100e6

Settings rejects empty or multi-cell playing icons while preserving the configured icon. The change appears ready to merge after normal checks.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title uses the allowed fix(settings): conventional-commit prefix and accurately describes the width validation added for playing_icon.
Linked Issues check ✅ Passed Issue [#597] requires save-time one-terminal-cell validation, the updated row description, and tests for two-cell, empty, and one-cell values. The reviewed code places behavior.playing_icon in the e…
Out of Scope Changes check ✅ Passed The changes stay within issue [#597]. The CHANGELOG.md entry documents the new Settings behavior. The code changes validate playing_icon, update its description, and add focused tests. No unrelate…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
✨ Simplify code
  • Create a new PR

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.

@codecov

codecov Bot commented Sep 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@LargeModGames
LargeModGames merged commit e1a038e into LargeModGames:main Sep 28, 2026
31 checks passed
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.

Settings saves a two-cell Playing Icon that the next launch drops

2 participants