Skip to content

small-fix: Fix keybind already bound display issue due to wrong split - #5190

Merged
evanpelle merged 1 commit into
mainfrom
small-fix/key-already-bound
Aug 31, 2026
Merged

small-fix: Fix keybind already bound display issue due to wrong split#5190
evanpelle merged 1 commit into
mainfrom
small-fix/key-already-bound

Conversation

@JB940

@JB940 JB940 commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Before opening a PR: discuss new features on Discord first, and file bugs or small improvements as issues. You must be assigned to an approved issue — unsolicited PRs will be auto-closed.

Add approved & assigned issue number here:

None - small fix

Description:

Fix keybind already bound display issue due to wrong split. Main splits the "KEY ALREADY BOUND" error on the key that was pressed. If the pressed key is present as a letter in the string before {key} in the translation - it instead splits the actual string on that letter and not the pressed key

Old

image image

New

image

Please complete the following:

  • I have added screenshots for all UI updates

Please put your Discord username so you can be contacted if a bug or regression is found:

JB940

@JB940
JB940 requested a review from a team as a code owner August 31, 2026 00:59
@JB940 JB940 added the small-fix Small fix (≤ 50 lines) — auto-applied by PR gate label Aug 31, 2026
@coderabbitai

coderabbitai Bot commented Aug 31, 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9cb0c892-6eb5-402c-b465-5023f6b47549

📥 Commits

Reviewing files that changed from the base of the PR and between a369e16 and 8c0b218.

📒 Files selected for processing (1)
  • src/client/UserSettingModal.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.


Walkthrough

The keybind conflict message now uses a __KEY__ placeholder during translation. The message splits on this placeholder before the display key receives styled rendering.

Changes

Keybind conflict messaging

Layer / File(s) Summary
Placeholder-based key rendering
src/client/UserSettingModal.ts
The translated conflict message uses __KEY__ as the split marker. The display key is inserted into a styled span after splitting.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Merge Risk: ⚪ Minimal · up to 8c0b2

This localized change corrects how the keybind-conflict message displays the pressed key without changing keybind behavior or persistence. No actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: ryanbarlow97

Poem

A key finds its place
The message parts cleanly align
Styled letters shine bright
Conflicts speak with clear intent
Small change, tidy display

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the keybinding display fix and matches the main change.
Description check ✅ Passed The description explains the keybinding conflict display issue, its cause, and the corrected behavior with screenshots.
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 1…
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.
Full details: Docstring Coverage

Explanation

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 1 files.

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch

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.

@github-actions

Copy link
Copy Markdown

🤖 Claude Code Review

Verdict: No issues found — this is a correct, well-targeted fix. Findings: 0 critical, 0 high, 0 medium, 0 low.

Summary

The change (src/client/UserSettingModal.ts) fixes the "key already bound" conflict message so it no longer mis-splits the translated string when the pressed key's display text happens to appear as a substring earlier in the translated sentence (e.g. a letter key colliding with a letter in the surrounding text). Instead of interpolating the display key directly and then split()-ing the rendered message on that same key, it now:

  1. Interpolates a unique placeholder token (__KEY__) into the translation.
  2. Splits the resulting message on that placeholder instead of on displayKey.
  3. Renders the actual displayKey inside the styled <span> between the two parts.

This correctly decouples "where to split the sentence" from "what text to display," eliminating the substring-collision bug shown in the PR's before/after screenshots.

Verified:

  • The translation key (user_setting.keybind_conflict_error in resources/lang/en.json) contains a single {key} placeholder, so the destructured [prefix, suffix] = message.split(placeholder) is safe (no accidental multiple splits).
  • suffix falls back to "" when undefined, matching the prior fallback behavior.
  • No new user-facing strings were introduced, so the i18n requirement in CLAUDE.md (all user-visible text via translateText()) doesn't apply here — the placeholder itself is never rendered to the user.
  • No behavior change for the missing-translation fallback path (translateText returning the raw key), since the placeholder simply won't be found and prefix will be the whole string, matching prior behavior for that edge case.

No bugs, logic errors, or CLAUDE.md violations found in this diff.

@evanpelle evanpelle added this to the v34 milestone Aug 31, 2026
@github-project-automation github-project-automation Bot moved this from Triage to Final Review in OpenFront Release Management Aug 31, 2026
@evanpelle
evanpelle merged commit 9d46ada into main Aug 31, 2026
18 of 19 checks passed
@evanpelle
evanpelle deleted the small-fix/key-already-bound branch August 31, 2026 02:53
@github-project-automation github-project-automation Bot moved this from Final Review to Complete in OpenFront Release Management Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

small-fix Small fix (≤ 50 lines) — auto-applied by PR gate

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

2 participants