Skip to content

feat(radio): optional key lock feature#7383

Open
3djc wants to merge 8 commits into
mainfrom
3djc/keys-lock
Open

feat(radio): optional key lock feature#7383
3djc wants to merge 8 commits into
mainfrom
3djc/keys-lock

Conversation

@3djc
Copy link
Copy Markdown
Collaborator

@3djc 3djc commented May 23, 2026

This PR brings an OPTIONAL ability to lock radio keys while flying, handing radio to a trainee,....

Feature is enabled in Radio setup / Radio settings / Keys shortcuts

Capture d’écran 2026-05-23 à 12 03 12

Feature is then activated by long pushing both keys part of the combo. Combo will vary based on actual radio model, but the combo is always listed in Keys shortcut.

Any keys press with generate a Keys locked message, with a reminder of the keys combo

Deactivating the lock is done in the same way as activation

gtest are included

This closes #5344 and closes #3524

For back port, 961df15 can be used

Summary by CodeRabbit

  • New Features
    • Key-lock: configurable two-key lock to prevent accidental button presses; per-board combos supported and generated into builds
  • UI
    • New Key lock toggle and status indicators in General settings and setup menus; controls disabled with explanatory tooltip on unsupported boards
  • Tests
    • Added automated tests validating combo behavior, toggle events, suppression while locked, and interaction with the setting
  • Localization
    • Added translations and string keys for key-lock messaging in multiple languages

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 23, 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
📝 Walkthrough

Walkthrough

Adds an end-to-end per-board key-lock feature: persisted setting, YAML/schema updates, runtime lock detection and event suppression, public APIs, UI wiring in companion and radio, board JSON config and codegen, tests, and translations.

Changes

Key Lock Feature Implementation

Layer / File(s) Summary
Persisted state and serialization
companion/src/firmwares/generalsettings.h, companion/src/firmwares/edgetx/yaml_generalsettings.cpp, radio/src/datastructs_private.h, radio/src/datastructs.h, radio/src/storage/yaml/*.cpp
Adds keyLockEnabled to GeneralSettings and RadioData; updates YAML encode/decode and YAML-generated schemas; adjusts packed bitfields and compile-time CHKSIZE assertions.
Lock detection and event suppression
radio/src/keys.cpp
Detects long-press of configured KEYS_LOCK_KEY1+KEYS_LOCK_KEY2, toggles s_keys_locked, kills combo per-key events, suppresses per-key BREAK/REPEAT while locked, and manages notification re-arm.
Public APIs & main loop integration
radio/src/keys.h, radio/src/main.cpp
Adds areKeysLocked() and consumeKeysLockToggleEvent(); integrates checkKeysLock() into perMain() to present locked/unlocked feedback and audio.
UI components and menu wiring
companion/src/generaledit/generalsetup.{h,cpp,ui}, radio/src/gui/128x64/radio_setup.cpp, radio/src/gui/212x64/radio_setup.cpp, radio/src/gui/colorlcd/setup_menus/key_shortcuts.cpp, radio/src/gui/common/stdlcd/feature_control.h
Companion adds conditional Key lock checkbox bound to GeneralSettings; radio menus add key-lock rows and ToggleSwitch/checkbox controls; CASE_KEY_LOCK macro added for conditional rendering.
Board configuration & companion parsing
radio/src/boards/hw_defs/*.json, companion/src/firmwares/boardjson.{h,cpp}
Adds key_lock_combo arrays to board definitions and updates BoardJson to parse and expose hasKeyLockCombo().
Target HAL mappings
radio/src/targets/{t15pro,tx15,tx16smk3,horus,taranis}/hal.h
Defines KEYS_LOCK_KEY1/KEYS_LOCK_KEY2 macros for supported targets mapping to specific key identifiers.
Hardware codegen & build
radio/src/CMakeLists.txt, radio/src/boards/generic_stm32/CMakeLists.txt, radio/util/hw_defs/generator.py, radio/util/hw_defs/models.py, radio/util/hw_defs/hal_keys_lock.jinja
Generator/model accept key_lock_combo; Jinja emits hal_keys_lock.h; CMake adds generation target and includes generated header in firmware build.
Tests & localization
radio/src/tests/keys_lock.cpp, radio/src/translations/{i18n/*.h,string_list.h,sim_string_list.h}
Adds gtest suite for combo toggle, timing, disabling, suppression and re-arm; adds translation keys and locale strings and simulator wiring for messages.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 6.25% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(radio): optional key lock feature' directly and clearly describes the main change: adding an optional key lock feature to the radio firmware.
Linked Issues check ✅ Passed The PR comprehensively addresses issue #5344 by implementing a button lock feature for radio transmitters, allowing users to prevent accidental key presses during flight or when handing the radio to others, exactly as requested.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the key lock feature: data structures, UI elements, key event handling, YAML serialization, board configurations, translations, and tests. No out-of-scope modifications detected.
Description check ✅ Passed PR description covers the feature, use case, UI location, activation method, and references closed issues, but lacks structured sections.

✏️ 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 3djc/keys-lock

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
Copy Markdown

@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: 3

Note

Due to the large number of review comments, Critical, Major severity comments were prioritized as inline comments.

🟡 Minor comments (19)
companion/src/generaledit/generalsetup.ui-1329-1342 (1)

1329-1342: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix grid row collision with existing spacer.

Line 1329 places the new label at row="30" column="0", which is already used by verticalSpacer_2 (Line 1088). This can hide or misplace the label/control row.

Suggested fix
-    <item row="30" column="0">
+    <item row="31" column="0">
       <widget class="QLabel" name="label_keyLockEnabled">
         <property name="text">
           <string>Key lock</string>
         </property>
       </widget>
     </item>
-    <item row="30" column="1">
+    <item row="31" column="1">
       <widget class="QCheckBox" name="chkKeyLockEnabled">
         <property name="text">
           <string/>
         </property>
       </widget>
     </item>
🤖 Prompt for 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.

In `@companion/src/generaledit/generalsetup.ui` around lines 1329 - 1342, The new
Key lock widgets (QLabel name="label_keyLockEnabled" and QCheckBox
name="chkKeyLockEnabled") are placed at row="30" which collides with the
existing verticalSpacer_2; move both widgets to an unused row (for example
row="31" or the next free row in the grid) so they don't overlap the spacer,
updating the row attributes for label_keyLockEnabled and chkKeyLockEnabled in
the UI XML to that free row.
radio/src/translations/i18n/cz.h-575-578 (1)

575-578: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Localize the key-lock strings in the Czech translation file.

All four added macros are still English, which creates mixed-language UI text for Czech users. Please provide Czech translations for these entries.

🤖 Prompt for 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.

In `@radio/src/translations/i18n/cz.h` around lines 575 - 578, Translate the four
English macros into Czech while keeping the macro names and placeholder formats
intact: replace TR_KEY_LOCK_FMT "Key lock (%s+%s hold)" with a Czech equivalent
preserving (%s+%s), replace TR_KEYS_LOCKED "Keys locked" and TR_KEYS_LOCKED_FMT
"Keys locked (%s+%s)" with Czech phrases (the formatted one must keep the %s+%s
placeholders), and replace TR_KEYS_UNLOCKED "Keys unlocked" with its Czech
translation; ensure punctuation and spacing remain consistent and no
placeholders are altered.
radio/src/translations/i18n/cn.h-572-575 (1)

572-575: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Localize the new key-lock strings for this locale.

These new macros are English literals, so users in the Chinese locale will see mixed-language lock/unlock prompts. Please translate all four strings in this file’s language.

🤖 Prompt for 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.

In `@radio/src/translations/i18n/cn.h` around lines 572 - 575, The four new
English macro strings TR_KEY_LOCK_FMT, TR_KEYS_LOCKED, TR_KEYS_LOCKED_FMT, and
TR_KEYS_UNLOCKED need Chinese translations so the locale is consistent; replace
the English literals with appropriate Chinese text (e.g., translate "Key lock
(%s+%s hold)" and "Keys locked/locked (%s+%s)/unlocked" into Chinese) keeping
the existing format specifiers intact and preserving the macro names in cn.h.
radio/src/translations/i18n/da.h-577-580 (1)

577-580: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Translate the new key-lock strings for Danish locale consistency.

The added strings are English literals, so the lock/unlock messaging will not match the rest of the Danish UI. Please localize these four macros.

🤖 Prompt for 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.

In `@radio/src/translations/i18n/da.h` around lines 577 - 580, The four new
English macros (TR_KEY_LOCK_FMT, TR_KEYS_LOCKED, TR_KEYS_LOCKED_FMT,
TR_KEYS_UNLOCKED) must be replaced with Danish translations to match the locale;
update each macro value to Danish equivalents (suggestions: TR_KEY_LOCK_FMT ->
"Tastelås (%s+%s hold)", TR_KEYS_LOCKED -> "Taster låst", TR_KEYS_LOCKED_FMT ->
"Taster låst (%s+%s)", TR_KEYS_UNLOCKED -> "Taster oplåst") by editing their
string literals so the UI displays Danish text.
radio/src/translations/i18n/de.h-573-576 (1)

573-576: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Provide German translations for the new key-lock strings.

These four additions are English-only and will surface mixed-language prompts in German UI. Please localize them in this file.

🤖 Prompt for 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.

In `@radio/src/translations/i18n/de.h` around lines 573 - 576, Replace the
English-only macro values with German translations for the four keys: update
TR_KEY_LOCK_FMT to a German phrase equivalent to "Key lock (%s+%s hold)" (e.g.,
"Tasten sperren (%s+%s gedrückt halten)"), TR_KEYS_LOCKED to "Tasten gesperrt"
(or similar), TR_KEYS_LOCKED_FMT to a formatted German equivalent like "Tasten
gesperrt (%s+%s)", and TR_KEYS_UNLOCKED to "Tasten entsperrt"; modify the macro
definitions for TR_KEY_LOCK_FMT, TR_KEYS_LOCKED, TR_KEYS_LOCKED_FMT and
TR_KEYS_UNLOCKED in de.h accordingly so the German UI shows localized text.
radio/src/translations/i18n/fr.h-576-579 (1)

576-579: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add French translations for the new key-lock labels.

These four newly added labels are still English, so the feature appears untranslated in French UI. Please translate them in-line with the rest of the file.

🤖 Prompt for 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.

In `@radio/src/translations/i18n/fr.h` around lines 576 - 579, Replace the four
English strings with French translations: update the definitions for
TR_KEY_LOCK_FMT, TR_KEYS_LOCKED, TR_KEYS_LOCKED_FMT, and TR_KEYS_UNLOCKED to
their French equivalents (e.g., "Verrouillage de la touche (%s+%s maintenu)",
"Touches verrouillées", "Touches verrouillées (%s+%s)", "Touches
déverrouillées") so the labels appear translated in the French UI; edit the
string literals assigned to those symbols in-place.
radio/src/translations/i18n/es.h-571-574 (1)

571-574: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Translate new key-lock strings for Spanish locale.

These new entries are still in English, so Spanish UI will show mixed-language text for the new feature. Please localize all four macros consistently.

🤖 Prompt for 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.

In `@radio/src/translations/i18n/es.h` around lines 571 - 574, Replace the four
English strings in the Spanish locale with proper Spanish translations: update
the macros TR_KEY_LOCK_FMT, TR_KEYS_LOCKED, TR_KEYS_LOCKED_FMT, and
TR_KEYS_UNLOCKED in es.h so they are localized (for example use "Bloqueo de
tecla (%s+%s mantenida)" or "Bloqueo de tecla (%s+%s pulsadas)" for
TR_KEY_LOCK_FMT, "Teclas bloqueadas" for TR_KEYS_LOCKED, "Teclas bloqueadas
(%s+%s)" for TR_KEYS_LOCKED_FMT, and "Teclas desbloqueadas" for
TR_KEYS_UNLOCKED), ensuring phrasing is consistent and preserves the %s format
placeholders.
radio/src/translations/i18n/fi.h-572-575 (1)

572-575: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Localize key-lock strings in Finnish file.

The new key-lock texts are English, which breaks locale consistency in Finnish builds. Please provide Finnish translations for all four macros.

🤖 Prompt for 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.

In `@radio/src/translations/i18n/fi.h` around lines 572 - 575, Replace the four
English macro values with Finnish translations: update TR_KEY_LOCK_FMT to
"Avainlukko (%s+%s pidetään)", TR_KEYS_LOCKED to "Avimet lukittu",
TR_KEYS_LOCKED_FMT to "Avimet lukittu (%s+%s)", and TR_KEYS_UNLOCKED to "Avimet
avattu"; change the string literals for the macros TR_KEY_LOCK_FMT,
TR_KEYS_LOCKED, TR_KEYS_LOCKED_FMT, and TR_KEYS_UNLOCKED accordingly so the
Finnish locale file contains Finnish text.
radio/src/translations/i18n/jp.h-572-575 (1)

572-575: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add Japanese translations for the new key-lock macros.

Line 572 through Line 575 are English-only in jp.h. Please localize these strings to Japanese so key-lock prompts match the selected language.

🤖 Prompt for 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.

In `@radio/src/translations/i18n/jp.h` around lines 572 - 575, Replace the
English-only macros with Japanese translations in the jp.h header: update
TR_KEY_LOCK_FMT, TR_KEYS_LOCKED, TR_KEYS_LOCKED_FMT, and TR_KEYS_UNLOCKED to
Japanese strings while preserving all format specifiers and punctuation (e.g.,
keep "%s+%s" in TR_KEY_LOCK_FMT and TR_KEYS_LOCKED_FMT). Ensure the Japanese
wording fits UI context for "Key lock (X+Y hold)", "Keys locked", "Keys locked
(X+Y)", and "Keys unlocked", and keep the macro names and surrounding formatting
unchanged.
radio/src/translations/i18n/it.h-573-576 (1)

573-576: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Translate the new key-lock strings for Italian locale.

Line 573 through Line 576 are currently English text in it.h. These should be localized to Italian for consistent UX.

🤖 Prompt for 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.

In `@radio/src/translations/i18n/it.h` around lines 573 - 576, The listed
translation keys (TR_KEY_LOCK_FMT, TR_KEYS_LOCKED, TR_KEYS_LOCKED_FMT,
TR_KEYS_UNLOCKED) are still in English; replace their string values with Italian
equivalents for consistent localization: set TR_KEY_LOCK_FMT to an Italian
phrase conveying "Key lock (%s+%s hold)" (e.g., "Blocco tasti (%s+%s tieni
premuto)"), TR_KEYS_LOCKED to "Tasti bloccati", TR_KEYS_LOCKED_FMT to "Tasti
bloccati (%s+%s)", and TR_KEYS_UNLOCKED to "Tasti sbloccati"; update these
definitions in it.h where those macros are declared.
radio/src/translations/i18n/ko.h-582-585 (1)

582-585: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Localize key-lock UI strings in Korean.

Line 582 through Line 585 are added as English text in ko.h. Please translate them to Korean to avoid mixed-language lock/unlock feedback.

🤖 Prompt for 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.

In `@radio/src/translations/i18n/ko.h` around lines 582 - 585, The Korean
translation file contains English literals for key-lock UI keys; update the
defines TR_KEY_LOCK_FMT, TR_KEYS_LOCKED, TR_KEYS_LOCKED_FMT, and
TR_KEYS_UNLOCKED in ko.h to Korean equivalents to avoid mixed-language feedback
— e.g. replace with Korean phrases like: TR_KEY_LOCK_FMT -> 키 잠금 (%s+%s 누르고 유지),
TR_KEYS_LOCKED -> 키 잠김, TR_KEYS_LOCKED_FMT -> 키 잠김 (%s+%s), and TR_KEYS_UNLOCKED
-> 키 잠금 해제 (adjust wording if you prefer alternative Korean phrasing).
radio/src/translations/i18n/he.h-576-579 (1)

576-579: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Localize the new key-lock labels in Hebrew.

Line 576 through Line 579 add user-facing strings in English inside the Hebrew locale file. Please translate these four macros to Hebrew to keep the UI language consistent.

🤖 Prompt for 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.

In `@radio/src/translations/i18n/he.h` around lines 576 - 579, Replace the English
strings with Hebrew translations for the four macros: TR_KEY_LOCK_FMT should be
translated to a Hebrew phrase conveying "Key lock (%s+%s hold)" (e.g., "נעילת
מקש (החזקו %s+%s)"), TR_KEYS_LOCKED to "מפתחות נעולים", TR_KEYS_LOCKED_FMT to
"מפתחות נעולים (%s+%s)", and TR_KEYS_UNLOCKED to "מפתחות לא נעולים". Update the
definitions for TR_KEY_LOCK_FMT, TR_KEYS_LOCKED, TR_KEYS_LOCKED_FMT, and
TR_KEYS_UNLOCKED in the Hebrew locale file accordingly.
radio/src/translations/i18n/nl.h-574-577 (1)

574-577: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Localize the new key-lock strings in Dutch.

Line 574–Line 577 are still in English, so Dutch users will see mixed-language UI for the new feature.

🤖 Prompt for 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.

In `@radio/src/translations/i18n/nl.h` around lines 574 - 577, The strings
TR_KEY_LOCK_FMT, TR_KEYS_LOCKED, TR_KEYS_LOCKED_FMT, and TR_KEYS_UNLOCKED are
still in English; replace their values with Dutch translations so the UI is
consistent (e.g., translate "Key lock (%s+%s hold)" and "Keys locked/unlocked"
and the formatted variants into appropriate Dutch phrases), updating the
definitions for those macros in the translations file where they are declared.
radio/src/translations/i18n/pl.h-572-575 (1)

572-575: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Translate key-lock labels/messages for Polish locale.

Line 572–Line 575 are English literals, which breaks Polish localization consistency for this new flow.

🤖 Prompt for 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.

In `@radio/src/translations/i18n/pl.h` around lines 572 - 575, Lines define
English key-lock strings; replace them with Polish translations: change
TR_KEY_LOCK_FMT to a Polish phrase like "Blokada klawisza (%s+%s przytrzymane)",
update TR_KEYS_LOCKED to "Klawisze zablokowane", TR_KEYS_LOCKED_FMT to "Klawisze
zablokowane (%s+%s)", and TR_KEYS_UNLOCKED to "Klawisze odblokowane" so the
Polish locale is consistent with the new key-lock flow.
radio/src/translations/i18n/ru.h-575-578 (1)

575-578: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Translate key-lock status strings for Russian locale.

Line 575–Line 578 are English values in ru.h, so Russian users get non-localized key-lock messages.

🤖 Prompt for 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.

In `@radio/src/translations/i18n/ru.h` around lines 575 - 578, Replace the English
values for the macros TR_KEY_LOCK_FMT, TR_KEYS_LOCKED, TR_KEYS_LOCKED_FMT, and
TR_KEYS_UNLOCKED with Russian translations, preserving the exact format
specifiers and punctuation (e.g., keep "%s+%s" and surrounding
parentheses/quotes). For example use Russian phrases like "Блокировка клавиш
(%s+%s удерживать)" for TR_KEY_LOCK_FMT, "Клавиши заблокированы" for
TR_KEYS_LOCKED, "Клавиши заблокированы (%s+%s)" for TR_KEYS_LOCKED_FMT, and
"Клавиши разблокированы" for TR_KEYS_UNLOCKED; ensure you only change the string
literals and not the macro names or formatting tokens.
radio/src/translations/i18n/pt.h-573-576 (1)

573-576: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Provide Portuguese translations for new key-lock strings.

Line 573–Line 576 are untranslated English strings, causing mixed-language UI in PT builds.

🤖 Prompt for 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.

In `@radio/src/translations/i18n/pt.h` around lines 573 - 576, Replace the
untranslated English defines with Portuguese equivalents for TR_KEY_LOCK_FMT,
TR_KEYS_LOCKED, TR_KEYS_LOCKED_FMT and TR_KEYS_UNLOCKED; keep the exact format
specifiers (%s+%s) and surrounding punctuation intact. For example, use
Portuguese phrases such as "Bloqueio de tecla (%s+%s mantidos)" for
TR_KEY_LOCK_FMT, "Teclas bloqueadas" for TR_KEYS_LOCKED, "Teclas bloqueadas
(%s+%s)" for TR_KEYS_LOCKED_FMT, and "Teclas desbloqueadas" for TR_KEYS_UNLOCKED
so the PT build shows consistent Portuguese UI.
radio/src/translations/i18n/se.h-575-578 (1)

575-578: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Localize new key-lock strings in Swedish file.

These new entries are still English ("Key lock", "Keys locked", "Keys unlocked"), so Swedish users will see mixed-language UI in the new feature path.

🤖 Prompt for 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.

In `@radio/src/translations/i18n/se.h` around lines 575 - 578, The Swedish
translation file still contains English literals for the new key-lock strings;
update the defines TR_KEY_LOCK_FMT, TR_KEYS_LOCKED, TR_KEYS_LOCKED_FMT, and
TR_KEYS_UNLOCKED to Swedish equivalents and preserve the formatting placeholders
(%s) exactly (e.g., translate "Key lock (%s+%s hold)" and "Keys locked (%s+%s)"
while keeping the %s tokens intact) so the UI shows fully localized Swedish
text.
radio/src/translations/i18n/tw.h-570-573 (1)

570-573: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Translate key-lock labels for Traditional Chinese locale.

The newly added key-lock strings are English, which causes inconsistent language in a user-visible flow for tw.h.

🤖 Prompt for 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.

In `@radio/src/translations/i18n/tw.h` around lines 570 - 573, The new key-lock
strings (TR_KEY_LOCK_FMT, TR_KEYS_LOCKED, TR_KEYS_LOCKED_FMT, TR_KEYS_UNLOCKED)
are still in English in the Traditional Chinese file; replace each English
string literal with the proper Traditional Chinese translations (e.g., translate
"Key lock (%s+%s hold)", "Keys locked", "Keys locked (%s+%s)", and "Keys
unlocked") so the tw.h locale is fully localized and consistent with surrounding
strings.
radio/src/translations/i18n/ua.h-574-577 (1)

574-577: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add Ukrainian translations for new key-lock strings.

TR_KEY_LOCK_FMT, TR_KEYS_LOCKED, TR_KEYS_LOCKED_FMT, and TR_KEYS_UNLOCKED are currently English, so the key-lock UX is partially untranslated in ua.h.

🤖 Prompt for 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.

In `@radio/src/translations/i18n/ua.h` around lines 574 - 577, The four macros
TR_KEY_LOCK_FMT, TR_KEYS_LOCKED, TR_KEYS_LOCKED_FMT, and TR_KEYS_UNLOCKED in
ua.h are still English; update their string values to Ukrainian translations
while preserving formatting/placeholders (e.g., "%s+%s" and surrounding
parentheses) and punctuation; locate the definitions for TR_KEY_LOCK_FMT,
TR_KEYS_LOCKED, TR_KEYS_LOCKED_FMT and TR_KEYS_UNLOCKED and replace the English
text with appropriate Ukrainian equivalents (keeping the exact format specifiers
and structure).
🤖 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 `@radio/src/gui/212x64/radio_setup.cpp`:
- Around line 617-630: The 24-byte static buffer lbl used in the
ITEM_RADIO_SETUP_KEY_LOCK case is too small and can truncate localized strings;
increase its size (e.g., static char lbl[80]) to safely hold STR_KEY_LOCK_FMT
plus key names returned by keysGetLabel, keeping the existing snprintf(lbl,
sizeof(lbl), STR_KEY_LOCK_FMT, ...) call and leaving the rest of the case
(ITEM_RADIO_SETUP_KEY_LOCK, keysGetLabel, g_eeGeneral.keyLockEnabled,
editCheckBox) unchanged.

In `@radio/src/gui/colorlcd/setup_menus/key_shortcuts.cpp`:
- Around line 91-101: The keyLockLabel buffer (currently 32 bytes) can be
overflowed by localized STR_KEY_LOCK_FMT plus key names; increase its size
(e.g., change keyLockLabel from 32 to a larger constant such as 128 or 256) to
match the longer buffers used elsewhere, keep using snprintf to format with
sizeof(keyLockLabel) for safety, and leave the surrounding code (keysGetLabel,
STR_KEY_LOCK_FMT, setupLine and the ToggleSwitch lambda) unchanged so the label
no longer gets truncated for long localized strings.

In `@radio/src/main.cpp`:
- Around line 291-331: The fixed-size 40-byte buffer lockedBuf in checkKeysLock
can be too small for localized STR_KEYS_LOCKED_FMT and may truncate text; change
the implementation to allocate a sufficiently large buffer (or use a
std::string) and format into it safely: replace static char lockedBuf[40] with a
larger constant (or dynamically sized buffer) sized to accommodate the longest
possible localized message, then call snprintf (or safer std::string formatting)
into that buffer and keep using lockedMsg = lockedBuf; ensure symbols referenced
are checkKeysLock, lockedBuf, STR_KEYS_LOCKED_FMT, and lockedMsg so the new
allocation is used wherever the message is displayed.

---

Minor comments:
In `@companion/src/generaledit/generalsetup.ui`:
- Around line 1329-1342: The new Key lock widgets (QLabel
name="label_keyLockEnabled" and QCheckBox name="chkKeyLockEnabled") are placed
at row="30" which collides with the existing verticalSpacer_2; move both widgets
to an unused row (for example row="31" or the next free row in the grid) so they
don't overlap the spacer, updating the row attributes for label_keyLockEnabled
and chkKeyLockEnabled in the UI XML to that free row.

In `@radio/src/translations/i18n/cn.h`:
- Around line 572-575: The four new English macro strings TR_KEY_LOCK_FMT,
TR_KEYS_LOCKED, TR_KEYS_LOCKED_FMT, and TR_KEYS_UNLOCKED need Chinese
translations so the locale is consistent; replace the English literals with
appropriate Chinese text (e.g., translate "Key lock (%s+%s hold)" and "Keys
locked/locked (%s+%s)/unlocked" into Chinese) keeping the existing format
specifiers intact and preserving the macro names in cn.h.

In `@radio/src/translations/i18n/cz.h`:
- Around line 575-578: Translate the four English macros into Czech while
keeping the macro names and placeholder formats intact: replace TR_KEY_LOCK_FMT
"Key lock (%s+%s hold)" with a Czech equivalent preserving (%s+%s), replace
TR_KEYS_LOCKED "Keys locked" and TR_KEYS_LOCKED_FMT "Keys locked (%s+%s)" with
Czech phrases (the formatted one must keep the %s+%s placeholders), and replace
TR_KEYS_UNLOCKED "Keys unlocked" with its Czech translation; ensure punctuation
and spacing remain consistent and no placeholders are altered.

In `@radio/src/translations/i18n/da.h`:
- Around line 577-580: The four new English macros (TR_KEY_LOCK_FMT,
TR_KEYS_LOCKED, TR_KEYS_LOCKED_FMT, TR_KEYS_UNLOCKED) must be replaced with
Danish translations to match the locale; update each macro value to Danish
equivalents (suggestions: TR_KEY_LOCK_FMT -> "Tastelås (%s+%s hold)",
TR_KEYS_LOCKED -> "Taster låst", TR_KEYS_LOCKED_FMT -> "Taster låst (%s+%s)",
TR_KEYS_UNLOCKED -> "Taster oplåst") by editing their string literals so the UI
displays Danish text.

In `@radio/src/translations/i18n/de.h`:
- Around line 573-576: Replace the English-only macro values with German
translations for the four keys: update TR_KEY_LOCK_FMT to a German phrase
equivalent to "Key lock (%s+%s hold)" (e.g., "Tasten sperren (%s+%s gedrückt
halten)"), TR_KEYS_LOCKED to "Tasten gesperrt" (or similar), TR_KEYS_LOCKED_FMT
to a formatted German equivalent like "Tasten gesperrt (%s+%s)", and
TR_KEYS_UNLOCKED to "Tasten entsperrt"; modify the macro definitions for
TR_KEY_LOCK_FMT, TR_KEYS_LOCKED, TR_KEYS_LOCKED_FMT and TR_KEYS_UNLOCKED in de.h
accordingly so the German UI shows localized text.

In `@radio/src/translations/i18n/es.h`:
- Around line 571-574: Replace the four English strings in the Spanish locale
with proper Spanish translations: update the macros TR_KEY_LOCK_FMT,
TR_KEYS_LOCKED, TR_KEYS_LOCKED_FMT, and TR_KEYS_UNLOCKED in es.h so they are
localized (for example use "Bloqueo de tecla (%s+%s mantenida)" or "Bloqueo de
tecla (%s+%s pulsadas)" for TR_KEY_LOCK_FMT, "Teclas bloqueadas" for
TR_KEYS_LOCKED, "Teclas bloqueadas (%s+%s)" for TR_KEYS_LOCKED_FMT, and "Teclas
desbloqueadas" for TR_KEYS_UNLOCKED), ensuring phrasing is consistent and
preserves the %s format placeholders.

In `@radio/src/translations/i18n/fi.h`:
- Around line 572-575: Replace the four English macro values with Finnish
translations: update TR_KEY_LOCK_FMT to "Avainlukko (%s+%s pidetään)",
TR_KEYS_LOCKED to "Avimet lukittu", TR_KEYS_LOCKED_FMT to "Avimet lukittu
(%s+%s)", and TR_KEYS_UNLOCKED to "Avimet avattu"; change the string literals
for the macros TR_KEY_LOCK_FMT, TR_KEYS_LOCKED, TR_KEYS_LOCKED_FMT, and
TR_KEYS_UNLOCKED accordingly so the Finnish locale file contains Finnish text.

In `@radio/src/translations/i18n/fr.h`:
- Around line 576-579: Replace the four English strings with French
translations: update the definitions for TR_KEY_LOCK_FMT, TR_KEYS_LOCKED,
TR_KEYS_LOCKED_FMT, and TR_KEYS_UNLOCKED to their French equivalents (e.g.,
"Verrouillage de la touche (%s+%s maintenu)", "Touches verrouillées", "Touches
verrouillées (%s+%s)", "Touches déverrouillées") so the labels appear translated
in the French UI; edit the string literals assigned to those symbols in-place.

In `@radio/src/translations/i18n/he.h`:
- Around line 576-579: Replace the English strings with Hebrew translations for
the four macros: TR_KEY_LOCK_FMT should be translated to a Hebrew phrase
conveying "Key lock (%s+%s hold)" (e.g., "נעילת מקש (החזקו %s+%s)"),
TR_KEYS_LOCKED to "מפתחות נעולים", TR_KEYS_LOCKED_FMT to "מפתחות נעולים
(%s+%s)", and TR_KEYS_UNLOCKED to "מפתחות לא נעולים". Update the definitions for
TR_KEY_LOCK_FMT, TR_KEYS_LOCKED, TR_KEYS_LOCKED_FMT, and TR_KEYS_UNLOCKED in the
Hebrew locale file accordingly.

In `@radio/src/translations/i18n/it.h`:
- Around line 573-576: The listed translation keys (TR_KEY_LOCK_FMT,
TR_KEYS_LOCKED, TR_KEYS_LOCKED_FMT, TR_KEYS_UNLOCKED) are still in English;
replace their string values with Italian equivalents for consistent
localization: set TR_KEY_LOCK_FMT to an Italian phrase conveying "Key lock
(%s+%s hold)" (e.g., "Blocco tasti (%s+%s tieni premuto)"), TR_KEYS_LOCKED to
"Tasti bloccati", TR_KEYS_LOCKED_FMT to "Tasti bloccati (%s+%s)", and
TR_KEYS_UNLOCKED to "Tasti sbloccati"; update these definitions in it.h where
those macros are declared.

In `@radio/src/translations/i18n/jp.h`:
- Around line 572-575: Replace the English-only macros with Japanese
translations in the jp.h header: update TR_KEY_LOCK_FMT, TR_KEYS_LOCKED,
TR_KEYS_LOCKED_FMT, and TR_KEYS_UNLOCKED to Japanese strings while preserving
all format specifiers and punctuation (e.g., keep "%s+%s" in TR_KEY_LOCK_FMT and
TR_KEYS_LOCKED_FMT). Ensure the Japanese wording fits UI context for "Key lock
(X+Y hold)", "Keys locked", "Keys locked (X+Y)", and "Keys unlocked", and keep
the macro names and surrounding formatting unchanged.

In `@radio/src/translations/i18n/ko.h`:
- Around line 582-585: The Korean translation file contains English literals for
key-lock UI keys; update the defines TR_KEY_LOCK_FMT, TR_KEYS_LOCKED,
TR_KEYS_LOCKED_FMT, and TR_KEYS_UNLOCKED in ko.h to Korean equivalents to avoid
mixed-language feedback — e.g. replace with Korean phrases like: TR_KEY_LOCK_FMT
-> 키 잠금 (%s+%s 누르고 유지), TR_KEYS_LOCKED -> 키 잠김, TR_KEYS_LOCKED_FMT -> 키 잠김
(%s+%s), and TR_KEYS_UNLOCKED -> 키 잠금 해제 (adjust wording if you prefer
alternative Korean phrasing).

In `@radio/src/translations/i18n/nl.h`:
- Around line 574-577: The strings TR_KEY_LOCK_FMT, TR_KEYS_LOCKED,
TR_KEYS_LOCKED_FMT, and TR_KEYS_UNLOCKED are still in English; replace their
values with Dutch translations so the UI is consistent (e.g., translate "Key
lock (%s+%s hold)" and "Keys locked/unlocked" and the formatted variants into
appropriate Dutch phrases), updating the definitions for those macros in the
translations file where they are declared.

In `@radio/src/translations/i18n/pl.h`:
- Around line 572-575: Lines define English key-lock strings; replace them with
Polish translations: change TR_KEY_LOCK_FMT to a Polish phrase like "Blokada
klawisza (%s+%s przytrzymane)", update TR_KEYS_LOCKED to "Klawisze zablokowane",
TR_KEYS_LOCKED_FMT to "Klawisze zablokowane (%s+%s)", and TR_KEYS_UNLOCKED to
"Klawisze odblokowane" so the Polish locale is consistent with the new key-lock
flow.

In `@radio/src/translations/i18n/pt.h`:
- Around line 573-576: Replace the untranslated English defines with Portuguese
equivalents for TR_KEY_LOCK_FMT, TR_KEYS_LOCKED, TR_KEYS_LOCKED_FMT and
TR_KEYS_UNLOCKED; keep the exact format specifiers (%s+%s) and surrounding
punctuation intact. For example, use Portuguese phrases such as "Bloqueio de
tecla (%s+%s mantidos)" for TR_KEY_LOCK_FMT, "Teclas bloqueadas" for
TR_KEYS_LOCKED, "Teclas bloqueadas (%s+%s)" for TR_KEYS_LOCKED_FMT, and "Teclas
desbloqueadas" for TR_KEYS_UNLOCKED so the PT build shows consistent Portuguese
UI.

In `@radio/src/translations/i18n/ru.h`:
- Around line 575-578: Replace the English values for the macros
TR_KEY_LOCK_FMT, TR_KEYS_LOCKED, TR_KEYS_LOCKED_FMT, and TR_KEYS_UNLOCKED with
Russian translations, preserving the exact format specifiers and punctuation
(e.g., keep "%s+%s" and surrounding parentheses/quotes). For example use Russian
phrases like "Блокировка клавиш (%s+%s удерживать)" for TR_KEY_LOCK_FMT,
"Клавиши заблокированы" for TR_KEYS_LOCKED, "Клавиши заблокированы (%s+%s)" for
TR_KEYS_LOCKED_FMT, and "Клавиши разблокированы" for TR_KEYS_UNLOCKED; ensure
you only change the string literals and not the macro names or formatting
tokens.

In `@radio/src/translations/i18n/se.h`:
- Around line 575-578: The Swedish translation file still contains English
literals for the new key-lock strings; update the defines TR_KEY_LOCK_FMT,
TR_KEYS_LOCKED, TR_KEYS_LOCKED_FMT, and TR_KEYS_UNLOCKED to Swedish equivalents
and preserve the formatting placeholders (%s) exactly (e.g., translate "Key lock
(%s+%s hold)" and "Keys locked (%s+%s)" while keeping the %s tokens intact) so
the UI shows fully localized Swedish text.

In `@radio/src/translations/i18n/tw.h`:
- Around line 570-573: The new key-lock strings (TR_KEY_LOCK_FMT,
TR_KEYS_LOCKED, TR_KEYS_LOCKED_FMT, TR_KEYS_UNLOCKED) are still in English in
the Traditional Chinese file; replace each English string literal with the
proper Traditional Chinese translations (e.g., translate "Key lock (%s+%s
hold)", "Keys locked", "Keys locked (%s+%s)", and "Keys unlocked") so the tw.h
locale is fully localized and consistent with surrounding strings.

In `@radio/src/translations/i18n/ua.h`:
- Around line 574-577: The four macros TR_KEY_LOCK_FMT, TR_KEYS_LOCKED,
TR_KEYS_LOCKED_FMT, and TR_KEYS_UNLOCKED in ua.h are still English; update their
string values to Ukrainian translations while preserving formatting/placeholders
(e.g., "%s+%s" and surrounding parentheses) and punctuation; locate the
definitions for TR_KEY_LOCK_FMT, TR_KEYS_LOCKED, TR_KEYS_LOCKED_FMT and
TR_KEYS_UNLOCKED and replace the English text with appropriate Ukrainian
equivalents (keeping the exact format specifiers and structure).
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 08e118f2-e70c-460b-a569-47d1267e396a

📥 Commits

Reviewing files that changed from the base of the PR and between 00d7544 and d5a7e9b.

📒 Files selected for processing (63)
  • companion/src/firmwares/edgetx/yaml_generalsettings.cpp
  • companion/src/firmwares/generalsettings.h
  • companion/src/generaledit/generalsetup.cpp
  • companion/src/generaledit/generalsetup.h
  • companion/src/generaledit/generalsetup.ui
  • radio/src/datastructs.h
  • radio/src/datastructs_private.h
  • radio/src/gui/128x64/radio_setup.cpp
  • radio/src/gui/212x64/radio_setup.cpp
  • radio/src/gui/colorlcd/setup_menus/key_shortcuts.cpp
  • radio/src/gui/common/stdlcd/feature_control.h
  • radio/src/keys.cpp
  • radio/src/keys.h
  • radio/src/main.cpp
  • radio/src/storage/yaml/yaml_datastructs_128x64.cpp
  • radio/src/storage/yaml/yaml_datastructs_f16.cpp
  • radio/src/storage/yaml/yaml_datastructs_gx12.cpp
  • radio/src/storage/yaml/yaml_datastructs_nb4p.cpp
  • radio/src/storage/yaml/yaml_datastructs_nv14.cpp
  • radio/src/storage/yaml/yaml_datastructs_pa01.cpp
  • radio/src/storage/yaml/yaml_datastructs_pl18.cpp
  • radio/src/storage/yaml/yaml_datastructs_pl18u.cpp
  • radio/src/storage/yaml/yaml_datastructs_st16.cpp
  • radio/src/storage/yaml/yaml_datastructs_t15.cpp
  • radio/src/storage/yaml/yaml_datastructs_t15pro.cpp
  • radio/src/storage/yaml/yaml_datastructs_t20.cpp
  • radio/src/storage/yaml/yaml_datastructs_tpro.cpp
  • radio/src/storage/yaml/yaml_datastructs_tx15.cpp
  • radio/src/storage/yaml/yaml_datastructs_tx16smk3.cpp
  • radio/src/storage/yaml/yaml_datastructs_x10.cpp
  • radio/src/storage/yaml/yaml_datastructs_x9d.cpp
  • radio/src/storage/yaml/yaml_datastructs_x9dp2019.cpp
  • radio/src/storage/yaml/yaml_datastructs_x9e.cpp
  • radio/src/storage/yaml/yaml_datastructs_xlite.cpp
  • radio/src/storage/yaml/yaml_datastructs_xlites.cpp
  • radio/src/targets/horus/hal.h
  • radio/src/targets/stm32h7s78-dk/hal.h
  • radio/src/targets/t15pro/hal.h
  • radio/src/targets/taranis/hal.h
  • radio/src/targets/tx15/hal.h
  • radio/src/targets/tx16smk3/hal.h
  • radio/src/tests/keys_lock.cpp
  • radio/src/translations/i18n/cn.h
  • radio/src/translations/i18n/cz.h
  • radio/src/translations/i18n/da.h
  • radio/src/translations/i18n/de.h
  • radio/src/translations/i18n/en.h
  • radio/src/translations/i18n/es.h
  • radio/src/translations/i18n/fi.h
  • radio/src/translations/i18n/fr.h
  • radio/src/translations/i18n/he.h
  • radio/src/translations/i18n/it.h
  • radio/src/translations/i18n/jp.h
  • radio/src/translations/i18n/ko.h
  • radio/src/translations/i18n/nl.h
  • radio/src/translations/i18n/pl.h
  • radio/src/translations/i18n/pt.h
  • radio/src/translations/i18n/ru.h
  • radio/src/translations/i18n/se.h
  • radio/src/translations/i18n/tw.h
  • radio/src/translations/i18n/ua.h
  • radio/src/translations/sim_string_list.h
  • radio/src/translations/string_list.h

Comment thread radio/src/gui/212x64/radio_setup.cpp
Comment thread radio/src/gui/colorlcd/setup_menus/key_shortcuts.cpp
Comment thread radio/src/main.cpp
Copy link
Copy Markdown

@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

♻️ Duplicate comments (1)
radio/src/main.cpp (1)

297-297: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Buffer size increased but may still be insufficient for all languages.

The buffer was increased from 40 to 45 bytes, which improves on the previous implementation. However, localized STR_KEYS_LOCKED_FMT strings in verbose languages combined with key names could still exceed 45 bytes. The previous review recommended 80 bytes to ensure no truncation occurs across all supported translations.

🌐 Recommended buffer size for robust i18n support
-    static char lockedBuf[45];
+    static char lockedBuf[80];
🤖 Prompt for 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.

In `@radio/src/main.cpp` at line 297, The fixed-size buffer lockedBuf (currently
declared as "static char lockedBuf[45]") may still overflow for verbose
localized STR_KEYS_LOCKED_FMT strings; increase the buffer to a safe size (e.g.,
80 bytes) or, better, replace the static C buffer usage with a dynamic/resizable
string approach and ensure all formatting uses snprintf/strncpy or std::string
to prevent truncation; update references where lockedBuf and STR_KEYS_LOCKED_FMT
are used so formatting calls pass the new size or use
std::string::sprintf-equivalent to build the final message safely.
🤖 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 `@radio/src/gui/colorlcd/setup_menus/key_shortcuts.cpp`:
- Line 92: The fixed-size buffer keyLockLabel (currently declared as static char
keyLockLabel[45]) can still overflow for some localized STR_KEY_LOCK_FMT
strings; change its size to at least 80 bytes (e.g., static char
keyLockLabel[80]) and ensure all uses that write into keyLockLabel (calls that
format STR_KEY_LOCK_FMT with key names) use snprintf or equivalent with the new
buffer size to avoid truncation; alternatively replace keyLockLabel with a
std::string and format into it to fully eliminate fixed-size buffer risks.

---

Duplicate comments:
In `@radio/src/main.cpp`:
- Line 297: The fixed-size buffer lockedBuf (currently declared as "static char
lockedBuf[45]") may still overflow for verbose localized STR_KEYS_LOCKED_FMT
strings; increase the buffer to a safe size (e.g., 80 bytes) or, better, replace
the static C buffer usage with a dynamic/resizable string approach and ensure
all formatting uses snprintf/strncpy or std::string to prevent truncation;
update references where lockedBuf and STR_KEYS_LOCKED_FMT are used so formatting
calls pass the new size or use std::string::sprintf-equivalent to build the
final message safely.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b4f04ea3-0ec9-4c8a-8e31-92b34943fc68

📥 Commits

Reviewing files that changed from the base of the PR and between d5a7e9b and 8a8d841.

📒 Files selected for processing (2)
  • radio/src/gui/colorlcd/setup_menus/key_shortcuts.cpp
  • radio/src/main.cpp

Comment thread radio/src/gui/colorlcd/setup_menus/key_shortcuts.cpp
@3djc 3djc added enhancement ✨ New feature or request backport/2.12 To be backported to a 2.12 release also. labels May 23, 2026
Copy link
Copy Markdown

@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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@radio/src/keys.h`:
- Around line 28-30: The unconditional include of hal_keys_lock.h in keys.h
breaks non-radio builds; fix by either (A) wrapping the include in a radio-only
feature guard (e.g. `#if` defined(RADIO_FIRMWARE) ... `#endif`) so only radio
firmware builds pull in hal_keys_lock.h, or (B) add a minimal stub
hal_keys_lock.h for simulator/companion builds (e.g.,
radio/src/targets/simu/hal_keys_lock.h with empty declarations) and ensure the
simulator build can find it; also guard or stub any usages of the hal_keys_lock
symbols referenced later in keys.h (the key-lock-related functions/definitions
that depend on hal_keys_lock.h) so non-radio builds compile cleanly.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: db175f10-e736-40b0-b584-c07795dcedb1

📥 Commits

Reviewing files that changed from the base of the PR and between 961df15 and a737f6e.

📒 Files selected for processing (53)
  • companion/src/firmwares/boardjson.cpp
  • companion/src/firmwares/boardjson.h
  • companion/src/generaledit/generalsetup.cpp
  • radio/src/CMakeLists.txt
  • radio/src/boards/generic_stm32/CMakeLists.txt
  • radio/src/boards/hw_defs/boxer.json
  • radio/src/boards/hw_defs/bumblebee.json
  • radio/src/boards/hw_defs/commando8.json
  • radio/src/boards/hw_defs/f16.json
  • radio/src/boards/hw_defs/gx12.json
  • radio/src/boards/hw_defs/lr3pro.json
  • radio/src/boards/hw_defs/mt12.json
  • radio/src/boards/hw_defs/pocket.json
  • radio/src/boards/hw_defs/t12.json
  • radio/src/boards/hw_defs/t12max.json
  • radio/src/boards/hw_defs/t14.json
  • radio/src/boards/hw_defs/t15.json
  • radio/src/boards/hw_defs/t15pro.json
  • radio/src/boards/hw_defs/t16.json
  • radio/src/boards/hw_defs/t18.json
  • radio/src/boards/hw_defs/t20.json
  • radio/src/boards/hw_defs/t20v2.json
  • radio/src/boards/hw_defs/t8.json
  • radio/src/boards/hw_defs/tlite.json
  • radio/src/boards/hw_defs/tpro.json
  • radio/src/boards/hw_defs/tpros.json
  • radio/src/boards/hw_defs/tprov2.json
  • radio/src/boards/hw_defs/tx12.json
  • radio/src/boards/hw_defs/tx12mk2.json
  • radio/src/boards/hw_defs/tx15.json
  • radio/src/boards/hw_defs/tx16s.json
  • radio/src/boards/hw_defs/tx16smk3.json
  • radio/src/boards/hw_defs/v16.json
  • radio/src/boards/hw_defs/x10.json
  • radio/src/boards/hw_defs/x10express.json
  • radio/src/boards/hw_defs/x12s.json
  • radio/src/boards/hw_defs/x7.json
  • radio/src/boards/hw_defs/x7access.json
  • radio/src/boards/hw_defs/x9d+.json
  • radio/src/boards/hw_defs/x9d+2019.json
  • radio/src/boards/hw_defs/x9d.json
  • radio/src/boards/hw_defs/x9e.json
  • radio/src/boards/hw_defs/x9lite.json
  • radio/src/boards/hw_defs/x9lites.json
  • radio/src/boards/hw_defs/zorro.json
  • radio/src/keys.h
  • radio/src/targets/horus/hal.h
  • radio/src/targets/t15pro/hal.h
  • radio/src/targets/taranis/hal.h
  • radio/src/targets/tx15/hal.h
  • radio/src/targets/tx16smk3/hal.h
  • radio/util/hw_defs/generator.py
  • radio/util/hw_defs/models.py
💤 Files with no reviewable changes (5)
  • radio/src/targets/taranis/hal.h
  • radio/src/targets/t15pro/hal.h
  • radio/src/targets/tx15/hal.h
  • radio/src/targets/horus/hal.h
  • radio/src/targets/tx16smk3/hal.h
✅ Files skipped from review due to trivial changes (6)
  • radio/src/boards/hw_defs/mt12.json
  • radio/src/boards/hw_defs/t14.json
  • radio/src/boards/hw_defs/gx12.json
  • radio/src/boards/hw_defs/x9lite.json
  • radio/src/boards/hw_defs/t15pro.json
  • radio/src/boards/hw_defs/x12s.json

Comment thread radio/src/keys.h Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/2.12 To be backported to a 2.12 release also. enhancement ✨ New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable/Disable Buttons on the radio with a switch NoKeys

1 participant