Skip to content

Add advanced repeater settings controls to repeater screen#238

Open
Specter242 wants to merge 4 commits intozjs81:mainfrom
Specter242:codex/repeater-advanced-settings
Open

Add advanced repeater settings controls to repeater screen#238
Specter242 wants to merge 4 commits intozjs81:mainfrom
Specter242:codex/repeater-advanced-settings

Conversation

@Specter242
Copy link
Copy Markdown
Contributor

Summary

Adds an advanced settings section to the repeater settings screen and wires refresh actions for the new controls.

Scope

  • lib/screens/repeater_settings_screen.dart
    • Add advanced repeater settings controls and related refresh actions.
  • lib/l10n/app_en.arb
    • Add new English string keys for advanced repeater settings labels/actions.
  • lib/l10n/app_localizations*.dart
    • Add generated localization accessors/implementations for the new keys across locales.

Included Controls

  • Interference threshold
  • AGC reset interval
  • Flood max hops
  • Multi ACKs

Validation

  • flutter analyze lib/screens/repeater_settings_screen.dart lib/l10n/app_localizations.dart lib/l10n/app_localizations_zh.dart (pass)

Issue

Refs #237

Add firmware tuning controls to repeater settings screen:
- Interference Threshold (int.thresh) with dB input
- AGC Reset Interval (agc.reset.interval) in seconds
- Flood Max Hops (flood.max)
- Multi ACKs toggle (multi.acks)
All settings use CLI commands via buildSendCliCommandFrame.
Each field has individual refresh and a section-level refresh.
Add 15 localization keys for labels, helpers, and tooltips.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 23d043db67

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@just-stuff-tm
Copy link
Copy Markdown
Contributor

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7f38c9f358

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +732 to +734
final intThresh = int.tryParse(_intThreshController.text.trim());
if (intThresh != null) {
commands.add('set int.thresh $intThresh');
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid sending default advanced values on unrelated saves

_intThreshController and _floodMaxController are initialized with defaults (14 and 4), and _saveSettings unconditionally appends set int.thresh/set flood.max whenever parsing succeeds; this means changing an unrelated field (like name/password) will also overwrite any existing device-specific advanced values if the user has not first refreshed or edited these controls. Please gate these commands behind a hydrated/touched check (as done for multi.acks) or leave the controllers unset until fetched.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

@just-stuff-tm just-stuff-tm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Findings

  • _intThreshController defaults to 14 and _floodMaxController defaults to 4.
    _saveSettings() always sends them if they are parseable. Opening settings and saving unrelated fields can unintentionally reset device values.

  • Every refresh clears and reuses the single _fetchedSettings map.
    If the user triggers multiple refresh actions quickly, one refresh can clear data while another is still collecting.

  • Save-path validation for new numeric advanced fields is weaker than fetch-path validation.

    Fetch validation enforces a non-negative integer format, but save only performs int.tryParse and sends the value directly. Invalid or negative pasted values can still be transmitted.


  • Regenerate Localization dart files after running translate.py

Please fix these so upstream can merge... Thank You

final TextEditingController _agcResetIntervalController =
TextEditingController();
final TextEditingController _floodMaxController = TextEditingController(
text: '4',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking: _saveSettings() always emits set int.thresh and set flood.max because the controllers are pre-seeded (14/4). This can overwrite existing repeater values even when user did not touch advanced settings. Please gate these like multi.acks (hydrate/touched flags) or initialize empty and only send when user changed or after successful fetch.

"repeater_refreshInterferenceThreshold": "Refresh interference threshold",
"repeater_refreshAgcResetInterval": "Refresh AGC reset interval",
"repeater_refreshFloodMaxHops": "Refresh flood max hops",
"repeater_refreshMultiAcks": "Refresh multi ACKs",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please regenerate locale translations before merge. The generated locale files currently contain English fallback text for new repeater advanced settings keys.

Steps to fix:

  1. Ensure Ollama is running and pull the expected model:
ollama pull translategemma:latest
  1. Translate missing keys from app_en.arb into all locale ARBs:
python3 tools/translate.py --in lib/l10n/app_en.arb --l10n-dir lib/l10n --missing-only
  1. Regenerate localization Dart files:
flutter gen-l10n

@zjs81
Copy link
Copy Markdown
Owner

zjs81 commented Mar 7, 2026

We need to modify the repeater settings so it only sends modified fields.

@Specter242
Copy link
Copy Markdown
Contributor Author

I'll work on this in the next few days. I'm on a job for the moment.

@Specter242
Copy link
Copy Markdown
Contributor Author

Addressed the requested follow-ups in 8954379.

Changes included:

  • repeater settings now only send fields modified in the current session
  • removed default advanced-value overwrites and gated saves behind actual dirty state
  • isolated refresh fetch state per request to avoid cross-refresh races
  • tightened numeric validation on save for the advanced fields and TX power
  • updated locale ARBs, regenerated l10n files, and cleared the stale untranslated report

Verification:

  • flutter gen-l10n
  • flutter analyze lib/screens/repeater_settings_screen.dart lib/l10n/app_localizations.dart lib/l10n/app_localizations_zh.dart

@Specter242
Copy link
Copy Markdown
Contributor Author

The remaining failed check is the workflow's test step, and it appears to be an existing upstream failure rather than something introduced by this branch.

Current PR failure:

  • / on March 15, 2026 at 03:14 UTC
  • 5 failing tests in
  • failures are for and the related follow-on errors

Same failure is already present on :

  • workflow run on March 15, 2026 at 01:49 UTC
  • same 5 failures in

So the PR-specific changes are pushed and green on build targets, but the shared TCP test failure is still blocking the check.

@Specter242
Copy link
Copy Markdown
Contributor Author

The remaining failed check is the Flutter and Dart workflow's test step, and it appears to be an existing upstream failure rather than something introduced by this branch.

Current PR failure:

  • analyze / Run tests on March 15, 2026 at 03:14 UTC
  • 5 failing tests in test/screens/tcp_flow_test.dart
  • failures are ProviderNotFoundException for AppSettingsService and the related Bad state: No element follow-on errors

Same failure is already present on main:

  • workflow run 23100927800 on March 15, 2026 at 01:49 UTC
  • same 5 failures in test/screens/tcp_flow_test.dart

So the PR-specific changes are pushed and green on build targets, but the shared TCP test failure is still blocking the Flutter and Dart check.

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.

3 participants