Skip to content

feat: open_direction config key — split the viewer right (default) or down - #152

Open
diegopzz wants to merge 1 commit into
smarzban:mainfrom
diegopzz:open-direction
Open

feat: open_direction config key — split the viewer right (default) or down#152
diegopzz wants to merge 1 commit into
smarzban:mainfrom
diegopzz:open-direction

Conversation

@diegopzz

Copy link
Copy Markdown

What

A new config key deciding which way the launchers split the viewer pane off the invoking work pane:

open_direction = "right"   # the default — beside the work pane, today's layout
open_direction = "down"    # below it — suits tall/narrow layouts

The vocabulary is exactly what herdr plugin pane open --direction accepts, so the config can never request a placement herdr cannot perform.

How

  • config.rs: OpenDirection enum (Right default) resolved leniently (trimmed, case-insensitive) like tree_position; anything unrecognized keeps Right so a typo can never produce a --direction herdr rejects.
  • The binary gains a third probe mode, --open-direction, printing the resolved label — the launchers cannot parse TOML, so they read the one value they need through the same defensive config path the TUI uses (missing binary / malformed config → right).
  • scripts/open-file-viewer.sh and scripts/open-file-viewer.ps1 consume the probe. The tab launcher is untouched — it has no split to aim.
  • The read-only Settings overlay shows the effective value as its own row.
  • Docs: key added to docs/configuration.md with the placement-keys paragraph extended.

Tests

cargo test (1436 passed), cargo fmt --check, cargo clippy --release --all-targets -- -D warnings all clean. New coverage: resolver (config-wins / default / lenient), argv parsing (probe precedence), settings-overlay row.

🤖 Generated with Claude Code

@diegopzz
diegopzz requested a review from smarzban as a code owner August 18, 2026 08:40
… work pane

A new config key, open_direction = "right" (default) | "down", aims the split
the launchers create: beside the work pane as today, or below it for tall,
narrow layouts. The vocabulary is exactly what herdr's plugin pane open
--direction accepts, so the config can never ask for a placement herdr cannot
perform.

The shells cannot parse TOML, so the binary gains a third probe mode,
--open-direction, printing the resolved label through the same defensive
config path the TUI uses: absent, malformed, or unrecognized values (and a
missing binary) all degrade to right, today's layout. Both the unix and
Windows launchers consume it; the tab launcher is untouched (no split to aim).
The read-only Settings overlay gains the matching row.

Tracking: OFFLINE-20260818-fileviewer-open-direction

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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