Skip to content

tui: surface current sort + tighten profile/group display in list title #873

@njbrake

Description

@njbrake

Note: this issue was drafted by Claude via back-and-forth with @njbrake. The reasoning and decisions are his; the prose is Claude's.

Background

The home view's list-pane title currently reads, e.g.:

 Agent of Empires [all] (by project) 

Two small UX issues with how this header surfaces mode state.

1. Current sort order is hidden

o cycles sort order forward, Ctrl-O reverses, through Newest → Recent → Oldest → A-Z → Z-A. The selected value is persisted in config.app_state.sort_order, but the only place it shows up is the help overlay (? opens it; the help renders (current sort: Recent) near the keybind list).

That means after restart, you can't tell which sort mode is active without opening help. Group mode does the right thing; sort should follow the same pattern.

Proposal: put the active sort label inline with the existing (by project) suffix in the list title, e.g.:

 Agent of Empires [my-profile] (by project, sort: Recent) 

When sort is the default Newest, omit the suffix to keep noise low. Only show non-default values, same way the group suffix only shows when in Project mode.

Implementation surface, by file:

  • src/session/config.rs already has SortOrder::label() returning the user-facing string.
  • src/tui/home/render.rs:305-322 is where the title is composed; just append a sort suffix the same way group_suffix works.

2. [all] profile tag is noise

active_profile_display() (src/tui/home/mod.rs:1224) returns "all" when no profile filter is active. That is the default state for most users, so the header reads Agent of Empires [all] the vast majority of the time.

Proposal: when the profile filter is the default (no filter applied), drop the [...] segment entirely. Only render the bracketed profile tag when an explicit filter is active. The bracket then doubles as the visual indicator that you have a filter on, which is the only time the user actually needs to know.

Implementation surface:

  • active_profile_display() keeps returning Option<&str> shape (or returns &str as today and the caller checks); the title-construction site at render.rs:312-321 conditionally formats " [{}]" only when present.

Out of scope

  • No new keybind to set sort directly (just the existing o / Ctrl-O cycle).
  • No status-bar real estate changes; this is title-bar only.
  • No web dashboard changes.

Acceptance

  • After restart, the list pane title shows the active sort when it is non-default.
  • The [all] tag never appears; [<profile>] appears only when a real filter is in effect.
  • Profile picker and :profile switching still update the title in real time.

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