Skip to content

feat: replace help overlay with config viewer - #10

Merged
tosaka07 merged 2 commits into
mainfrom
feat/config
Feb 18, 2026
Merged

feat: replace help overlay with config viewer#10
tosaka07 merged 2 commits into
mainfrom
feat/config

Conversation

@tosaka07

@tosaka07 tosaka07 commented Feb 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Help オーバーレイ(? キー)をフッターのキーバインド表示と重複していたため、設定確認ダイアログに置き換え
  • Global(ユーザーレベル)、Local(プロジェクトレベル)、Effective(マージ結果)の 3 セクションで設定内容を表示
  • 各設定値のソース(← global, ← local, ← env, (default))を明示

Changes

src/config/loader.rs, src/config/mod.rs

  • ConfigSource, ConfigSources 構造体を追加し、設定ファイルのパスと個別設定を保持
  • load_config_with_sources() を追加。既存の load_global_config / load_local_config はパスも返すように変更

src/app.rs

  • AppMode::HelpAppMode::Config にリネーム
  • config_sources, config_scroll, config_scroll_max フィールドを追加
  • スクロール操作メソッド追加(上限クランプ付き)

src/ui.rs

  • draw_help_dialogdraw_config_dialog に置き換え
  • ソース優先度判定ヘルパー関数群(resolve_source_str, resolve_source_bool, resolve_source_opt_str)を追加
  • フッターの ?: help?: config に変更

src/input.rs

  • handle_help_modehandle_config_mode にリネーム
  • ↑↓ / C-p / C-n でスクロール操作を追加

src/main.rs

  • load_config_with_sources() を使用するように変更

Test plan

  • cargo build — ビルド成功
  • cargo clippy -- -D warnings — 警告なし
  • cargo fmt --all --check — フォーマット準拠
  • cargo test — 282 テスト全パス(新規 19 テスト追加)
  • cargo run? キーで Config ダイアログが表示されること
  • Global / Local パスと設定値が正しく表示されること
  • ↑↓ スクロールが上限でクランプされること
  • Esc / Enter / q で閉じられること

Add ConfigSource and ConfigSources structs to preserve individual
config sources (global, local, env) alongside the merged config.
Refactor load_global_config/load_local_config to return file paths.
Add load_config_with_sources() as the primary config loading entry point.
Replace the Help overlay (which duplicated footer keybindings) with a
Configuration viewer that shows global, local, and effective settings
with source indicators (← global, ← local, ← env, (default)).

- Rename AppMode::Help to AppMode::Config
- Add scrollable config dialog with ↑↓/C-p/C-n navigation
- Clamp scroll position to content bounds
- Update footer hint from "?: help" to "?: config"
@tosaka07 tosaka07 added the enhancement New feature or request label Feb 18, 2026
@tosaka07
tosaka07 marked this pull request as ready for review February 18, 2026 03:48
@tosaka07
tosaka07 merged commit fc78e44 into main Feb 18, 2026
5 checks passed
@tosaka07
tosaka07 deleted the feat/config branch February 18, 2026 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant