Skip to content

feat: view settings modal with column picker and compact + adaptive layouts #29

@steven-pribilinskiy

Description

@steven-pribilinskiy

Problem

The dashboard ships with a hard-coded 9-column layout (Status, Repository, Branch, Staged, Modified, Untracked, Ahead, Behind, Last Commit) and a single last-commit format (Jan 02 15:04). Two practical issues:

  1. No way to hide columns you don't care about. If you live in dirty filter mode the Status column is noise; if you don't sync with a remote much, Ahead/Behind add clutter.
  2. Narrow terminals + side panels clip the table. When g / d / t open, the table is allocated ~58% of the width — the existing 9 columns no longer fit, and renderSplitPane simply truncates them. No automatic adaptation.
  3. Last-commit timestamp is always Jan 02 15:04. Users who want absolute dates with year, or relative "ago" formatting, have no toggle.

Proposal

A new v View Settings modal that consolidates every dashboard display choice in one place and persists it to state.json (new view block).

Modal

┌─ View Settings ────────────────────────────────────┐
│  Sort         [Dirty First]    ←→ cycle            │
│  Filter       [All]            ←→ cycle            │
│  Layout       [Adaptive]       Standard / Compact  │
│  Last commit  [Date]           Date+Year / Ago     │
│                                                    │
│  Columns                                           │
│    [✓] Status                                      │
│    [✓] Repository       (always on)                │
│    [✓] Branch           (always on)                │
│    [✓] Staged                                      │
│    ...                                             │
│                                                    │
│  ↑↓ navigate · space cycle/toggle · esc close      │
└────────────────────────────────────────────────────┘

Navigate with arrows; Space / cycle the highlighted setting forward, backwards. Column rows toggle on Space/Enter. Every change re-renders the table immediately and writes the new view block to state.json.

Layouts

  • Standard — current 9 columns. Default, unchanged.
  • Compact — 6 columns. Staged / Modified / Untracked collapse into a Changes column (1/2/—). Ahead / Behind collapse into Sync (↑2 —). Frees ~17 cols, widening Repository (18→28) and Branch (14→22).
  • Adaptive — runtime picks Compact when a side panel is open or terminal width is below the threshold (~110 cols); Standard otherwise. The model stores the choice (Adaptive); the effective layout is recomputed on every column rebuild.

Last-commit formats

  • dateJan 02 15:04 (default).
  • date_year2026-01-02 15:04.
  • ago5 mins ago, 3 days ago, 2 months ago, 1 year ago. Reuses (and extends) the existing formatTimeAgo from internal/stats/timeline.go so old commits don't fall back to a bare date.

Implementation note

Single column registry (internal/tui/columns.go) is the source of truth — the modal iterates it, the row builder looks up render functions there, and the layout switcher swaps between standardLayoutCols() and compactLayoutCols(). SetColumns clears stale rows before swapping to avoid the bubble-tea renderRow out-of-range panic that fires when row width and column count disagree mid-frame.

Happy to send a PR — already have a branch ready.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions