Skip to content

feat: address-bar style header + mode badge in status (#10) - #32

Merged
m5d215 merged 1 commit into
mainfrom
feat/header-bar
May 13, 2026
Merged

m5d215 merged 1 commit into
mainfrom
feat/header-bar

Conversation

@m5d215

@m5d215 m5d215 commented May 13, 2026

Copy link
Copy Markdown
Owner

Closes #10.

Design

Researched neighboring TUIs before deciding what to render (neovim+lualine, helix, less, glow, frogmouth). Filtered out elements that don't apply to a read-only markdown viewer (filetype is always md, no encoding/line-ending edits, no VCS / LSP / diagnostics, no buffers/tabs). Kept the browser metaphor that #10 originally called out.

Result

Two rows of chrome, both reverse-video to match each other:

```
◀ ▶ examples/showcase.md 42%
──────────────────────────── body ────────────────────────────
NORMAL [10/250] ?:help /:find o:toc d:dir Tab:link ...
```

  • Top header is purely "where are we" — always visible, never replaced by transient prompts.
    • Left: history affordance (`◀` back / `▶` forward) + path/URL. Glyphs dim to grey when that direction isn't available.
    • Left truncation with a leading `…` when the path doesn't fit, so the filename tail stays on screen.
    • Right: scroll-position chip — `top` / `%` / `bot`, or `all` when the document fits in the viewport.
  • Bottom status is "what are we doing".
    • New: mode badge at the left (`NORMAL` / `YANK` / `TOC` / `HELP` / `SEARCH` / `DIR`). Gives NORMAL a visible state for the first time.
    • Cursor location `[N/total]` and key hint string carry over from the old format. The path was previously here and is now removed (lives in the header).

Test plan

  • `cargo build --locked`, `clippy`, `fmt --check`, `test --locked` all clean.
  • Manual TUI: header shows path + scroll % on every mode (Normal, Yank during selection, search input, dir overlay, toc overlay, help overlay). Back / forward arrows dim correctly through link traversal. Narrow terminal left-truncates the path. Status bar carries the right mode badge for each.

Out of scope (deferred unless asked)

  • Per-mode colorized badge (currently all reverse-video, same as the rest of the bar).
  • Loading spinner during URL fetches (`status_message = "fetching ..."` already covers it).
  • Live word-count / table-of-contents breadcrumb in the header.

🤖 Generated with Claude Code

Closes #10.

The current source path used to live in the bottom status bar — and
disappeared whenever a transient state (search, yank, pending count,
status message) needed the row. Promote it to a dedicated address-bar
style header at the top of the window so it's always visible:

  - Left: history affordance (◀ back / ▶ forward, dimmed when
    unavailable) followed by the path or URL. Long values
    left-truncate with a leading `…` so the tail (the filename) is
    what stays on screen.
  - Right: scroll-position chip — `top` / `<n>%` / `bot`, or `all`
    when the document fits. Matches what less/helix surface.

Status bar gets a mode badge as compensation. `NORMAL` / `YANK` /
`TOC` / `HELP` / `SEARCH` / `DIR` now appear at the left so users
have a textual confirmation of the active mode (especially useful for
the NORMAL state, which previously had no overt indicator).

Out of scope: filetype / encoding / VCS / LSP-style elements that
don't apply to a read-only markdown viewer (per the design notes on
#10).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@m5d215
m5d215 enabled auto-merge May 13, 2026 06:39
@m5d215
m5d215 merged commit 509b5af into main May 13, 2026
3 checks passed
@m5d215
m5d215 deleted the feat/header-bar branch May 13, 2026 06:40
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.

UI polish: filename header / address bar

1 participant