refactor(settings): consolidate dialog guard flags and widget construction (#878)

* refactor(settings): consolidate dialog guard flags and widget construction

The settings dialog grew the same work in several places. This gathers
the shared pieces into module helpers with no behavior change:

- _suppressed(): a context manager for the try/finally flag dance the
  handlers used to open-code for _populating_models,
  _processing_language_change, _simple_syncing, and _simple_driving.
  The apply-guard handoff and the nested resync keep their explicit
  save/restore because they do not fit a lexical block.
- _handlers_suppressed(): one name for the
  "initializing or applying" check every handler repeated on entry.
- _set_no_show_all_visible(): the clear-flag / show / re-arm sequence
  for rows created hidden, used by the second-language row and the
  custom-shortcut row.
- _add_switch_row(), _combo_chrome(), _new_spin(),
  _connect_picker_entry(): the repeated switch-row, tooltip +
  scroll-guard, spin-button, and picker-entry wiring.
- _undownloaded_model_info() and _make_download_dialog(): the
  per-engine download gate both apply paths carried verbatim.

Flags stay plain booleans and helpers stay module-level so existing
tests keep working unchanged.

* fix(settings): annotate download dialog builder and align visibility docs

---------

Co-authored-by: Jatin K Malik <jatinkrmalik@gmail.com>
This commit is contained in:
devin-ai-integration[bot]
2026-09-29 22:59:18 -07:00
committed by GitHub
co-authored by Jatin K Malik
parent ba721779c3
commit 004696bbe0
2 changed files with 427 additions and 442 deletions
File diff suppressed because it is too large Load Diff