Skip to content

feat(tui): cycle profiles in config-file order#14

Merged
lance0 merged 1 commit into
masterfrom
feat/profile-cycle-order
Jun 19, 2026
Merged

feat(tui): cycle profiles in config-file order#14
lance0 merged 1 commit into
masterfrom
feat/profile-cycle-order

Conversation

@lance0

@lance0 lance0 commented Jun 19, 2026

Copy link
Copy Markdown
Owner

Summary

The TUI profile switcher (P / Ctrl+P) cycled profiles alphabetically because Config.profiles was a BTreeMap. This switches it to an order-preserving IndexMap and enables toml's preserve_order feature so [profiles.*] keep their TOML document order through deserialization.

Now the switcher, profile list, and config show all follow config-file order. No config change needed; indexmap was already in the lockfile transitively.

This is goal #5 from the read-only UX track (the research flagged it as the quick first win) — isolated to config.rs/lib.rs, no overlap with the footer/filters work.

Verification

  • cargo fmt --all -- --check
  • cargo clippy --all-targets --all-features -- -D warnings + --no-default-features
  • cargo test --all-features — 760 passed / 0 failed, incl. a new profiles_preserve_config_file_order_not_alphabetical lock test

Profiles loaded into a BTreeMap sorted alphabetically, so the TUI switcher
(P/Ctrl+P) walked alpha order, not the order in config.toml. Switch Config.profiles
to an order-preserving IndexMap and enable toml's preserve_order so document order
survives deserialization; the switcher, profile list, and config show now all
follow file order. Lock it with a deserialization-order test.
@lance0 lance0 merged commit 5918f90 into master Jun 19, 2026
4 checks passed
@lance0 lance0 deleted the feat/profile-cycle-order branch June 19, 2026 09:22
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