Repository navigation
fix(settings): spell every key like config.yml and check conflicts on all of them - #645
Conversation
… all of them load_settings_for_category had its own key_to_string with no arm for Space, Tab, Home, End, Ins or F0-F12, so those rows showed [unknown] or [ ], and the conflict check, which parses the row text back, skipped them and let two actions share an F-key. Move the handler's complete key_to_config_string to core::user_config and use it for the Settings rows and for key capture. It lives in core so the headless build keeps compiling. Fixes LargeModGames#596 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
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 configurationConfiguration used: Repository: LargeModGames/spotatui/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (5)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review. 📝 WalkthroughWalkthroughKeybinding rows in Settings now use config-style key names through a shared formatter. Tests cover key serialization, displayed values, and refusal of a duplicate key assignment after settings reload. ChangesKeybinding settings
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~12 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The supplied evidence identifies no remaining issue that would prevent merging the keybinding display and conflict-handling changes. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to Settings now displays keybindings using configuration-compatible names. Duplicate-key and reserved-key checks still run before an edit is accepted. No new external access or privilege path was identified, though configuration write recovery was not fully established. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
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. Comment |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Summary
Fixes #596.
key_to_config_stringmoves tosrc/core/user_config.rsaspub fn key_to_config_string(key: &Key) -> String, next toparse_key_public. It keeps its exhaustive match (no_arm).handle_key_editimports it, andload_settings_for_categoryuses it for everykeys.*row. The localkey_to_stringis gone.settings_schema.rsgets it through the existingcrate::core::user_configimport incore/app/mod.rs, with no newuseline.[space], matchingconfig.yml.save_configclosure andplugin_key_stringalone (optional in the issue).Most of the
settings_schema.rsdiff is rustfmt re-wrapping the 36 rows after the rename.Tests:
keybinding_rows_spell_keys_the_way_config_yml_doesandevery_key_row_parses_back_as_a_keyinsettings_schema.rs,config_string_round_trips_through_parse_keyinuser_config.rs, andcapturing_a_key_already_bound_elsewhere_is_refused_after_a_reloadintui/handlers/settings.rs(walks Enter/F5 on Help, applies, reloads, then Enter/F5 on Search; noapp.<field> =writes).Testing
cargo fmt --all -- --check: cleancargo clippy --no-default-features --features telemetry,tui -- -D warnings: cleancargo clippy --no-default-features --features telemetry -- -D warnings(headless leg): cleancargo test --no-default-features --features telemetry,tui: 1313 passed, 0 failedsettingsandround_trips_through_parse_keyfilters.key_to_string(ending in_ => "unknown") shadowed back intoload_settings_for_category, the twosettings_schematests and the conflict test fail.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
config.yml, including function keys, Home, End, Tab, Insert, and Space.