Skip to content

Add advanced repeater settings controls to repeater screen#238

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

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

Conversation

@Specter242
Copy link
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

@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
Contributor

@codex review

Copy link

@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');

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

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.

2 participants