Skip to content

feat(tui): connection knobs in the Settings modal with hot-apply#54

Merged
lance0 merged 1 commit into
masterfrom
feat/settings-connection-parity
Jun 21, 2026
Merged

feat(tui): connection knobs in the Settings modal with hot-apply#54
lance0 merged 1 commit into
masterfrom
feat/settings-connection-parity

Conversation

@lance0

@lance0 lance0 commented Jun 21, 2026

Copy link
Copy Markdown
Owner

Final item of the Settings-parity work. Adds a Connection category to the Config modal's Settings section exposing the active profile's page_size, timeout_secs, and exclude_config_context, seeded from the live profile.

Behavior

  • Saving a change persists it to the active profile (format-preserving, reusing persist_profile) and reconnects through the existing switch path so it hot-applies — the client bakes these at construction.
  • An unchanged connection ⇒ no reconnect, just the plain "settings saved" (the existing [ui]/cache path is untouched).
  • Widgets reuse existing Settings patterns: page_size/timeout_secs are numeric text fields (like refresh_secs); exclude_config_context is a Left/Right/Space toggle (like cache on/off).
  • The profile editor stays the place to manage any profile; Settings is the quick-tweak surface for the active one.

Deferred (tracked on ROADMAP)

The per-surface api backends (vrf/route_target) as Settings cycles — already editable in the profile editor (Ctrl+B/Ctrl+R), so low marginal value.

Tests

New: Connection-category seeding, the exclude toggle, non-numeric page_size validation, and an end-to-end save that persists page_size to the active profile + emits a reconnect. Updated the two settings-save tests + the category-navigation test for the new category order.

Gate

fmt ✓ · clippy --all-features ✓ · clippy --no-default-features ✓ · tests ✓ (948 / 853).

Add a Connection category to the Config modal's Settings section exposing the
ACTIVE profile's page_size, timeout_secs, and exclude_config_context, seeded
from the live profile. Saving a change persists it to that profile
(format-preserving, reusing persist_profile) and reconnects through the existing
switch path so it hot-applies — the client bakes these at construction. An
unchanged connection ⇒ no reconnect, just the plain "settings saved".

The widgets reuse existing Settings patterns: page_size/timeout_secs are numeric
text fields (like refresh_secs), exclude_config_context is a Left/Right/Space
toggle (like the cache on/off). The profile editor stays the place to manage any
profile; Settings is the quick-tweak surface for the active one.

Deferred: the per-surface api backends (vrf/route_target) as Settings cycles —
already editable in the profile editor (Ctrl+B/Ctrl+R), low marginal value;
tracked on the ROADMAP.

Tests: Connection category seeding, the exclude toggle, non-numeric page_size
validation, and an end-to-end save that persists page_size to the active profile
+ emits a reconnect; updated the two settings-save tests + the category-nav test
for the new category order.
@lance0 lance0 merged commit 0d4a694 into master Jun 21, 2026
4 checks passed
@lance0 lance0 deleted the feat/settings-connection-parity branch June 21, 2026 20:43
lance0 added a commit that referenced this pull request Jun 21, 2026
Complete the settings-parity ask (deferred from #54): the Settings → Connection
category now also exposes the active profile's [api] vrf and route_target
backends as rest/graphql cycles (Left/Right/Space), alongside page_size /
timeout_secs / exclude_config_context.

Reuses the established pattern end to end: ConnectionSeed carries the two
BackendPreference values (seeded from the active profile's api_preference), the
cycle mirrors the theme/toggle widgets, and on save apply_connection_settings
now includes the api backends in change-detection, persists them via
persist_profile (which already writes [api]), updates the live profile's
ApiConfig (build_api_config), and reconnects to hot-apply. Unchanged ⇒ no
reconnect.

Tests: the rest↔graphql cycle (independent per surface) and an end-to-end save
that persists [api] vrf=graphql to the active profile + reconnects; extended the
seeding test to assert the api fields and the full five-knob category.
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.

1 participant