reorder tabs

This commit is contained in:
Emil Lerch 2026-05-19 13:30:21 -07:00
parent fa728b3f04
commit 8fe9257c60
Signed by: lobo
GPG key ID: A7B62D657EF764F8
3 changed files with 12 additions and 56 deletions

View file

@ -251,25 +251,25 @@ If no portfolio or symbol is specified and `portfolio.srf` exists in the current
## Interactive TUI
The TUI has eight tabs: Portfolio, Quote, Performance, Options, Earnings, Analysis, History, and Projections.
The TUI has eight tabs: Portfolio, Analysis, Projections, History, Quote, Performance, Earnings, and Options.
### Tabs
**Portfolio** -- navigable list of positions with market value, gain/loss, weight, and purchase date. Multi-lot positions can be expanded to show individual lots with per-lot gain/loss, capital gains indicator (ST/LT), and account name. Press `a` to open an account-filter picker (with `/` search).
**Analysis** -- portfolio breakdown by asset class, sector, geographic region, account, and tax type. Uses classification data from `metadata.srf` and account tax types from `accounts.srf`. Displays horizontal bar charts with sub-character precision using Unicode block elements.
**Projections** -- Monte Carlo retirement projection with percentile bands. Press `d` to set an as-of date (back-date the projection to a historical snapshot), `o` to overlay realized actuals from snapshots / `imported_values.srf` on top of the bands, `v` to toggle the chart vs the text-only report, and `e` to toggle simulated lifecycle events (RMDs, lump-sum withdrawals). Esc clears an active as-of override.
**History** -- portfolio value over time, sourced from snapshot files in `<portfolio-dir>/history/` plus optional `imported_values.srf`. Cycle the metric column with `m` (liquid / total / contributions / etc.) and the time-bucket resolution with `t` (week / month / quarter / year). Press `s` (or space) to mark a row for compare; mark a second row, then `c` to commit a side-by-side compare against the live portfolio. Esc cancels an in-flight compare.
**Quote** -- current price, OHLCV, daily change, and a 60-day ASCII chart with recent history table.
**Performance** -- trailing returns using two methodologies (as-of-date and month-end), matching Morningstar's "Trailing Returns" and "Performance" pages respectively. Shows price-only and total return (with dividend reinvestment) when Polygon data is available. Also shows risk metrics (volatility, Sharpe ratio, max drawdown).
**Options** -- all expirations in a navigable list. Expand any expiration to see calls and puts inline. Calls and puts sections are independently collapsible. Near-the-money filter limits strikes shown (default +/- 8, adjustable with Ctrl+1-9). ITM strikes are marked with `|`. Monthly expirations display in normal color, weeklies are dimmed.
**Earnings** -- historical and upcoming earnings events with EPS estimate/actual, surprise amount and percentage. Future events are dimmed. Tab is disabled for ETFs.
**Analysis** -- portfolio breakdown by asset class, sector, geographic region, account, and tax type. Uses classification data from `metadata.srf` and account tax types from `accounts.srf`. Displays horizontal bar charts with sub-character precision using Unicode block elements.
**History** -- portfolio value over time, sourced from snapshot files in `<portfolio-dir>/history/` plus optional `imported_values.srf`. Cycle the metric column with `m` (liquid / total / contributions / etc.) and the time-bucket resolution with `t` (week / month / quarter / year). Press `s` (or space) to mark a row for compare; mark a second row, then `c` to commit a side-by-side compare against the live portfolio. Esc cancels an in-flight compare.
**Projections** -- Monte Carlo retirement projection with percentile bands. Press `d` to set an as-of date (back-date the projection to a historical snapshot), `o` to overlay realized actuals from snapshots / `imported_values.srf` on top of the bands, `v` to toggle the chart vs the text-only report, and `e` to toggle simulated lifecycle events (RMDs, lump-sum withdrawals). Esc clears an active as-of override.
**Options** -- all expirations in a navigable list. Expand any expiration to see calls and puts inline. Calls and puts sections are independently collapsible. Near-the-money filter limits strikes shown (default +/- 8, adjustable with Ctrl+1-9). ITM strikes are marked with `|`. Monthly expirations display in normal color, weeklies are dimmed.
### Keybindings

44
TODO.md
View file

@ -212,50 +212,6 @@ against external broker exports, `doctor` is internal-state
validation. But worth confirming the boundary before implementing
to avoid duplicated checks.
## TUI tab re-order — priority LOW
Current tab order interleaves the two natural categories:
```
Portfolio Quote Performance Options Earnings Analysis History Projections
P S S S S P P P
```
That's `P S S S S P P P` — the per-portfolio tabs (P) are split
across the bar (slot 1, then slots 6-8). Reflects history of feature
additions rather than current shape.
### Suggested re-order to consider
```
Portfolio Analysis History Projections | Quote Performance Options Earnings
```
"Your money" tabs first (1-4), "research a symbol" tabs second
(5-8). Categorical split is clean; the 4↔5 boundary is a natural
divider in the tab bar.
### Alternative orderings worth weighing
- `Portfolio Analysis Projections History | Quote Performance Earnings Options`
— within each category, ordered by frequency of use rather than
by category cohesion.
- Status quo with just Analysis moved up next to Portfolio (minimum
churn).
### Mechanics
The `tab_modules` registry in `src/tui.zig` makes the actual reorder
a one-edit change (reorder fields in the registry literal). Cost is
in retraining muscle memory and updating the README's keybinding
table + screenshots.
### Doc drift to fix while we're there
README still says "six tabs," actual count is eight (Portfolio,
Quote, Performance, Options, Earnings, Analysis, History,
Projections).
## Split `audit.zig` into per-broker reconcilers — priority LOW
`src/commands/audit.zig` is 3438 lines — the largest command file

View file

@ -19,13 +19,13 @@ const input_buffer = @import("tui/input_buffer.zig");
/// from `pub const label` on the tab module).
const tab_modules = .{
.portfolio = @import("tui/portfolio_tab.zig"),
.analysis = @import("tui/analysis_tab.zig"),
.projections = @import("tui/projections_tab.zig"),
.history = @import("tui/history_tab.zig"),
.quote = @import("tui/quote_tab.zig"),
.performance = @import("tui/performance_tab.zig"),
.options = @import("tui/options_tab.zig"),
.earnings = @import("tui/earnings_tab.zig"),
.analysis = @import("tui/analysis_tab.zig"),
.history = @import("tui/history_tab.zig"),
.projections = @import("tui/projections_tab.zig"),
.options = @import("tui/options_tab.zig"),
};
/// Comptime-generated table of single-character grapheme slices with static lifetime.