Skip to content

feat(tui): show number legends on the first nine tabs#4

Merged
ekrist1 merged 9 commits into
ekrist1:masterfrom
tharropoulos:feat/tab-number-legend
Jun 3, 2026
Merged

feat(tui): show number legends on the first nine tabs#4
ekrist1 merged 9 commits into
ekrist1:masterfrom
tharropoulos:feat/tab-number-legend

Conversation

@tharropoulos

Copy link
Copy Markdown
Contributor
  • prefix the first nine tab titles with their 19 quick-select digit
  • render inactive-tab digits with a subtle muted color so the title stays the primary signal
  • let the digit on the active tab inherit the bold accent style so it doesn't visually detach

depends on: #3

@ekrist1 ekrist1 marked this pull request as ready for review June 3, 2026 16:13
Copilot AI review requested due to automatic review settings June 3, 2026 16:13
@ekrist1 ekrist1 merged commit 87f1eb1 into ekrist1:master Jun 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the TUI to support configurable tab ordering (via config), and adds 19 numeric legends to the first nine tabs to match the existing digit quick-select behavior.

Changes:

  • Add TOML-backed config loading/saving with legacy YAML fallback and tab-order validation (tabs.order).
  • Route tab activation/rendering by tab IDs (instead of fixed indices), based on configured tab order.
  • Prefix the first nine tab titles with 19 legends and introduce a subtle digit style for inactive tabs.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
README.md Updates configuration docs to TOML format and documents tabs.order.
main.go Enters setup when a loaded config is missing required fields.
internal/tui/theme/theme.go Adds a dedicated TabNumber style for numeric legends.
internal/tui/screens/setup.go Preserves non-URL/APIKey config fields when completing setup.
internal/tui/app.go Adds tab ID–based routing/configured tab ordering and renders numeric legends in the tab bar.
internal/tui/app_test.go Adds tests for configured tab order, settings save flow, and Ctrl+C behavior during setup.
internal/config/config.go Implements TOML config, YAML fallback, tabs.order, and tab validation helpers.
internal/config/config_test.go Adds test coverage for TOML paths, YAML fallback, tab ordering, and validation errors.
go.mod Adds go-toml/v2 dependency entry.
go.sum Adds checksums for the TOML dependency.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/tui/app.go
Comment on lines +389 to +393
if i == a.active {
titles[i] = digit + " " + t
} else {
titles[i] = theme.TabNumber.Render(digit) + " " + t
}
Comment thread internal/tui/app.go
Comment on lines 229 to +231
// Settings is a form, so keep Tab/digits/q available for the inputs.
// Esc returns to Collections.
if a.active == a.settingsTabIndex() {
if a.activeTabID() == "settings" {
Comment thread README.md

The `tabs.order` list controls both which tabs are shown and where they appear. Remove a tab ID to hide it, or reorder the IDs to change the tab bar placement. Valid IDs are `collections`, `aliases`, `nl_models`, `curations`, `synonyms`, `stopwords`, `presets`, `conversations`, `api_keys`, `analytics`, `cluster`, and `settings`.

A legacy `config.yaml` at the same path is still loaded if no `config.toml` is present.
Comment thread go.mod
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
github.com/muesli/cancelreader v0.2.2 // indirect
github.com/muesli/termenv v0.16.0 // indirect
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
Comment thread internal/tui/app_test.go
Comment on lines +20 to +27
app := NewApp(cfg, "/tmp/config.toml", false)

want := []string{"analytics", "collections", "settings"}
for i, id := range want {
if app.tabIDs[i] != id {
t.Fatalf("tabIDs = %+v, want %+v", app.tabIDs, want)
}
}
Comment thread internal/tui/app_test.go
Comment on lines +31 to +33
cfg := config.Config{URL: "http://localhost:8108", APIKey: "xyz"}
path := filepath.Join(t.TempDir(), "config.yaml")
app := NewApp(cfg, path, false)
Comment thread internal/tui/app_test.go
}

func TestCtrlCQuitsInitialSetup(t *testing.T) {
app := NewApp(config.Config{}, "/tmp/config.yaml", true)
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.

3 participants