Skip to content

Commit b7ad11a

Browse files
committed
Add session-history browser and UI switching
- Added a built-in Session history screen to the main `comon` TUI: - Project list grouped by session `cwd` - Session list with derived titles from user prompts - Session detail view with prompt previews, token counts, tool-call counts, and git metadata when present - Added runtime screen switching: - `s` / `F2` now toggles between Usage and Session history without restarting the app - `r` / `F5` refreshes the active screen and rebuilds the sessions catalog on the Session history screen - Added session-browser CLI options: - `--read` starts directly on the Session history screen - `--sessions-dir` overrides the scanned Codex sessions tree - `--print-sessions-dir` prints the effective sessions directory and exits - Hardened startup behavior for session browsing: - Missing default `CODEX_HOME/sessions` now opens an empty Session history view instead of failing startup
1 parent 42a1655 commit b7ad11a

10 files changed

Lines changed: 1755 additions & 124 deletions

File tree

CHANGELOG.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,28 @@
22

33
All notable changes to this project are documented in this file.
44

5+
## 0.3.3 - 2026-03-18
6+
7+
- Added a built-in Session history screen to the main `comon` TUI:
8+
- Project list grouped by session `cwd`
9+
- Session list with derived titles from user prompts
10+
- Session detail view with prompt previews, token counts, tool-call counts, and git metadata when present
11+
- Added runtime screen switching:
12+
- `s` / `F2` now toggles between Usage and Session history without restarting the app
13+
- `r` / `F5` refreshes the active screen and rebuilds the sessions catalog on the Session history screen
14+
- Added session-browser CLI options:
15+
- `--read` starts directly on the Session history screen
16+
- `--sessions-dir` overrides the scanned Codex sessions tree
17+
- `--print-sessions-dir` prints the effective sessions directory and exits
18+
- Hardened startup behavior for session browsing:
19+
- Missing default `CODEX_HOME/sessions` now opens an empty Session history view instead of failing startup
20+
521
## 0.3.2 - 2026-02-17
622

723
- Fixed workspace startup scoping:
8-
- Launching outside a git repo now always uses **All workspaces**.
9-
- A non-git `--project`/`--cwd` now disables repo filtering, even if launch dir is inside a repo.
24+
- `comon` without `--project` now always uses **All workspaces**, even when launched inside a repo.
25+
- A non-git `--project` now disables repo filtering, even if launch dir is inside a repo.
26+
- `--cwd` now only controls app-server launch directory and never changes usage scope.
1027
- `comon` no longer restores a stale last workspace filter when no workspace hint is detected.
1128
- Hardened long-history backfill behavior:
1229
- `--full-scan --scan-time-budget-ms 0` now forces full reparse instead of trusting unchanged cache rows.

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "comon"
3-
version = "0.3.2"
3+
version = "0.3.3"
44
edition = "2021"
55
license = "Apache-2.0"
66

README.md

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,24 @@
55
Single-binary, cross-platform TUI for:
66

77
- Local Codex usage stats (last 7/30 days, chart, top models) by scanning `CODEX_HOME/sessions`.
8+
- Local session-history browser grouped by project path, with session titles and prompt previews.
89
- Live account limits/credits by spawning `codex app-server` and calling `account/rateLimits/read`.
910

1011
See `CHANGELOG.md` for release history.
1112

1213
<img width="1647" height="861" alt="Dkh7CxLgx7" src="https://github.com/user-attachments/assets/edec765d-0924-493b-8c10-cb32bca867a9" />
1314

14-
## Release 0.3.2
15+
## Release 0.3.3
1516

17+
- Merged the session-history browser into the main `comon` TUI.
18+
- Added runtime screen switching between Usage and Session history with `s` / `F2`.
19+
- Added `--read` to start on the Session history screen.
20+
- Added `--sessions-dir` and `--print-sessions-dir` for browsing alternate Codex session trees.
1621
- Added incremental session parsing with persisted offsets and parser state in `comon.db`.
1722
- Reduced restart regressions: unchanged files outside current scan plan now stay visible via cache.
1823
- Fixed full backfill behavior: `--full-scan --scan-time-budget-ms 0` now forces a full reparse and cache refresh.
19-
- Fixed workspace startup behavior: non-repo launches show **All workspaces** and do not reuse a stale last workspace filter.
24+
- Changed default workspace scope: `comon` without `--project` now always shows **All workspaces**.
25+
- Fixed workspace startup behavior: no stale last workspace filter is restored when no explicit project is provided.
2026
- Added `--scan-time-budget-ms` for bounded per-refresh parse time (`0` disables budget).
2127
- Added `--max-jsonl-line-kib` to cap parsed line size without hard-dropping large files.
2228
- Added cache DB schema migration (`v1 -> v2`) for offset/parser-state fields.
@@ -32,23 +38,23 @@ See `CHANGELOG.md` for release history.
3238

3339
## Run
3440

35-
When started inside a git repository, `comon` auto-detects the repo root and:
41+
By default, `comon` shows usage for **All workspaces** (regardless of current directory).
3642

37-
- Filters usage stats to that project
38-
- Uses it as the default working directory for `codex app-server`
43+
Press `s` / `F2` at runtime to switch between the Usage and Session history screens.
3944

40-
If started outside a git repo, usage is shown as **All workspaces**.
45+
Use `--project <path>` (or `--workspace <path>`) to filter usage stats to a specific git repo.
4146

42-
If you start outside a git repo but pass `--cwd` (or `--project`) pointing inside a git repo,
43-
`comon` will auto-detect the git root from that path.
47+
If `--project` points to a non-git directory, `comon` falls back to **All workspaces**.
4448

45-
If `--cwd` (or `--project`) points to a non-git directory, `comon` shows **All workspaces**
46-
even when launched from inside a git repo.
49+
`--cwd` controls where `codex app-server` is launched and does not change usage scope.
4750

4851
```bash
4952
# If installed (recommended):
5053
comon
5154

55+
# Start directly on the Session history screen:
56+
comon --read
57+
5258
# Or run from the repo without installing:
5359
cargo run --release
5460
```
@@ -58,8 +64,11 @@ Common flags:
5864
- `--codex-home <path>`: override CODEX_HOME (default: `$CODEX_HOME` or `~/.codex`)
5965
- `--comon-home <path>`: override COMON_HOME for comon state/cache files (default: `$COMON_HOME` or `~/.comon`)
6066
- `--print-config-path`: print effective comon config path and exit
67+
- `-r` / `--read`: start on the Session history screen
68+
- `--sessions-dir <path>`: override the Codex sessions directory used by the Session history screen
69+
- `--print-sessions-dir`: print effective sessions directory and exit
6170
- `--codex-bin <path>`: override Codex CLI binary (default: `codex`)
62-
- `--cwd <path>`: directory to launch `codex app-server` in (default: current directory)
71+
- `--cwd <path>`: directory to launch `codex app-server` in (default: current directory; does not change usage scope)
6372
- `--project <path>` / `--workspace <path>`: filter usage stats to a specific project/workspace (also becomes default `--cwd` if `--cwd` not set)
6473
- `--usage-days <n>`: days to scan for usage (clamped 1..=90; default from config)
6574
- `--refresh-usage-secs <n>`: usage refresh interval in seconds (default from config)
@@ -119,10 +128,12 @@ comon --scan-time-budget-ms 1500 --max-jsonl-line-kib 512
119128
- `Tab` Toggle data (Tokens/Time/Runs)
120129
- `w` Toggle timeframe (Week/Month)
121130
- `f` Toggle layout (Horz/Vert)
122-
- `r` / `F5` Refresh now (usage + limits)
131+
- `s` / `F2` Switch between Usage and Session history
132+
- `r` / `F5` Refresh current screen
123133
- `?` Help overlay
124134
- `Esc` / `q` Quit
125135
- `Enter` / `y` Continue past "no sessions found" warning (when shown)
136+
- Session history: `Up` / `Down` / mouse wheel navigate, `Enter` / `Right` open project sessions, `Backspace` / `Left` / `Esc` go back
126137

127138
## Build from source
128139

0 commit comments

Comments
 (0)