Skip to content

fix: Settings — Cancel and Save as two equal halves, 6dp after a radio's text (2.27.2) - #293

Merged
compot-dev merged 1 commit into
v2from
fix/brass-settings-292
Nov 20, 2026
Merged

compot-dev merged 1 commit into
v2from
fix/brass-settings-292

Conversation

@compot-dev

Copy link
Copy Markdown
Collaborator

Closes #292. Two brass rules found missed in the 2.27.1 Settings dialog by the brand review.

  • Buttons: Brass.halves() reuses the dialog's button bar: Cancel left, Save right, two equal halves (weight 1, 6dp margins, as camex 4.3.1). On Android TV the bar put Save first and packed both to the left. Only the Settings dialog uses it.
  • Radio buttons and check boxes: 6dp padding after the text too, so the Proto UDP text no longer touches the TCP ring and the TCP focus ring no longer lies on its last letter.
  • Version 2.27.2 (versionCode 65), CHANGELOG.

Checked:

  • Docker compot/android:2026.10: testDebugUnitTest lintDebug assembleDebug, lint 13 warnings as the baseline.
  • Android TV 16 emulator: screenshots show CANCEL | SAVE as equal halves across the window, and TCP focused with the ring clear of the text.
  • tests/e2e.sh TRANSPORT=TCP: API 21 20/20, API 34 20/20.

…o's text (2.27.2)

Brass rules the brand review found missed in 2.27.1 (#292): on Android TV the dialog's
buttons were small, packed left and in the order Save, Cancel; the Proto radios had no
space after the text, so the TCP focus ring lay on its last letter.

Closes #292
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Fix Settings dialog button layout and control spacing

🐞 Bug fix 🕐 10-20 Minutes

Grey Divider

AI Description

• Place Cancel and Save in equal-width halves, in the correct order on Android TV.
• Add trailing padding to check boxes and radio buttons so text clears adjacent focus rings.
• Release the fix as 2.27.2 with a changelog entry.
Merge Risk 🟡 Medium

Blast radius 🟡 Medium 💥 2 capabilities

  • 2 affected capabilities within one bounded functional scope: application_settings_ui.
  • The changed shared Brass.styleTree path is called by the camera configuration dialog, and its RadioButton/CheckBox controls are styled through the same dialog presentation subsystem.
  • This is a distinct user outcome from network configuration, but both are bounded application settings UI behaviors rather than independent deployment or storage domains.
  • The Network settings dialog is a second bounded settings operation in the same application settings UI scope.
  • Its controls use the shared Brass styling, and its own shown-dialog callback explicitly invokes halves, so the path includes both shared control spacing and Network-specific action-button layout.
Sources

android/app/src/main/java/com/openipc/decoder/Brass.java[233-239]

            b.setButtonDrawable(b instanceof android.widget.RadioButton
                    ? R.drawable.brass_radio : R.drawable.brass_check);
            int pad = Math.round(6 * dp(c));
            // 6dp before the text and 6dp after it: the focus ring of a box as wide as its text
            // would lie on its last letter, and a radio's text would touch the next ring (#292)
            b.setPadding(Math.max(b.getPaddingLeft(), pad), b.getPaddingTop(),
                    Math.max(b.getPaddingRight(), pad), b.getPaddingBottom());

android/app/src/main/java/com/openipc/decoder/MenuManager.java[662-664]

        Brass.frame(dialog);
        dialog.show();
        Brass.style(dialog);
Behavioral complexity 🟡 Medium 🧩 Interacting branches

  • Before: brass dialogs used the existing button-bar arrangement and compound-button padding.
  • After: when both action buttons share a LinearLayout, the code hides all other children, removes and re-adds Cancel then Save with equal weights and margins; compound buttons also gain a minimum trailing pad.
  • New correctness condition: the dialog must preserve both action buttons, their click behavior, focus/navigation usability, and valid layout semantics across the existing child-order and parent-layout variants, while leaving unsupported structures unchanged.
  • The branch and ordering invariant are newly introduced by this PR; the underlying view APIs and dialog callbacks are reused rather than introducing a new algorithm or persistence protocol.
Sources

android/app/src/main/java/com/openipc/decoder/Brass.java[233-239]

            b.setButtonDrawable(b instanceof android.widget.RadioButton
                    ? R.drawable.brass_radio : R.drawable.brass_check);
            int pad = Math.round(6 * dp(c));
            // 6dp before the text and 6dp after it: the focus ring of a box as wide as its text
            // would lie on its last letter, and a radio's text would touch the next ring (#292)
            b.setPadding(Math.max(b.getPaddingLeft(), pad), b.getPaddingTop(),
                    Math.max(b.getPaddingRight(), pad), b.getPaddingBottom());
Potential damage 🟢 Low 🩹 Cosmetic

  • The plausible consequence is an incorrect or confusing visual presentation: spacing, focus rings, or Cancel/Save placement may be wrong, and an affected user may need to close and reopen the dialog or use another input path.
  • The changed code does not write settings, alter network state, start or stop the tunnel, or create external effects; those actions remain in the existing NetworkPanel click listener after validation.
  • Reverting the app restores the source layout, while reopening the dialog reconstructs the in-memory views.
  • Equal business-importance baseline is used for both capabilities; no business-criticality declaration was supplied.
  • Reversible by closing and reopening the dialog or installing a corrected build.
  • No persistent state repair, first-write adoption, migration, or external compensation is required.
Sources

android/app/src/main/java/com/openipc/decoder/Brass.java[233-239]

            b.setButtonDrawable(b instanceof android.widget.RadioButton
                    ? R.drawable.brass_radio : R.drawable.brass_check);
            int pad = Math.round(6 * dp(c));
            // 6dp before the text and 6dp after it: the focus ring of a box as wide as its text
            // would lie on its last letter, and a radio's text would touch the next ring (#292)
            b.setPadding(Math.max(b.getPaddingLeft(), pad), b.getPaddingTop(),
                    Math.max(b.getPaddingRight(), pad), b.getPaddingBottom());

android/app/src/main/java/com/openipc/decoder/MenuManager.java[662-664]

        Brass.frame(dialog);
        dialog.show();
        Brass.style(dialog);
Assessed commit 19e2588
Diagram

graph TD
  Settings["Settings dialog"] --> Style["Brass.style"] --> Controls["Padded controls"]
  Settings --> Halves["Brass.halves"] --> Bar["Equal button bar"]
Loading
High-Level Assessment

Reusing the existing AlertDialog button bar keeps its button behavior while limiting the layout change to Settings. A separate custom action row would add complexity without a clear benefit for this focused fix.

Files changed (4) +48 / -4

Bug fix (2) +38 / -2
Brass.javaAdd equal-half dialog actions and trailing control padding +37/-2

Add equal-half dialog actions and trailing control padding

• Adds a helper that reorders Cancel and Save in the existing button bar and gives each equal width with 6dp margins. Shared brass styling now preserves at least 6dp of right padding on check boxes and radio buttons.

android/app/src/main/java/com/openipc/decoder/Brass.java

NetworkPanel.javaApply equal-half actions to Settings +1/-0

Apply equal-half actions to Settings

• Calls the new button-bar helper after styling the shown Settings dialog, keeping the action layout change scoped to that dialog.

android/app/src/main/java/com/openipc/decoder/NetworkPanel.java

Documentation (1) +8 / -0
CHANGELOG.mdDocument the 2.27.2 Settings fixes +8/-0

Document the 2.27.2 Settings fixes

• Adds a release entry describing the corrected button order and widths, and the added spacing around check-box and radio-button text.

CHANGELOG.md

Other (1) +2 / -2
build.gradleBump the Android app to 2.27.2 +2/-2

Bump the Android app to 2.27.2

• Increments versionCode from 64 to 65 and versionName from 2.27.1 to 2.27.2.

android/app/build.gradle

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can turn on the rule miner and Qodo learns your standards from review history

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@compot-dev
compot-dev merged commit 47b0842 into v2 Nov 20, 2026
7 checks passed
@compot-dev
compot-dev deleted the fix/brass-settings-292 branch November 20, 2026 17:44
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: 6dp after radio text; Cancel and Save as two equal halves (brass)

1 participant