logs.gokuls.in

1 pull request merged across 1 repo

bahdotsh/feedr

Adds a ui.show_preview config option (bool, default false) so the dashboard preview pane can start open at launch instead of requiring p every session. Requested in #40, where the use case is reddit megathread feeds that are basically unreadable without the preview pane.

  • show_preview = true under [ui] in config.toml opens the preview pane at startup; p still toggles it at runtime
  • Exposed through all existing config surfaces: feedr config list / get / set (with true/false validation) and the TUI config editor (feedr config --tui, Enter toggles it)
  • #[serde(default)] keeps existing config files loading unchanged — omitted key means false, i.e. exactly today's behavior
  • Composes with compact mode as before: the preview pane stays suppressed while compact mode is active
  • Documented in the README and in the generated config-file comments

Also fixes test_toggle_preview_pane, which asserted the launch default of App::new() — that default now depends on the developer's real ~/.config/feedr/config.toml, so the test now sets its initial state explicitly and asserts only toggle behavior.

Fixes #40

Test plan

  • cargo test — 215 tests pass, including two new unit tests: back-compat parse of a [ui] table without the key, and get_value/validate_and_set round-trip with invalid-value rejection
  • cargo clippy --all-targets --all-features -- -D warnings clean
  • cargo fmt --all -- --check clean
  • Manual: with show_preview = true, launch opens the dashboard with the preview pane visible; p hides it; relaunch shows it again