Skip to content

Commit b0cd401

Browse files
authored
Merge pull request #10 from phonton-dev/codex/v0.4.8-tui-polish
fix: polish tui session surfaces
2 parents a796b5b + 1af9e17 commit b0cd401

7 files changed

Lines changed: 185 additions & 17 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ All notable Phonton CLI release changes should be documented here.
44

55
This project follows pre-1.0 SemVer: minor versions may still include breaking changes while the public API and CLI surface settle.
66

7+
## 0.4.8 - TUI Polish
8+
9+
### Fixed
10+
11+
- The Active panel now shows the real worker subtask label when memory context is attached, instead of leaking the raw `# Prior context from memory` preamble.
12+
- The PHONTON splash wordmark keeps the same ASCII art and gradient styling but no longer animates the full-logo color phase, avoiding Windows terminal shimmer artifacts.
13+
14+
### Changed
15+
16+
- Exit confirmation now shows an in-TUI session summary with goal counts, token totals, estimated savings, and resume behavior before closing.
17+
718
## 0.4.7 - Cloudflare Account Persistence
819

920
### Fixed

‎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.

‎README.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<img src="assets/readme/phonton-cli-logo.png" width="112" alt="Phonton CLI logo">
33
</p>
44

5-
<h1 align="center">Phonton CLI · v0.4.7</h1>
5+
<h1 align="center">Phonton CLI · v0.4.8</h1>
66

77
<p align="center">
88
<strong>Verified code changes with repo memory.</strong><br>
@@ -12,7 +12,7 @@
1212
<p align="center">
1313
<a href="https://github.com/phonton-dev/phonton-cli/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/phonton-dev/phonton-cli/actions/workflows/ci.yml/badge.svg"></a>
1414
<a href="https://github.com/phonton-dev/phonton-cli/stargazers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/phonton-dev/phonton-cli?style=flat&label=stars"></a>
15-
<img alt="release" src="https://img.shields.io/badge/release-v0.4.7-6c63ff">
15+
<img alt="release" src="https://img.shields.io/badge/release-v0.4.8-6c63ff">
1616
<img alt="license" src="https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-blue">
1717
<img alt="status" src="https://img.shields.io/badge/status-public_alpha-f97316">
1818
</p>
@@ -103,7 +103,7 @@ Windows PowerShell:
103103
Direct Cargo install:
104104

105105
```bash
106-
cargo install --git https://github.com/phonton-dev/phonton-cli --tag v0.4.7 phonton-cli --locked --force
106+
cargo install --git https://github.com/phonton-dev/phonton-cli --tag v0.4.8 phonton-cli --locked --force
107107
```
108108

109109
Check the install:
@@ -119,7 +119,7 @@ Phonton uses GitHub branches and releases as install channels:
119119

120120
| Channel | Install | Use when |
121121
|---|---|---|
122-
| Stable | `cargo install --git https://github.com/phonton-dev/phonton-cli --tag v0.4.7 phonton-cli --locked --force` | You want the best validated public alpha |
122+
| Stable | `cargo install --git https://github.com/phonton-dev/phonton-cli --tag v0.4.8 phonton-cli --locked --force` | You want the best validated public alpha |
123123
| Dev | `cargo install --git https://github.com/phonton-dev/phonton-cli --branch dev phonton-cli --locked --force` | You want next-release integration changes |
124124
| Nightly | `cargo install --git https://github.com/phonton-dev/phonton-cli --branch nightly phonton-cli --locked --force` | You want daily snapshots and can tolerate breakage |
125125
| Main | `cargo install --git https://github.com/phonton-dev/phonton-cli --branch main phonton-cli --locked --force` | You want the current release branch tip |

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "phonton-cli",
3-
"version": "0.4.7",
3+
"version": "0.4.8",
44
"description": "Local-first agentic development terminal with context packs, source handles, and verification gates.",
55
"license": "MIT OR Apache-2.0",
66
"homepage": "https://github.com/phonton-dev/phonton-cli#readme",

‎phonton-cli/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "phonton-cli"
3-
version = "0.4.7"
3+
version = "0.4.8"
44
edition.workspace = true
55
license.workspace = true
66
repository.workspace = true

‎phonton-cli/src/main.rs‎

Lines changed: 148 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1841,7 +1841,7 @@ pub fn render(frame: &mut Frame, app: &App) {
18411841
render_mcp_approval(frame, area, app);
18421842
}
18431843
if app.quit_confirmation_open {
1844-
render_quit_confirmation(frame, area);
1844+
render_quit_confirmation(frame, area, app);
18451845
}
18461846
}
18471847

@@ -1926,9 +1926,9 @@ fn render_help(frame: &mut Frame, area: Rect) {
19261926
}
19271927

19281928
/// Confirmation modal shown before ending an interactive session.
1929-
fn render_quit_confirmation(frame: &mut Frame, area: Rect) {
1930-
let popup_w = area.width.saturating_sub(4).clamp(32, 58);
1931-
let popup_h = area.height.saturating_sub(2).clamp(7, 9);
1929+
fn render_quit_confirmation(frame: &mut Frame, area: Rect, app: &App) {
1930+
let popup_w = area.width.saturating_sub(4).clamp(48, 76);
1931+
let popup_h = area.height.saturating_sub(2).clamp(13, 17);
19321932
let popup_area = Rect {
19331933
x: area.x + (area.width.saturating_sub(popup_w)) / 2,
19341934
y: area.y + (area.height.saturating_sub(popup_h)) / 2,
@@ -1939,7 +1939,7 @@ fn render_quit_confirmation(frame: &mut Frame, area: Rect) {
19391939
frame.render_widget(Clear, popup_area);
19401940
let block = Block::default()
19411941
.title(Span::styled(
1942-
" End Session? ",
1942+
" End Session ",
19431943
Style::default().fg(WARN).add_modifier(Modifier::BOLD),
19441944
))
19451945
.title_bottom(Line::from(vec![
@@ -1952,6 +1952,17 @@ fn render_quit_confirmation(frame: &mut Frame, area: Rect) {
19521952
.style(Style::default().bg(BG_DEEP));
19531953
frame.render_widget(block.clone(), popup_area);
19541954

1955+
let totals = app.session_totals();
1956+
let saved_label = if totals.estimated_tokens_saved >= 0 {
1957+
"saved"
1958+
} else {
1959+
"over"
1960+
};
1961+
let saved_value = totals.estimated_tokens_saved.saturating_abs();
1962+
let best = totals
1963+
.best_savings_pct
1964+
.map(|p| format!("{p}%"))
1965+
.unwrap_or_else(|| "n/a".into());
19551966
let lines = vec![
19561967
Line::raw(""),
19571968
Line::from(Span::styled(
@@ -1961,8 +1972,47 @@ fn render_quit_confirmation(frame: &mut Frame, area: Rect) {
19611972
.add_modifier(Modifier::BOLD),
19621973
)),
19631974
Line::raw(""),
1975+
Line::from(vec![
1976+
Span::styled(" Goals ", Style::default().fg(MUTED)),
1977+
Span::styled(
1978+
totals.goals.to_string(),
1979+
Style::default().fg(ACCENT_HI).add_modifier(Modifier::BOLD),
1980+
),
1981+
Span::styled(" done ", Style::default().fg(MUTED)),
1982+
Span::styled(totals.completed.to_string(), Style::default().fg(SUCCESS)),
1983+
Span::styled(" review ", Style::default().fg(MUTED)),
1984+
Span::styled(totals.reviewing.to_string(), Style::default().fg(WARN)),
1985+
Span::styled(" failed ", Style::default().fg(MUTED)),
1986+
Span::styled(totals.failed.to_string(), Style::default().fg(DANGER)),
1987+
]),
1988+
Line::from(vec![
1989+
Span::styled(" Tokens ", Style::default().fg(MUTED)),
1990+
Span::styled(
1991+
totals.tokens_used.to_string(),
1992+
Style::default().fg(ACCENT_HI).add_modifier(Modifier::BOLD),
1993+
),
1994+
Span::styled(" vs baseline ", Style::default().fg(MUTED)),
1995+
Span::styled(
1996+
totals.naive_baseline_tokens.to_string(),
1997+
Style::default().fg(Color::White),
1998+
),
1999+
]),
2000+
Line::from(vec![
2001+
Span::styled(" Efficiency ", Style::default().fg(MUTED)),
2002+
Span::styled(
2003+
format!("{saved_label} {saved_value}"),
2004+
Style::default().fg(if totals.estimated_tokens_saved >= 0 {
2005+
SUCCESS
2006+
} else {
2007+
WARN
2008+
}),
2009+
),
2010+
Span::styled(" best ", Style::default().fg(MUTED)),
2011+
Span::styled(best, Style::default().fg(SUCCESS)),
2012+
]),
2013+
Line::raw(""),
19642014
Line::from(Span::styled(
1965-
" A receipt with token totals will print after the TUI closes.",
2015+
" The session snapshot is saved locally for `phonton -r`.",
19662016
Style::default().fg(MUTED),
19672017
)),
19682018
];
@@ -2075,14 +2125,15 @@ fn render_mcp_approval(frame: &mut Frame, area: Rect, app: &App) {
20752125
fn render_splash(frame: &mut Frame, area: Rect, app: &App) {
20762126
// Keep the normal ANSI Shadow wordmark. The terminal-corruption fix is
20772127
// keeping semantic-index downloads silent while Ratatui owns the screen.
2078-
let phase = (app.spinner_frame as f32) * LOGO_SHIMMER_SPEED;
2128+
let header_phase = (app.spinner_frame as f32) * LOGO_SHIMMER_SPEED;
2129+
let logo_phase = 0.17;
20792130
if area.height >= LOGO.len() as u16 + 2 && area.width >= LOGO_WIDTH_THRESHOLD {
20802131
let mut lines: Vec<Line> = Vec::with_capacity(LOGO.len() + 2);
20812132
lines.push(Line::raw(""));
20822133
lines.extend(
20832134
LOGO.iter()
20842135
.enumerate()
2085-
.map(|(row_idx, row)| logo_line(row, phase, row_idx)),
2136+
.map(|(row_idx, row)| logo_line(row, logo_phase, row_idx)),
20862137
);
20872138
lines.push(Line::from(Span::styled(
20882139
format!("v{}", env!("CARGO_PKG_VERSION")),
@@ -2094,7 +2145,7 @@ fn render_splash(frame: &mut Frame, area: Rect, app: &App) {
20942145
frame.render_widget(p, area);
20952146
} else {
20962147
// Compact one-line header - gradient "phonton" + dim subtitle.
2097-
let mut spans = gradient_line("✦ phonton", phase * 0.8, true).spans;
2148+
let mut spans = gradient_line("✦ phonton", header_phase * 0.8, true).spans;
20982149
spans.push(Span::styled(" ── ", Style::default().fg(DIM)));
20992150
spans.push(Span::styled(
21002151
"agentic dev environment",
@@ -2610,7 +2661,8 @@ fn render_centre(frame: &mut Frame, area: Rect, app: &App) {
26102661
for w in &state.active_workers {
26112662
let mut spans = status_tag_spans(&w.status_as_task(), app.spinner_frame);
26122663
spans.push(Span::raw(" "));
2613-
spans.push(Span::raw(short(&w.subtask_description, 50)));
2664+
let label = worker_display_description(&w.subtask_description);
2665+
spans.push(Span::raw(short(&label, 50)));
26142666
if w.is_thinking {
26152667
let frame_idx = (app.spinner_frame / 4) % SPINNER.len();
26162668
let frame_ch = SPINNER[frame_idx];
@@ -3395,6 +3447,20 @@ fn short(s: &str, n: usize) -> String {
33953447
}
33963448
}
33973449

3450+
fn worker_display_description(description: &str) -> String {
3451+
let trimmed = description.trim();
3452+
if trimmed.starts_with("# Prior context") {
3453+
return trimmed
3454+
.lines()
3455+
.rev()
3456+
.find(|line| !line.trim().is_empty())
3457+
.unwrap_or(trimmed)
3458+
.trim()
3459+
.to_string();
3460+
}
3461+
trimmed.lines().next().unwrap_or(trimmed).trim().to_string()
3462+
}
3463+
33983464
/// Helper for rendering a `SubtaskStatus` using the same taxonomy as a
33993465
/// `TaskStatus` — lets the centre pane reuse [`status_tag`] on workers.
34003466
trait SubtaskStatusExt {
@@ -6442,6 +6508,20 @@ fn extract_id(line: &str) -> Option<String> {
64426508
assert_eq!(cfg.budget.max_usd_cents, Some(99));
64436509
}
64446510

6511+
#[test]
6512+
fn worker_label_hides_memory_preamble() {
6513+
let description =
6514+
"# Prior context from memory\n- Honour previous decisions\n\nImplement chess board";
6515+
assert_eq!(
6516+
worker_display_description(description),
6517+
"Implement chess board"
6518+
);
6519+
assert_eq!(
6520+
worker_display_description("Write integration tests\nwith details"),
6521+
"Write integration tests"
6522+
);
6523+
}
6524+
64456525
#[test]
64466526
fn session_totals_sum_tokens_and_estimated_savings() {
64476527
let mut app = App::default();
@@ -6558,6 +6638,21 @@ fn extract_id(line: &str) -> Option<String> {
65586638
assert!(dump.contains(&format!("v{}", env!("CARGO_PKG_VERSION"))));
65596639
}
65606640

6641+
#[test]
6642+
fn wide_splash_logo_is_stable_across_ticks() {
6643+
let backend = TestBackend::new(100, 24);
6644+
let mut terminal = Terminal::new(backend).unwrap();
6645+
let mut app = App::default();
6646+
terminal.draw(|f| render(f, &app)).unwrap();
6647+
let first = format!("{:?}", terminal.backend().buffer());
6648+
6649+
app.spinner_frame = 64;
6650+
terminal.draw(|f| render(f, &app)).unwrap();
6651+
let second = format!("{:?}", terminal.backend().buffer());
6652+
6653+
assert_eq!(first, second);
6654+
}
6655+
65616656
#[test]
65626657
fn renders_version_on_compact_header() {
65636658
let backend = TestBackend::new(64, 20);
@@ -6585,6 +6680,49 @@ fn extract_id(line: &str) -> Option<String> {
65856680
assert!(dump.contains("Enter/Y approve"));
65866681
}
65876682

6683+
#[test]
6684+
fn quit_confirmation_renders_session_summary() {
6685+
let backend = TestBackend::new(120, 34);
6686+
let mut terminal = Terminal::new(backend).unwrap();
6687+
let mut app = App {
6688+
quit_confirmation_open: true,
6689+
best_savings_pct: Some(75),
6690+
..App::default()
6691+
};
6692+
app.goals.push(GoalEntry {
6693+
description: "done".into(),
6694+
status: TaskStatus::Done {
6695+
tokens_used: 250,
6696+
wall_time_ms: 1,
6697+
},
6698+
state: Some(GlobalState {
6699+
task_status: TaskStatus::Done {
6700+
tokens_used: 250,
6701+
wall_time_ms: 1,
6702+
},
6703+
goal_contract: None,
6704+
handoff_packet: None,
6705+
active_workers: Vec::new(),
6706+
tokens_used: 250,
6707+
tokens_budget: None,
6708+
estimated_naive_tokens: 1000,
6709+
checkpoints: Vec::new(),
6710+
}),
6711+
task_id: TaskId::new(),
6712+
flight_log: Vec::new(),
6713+
checkpoint_cursor: None,
6714+
});
6715+
6716+
terminal.draw(|f| render(f, &app)).unwrap();
6717+
let buf = terminal.backend().buffer().clone();
6718+
let dump: String = buf.content().iter().map(|c| c.symbol()).collect();
6719+
assert!(dump.contains("End Session"));
6720+
assert!(dump.contains("Goals"));
6721+
assert!(dump.contains("Tokens"));
6722+
assert!(dump.contains("Efficiency"));
6723+
assert!(dump.contains("phonton -r"));
6724+
}
6725+
65886726
#[test]
65896727
fn detects_real_api_keys_but_not_goals() {
65906728
// Provider-prefix keys must be caught.

‎release-notes/v0.4.8.md‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Phonton CLI v0.4.8
2+
3+
TUI polish release for memory labels, splash rendering, and exit summaries.
4+
5+
## Fixed
6+
7+
- Worker rows hide the internal `# Prior context from memory` preamble and display the actual subtask label.
8+
- The PHONTON splash keeps the same ASCII art and gradient palette while using a stable logo phase to avoid gradient-animation artifacts.
9+
10+
## Changed
11+
12+
- The exit confirmation modal now includes a session summary with goal counts, token totals, estimated savings, and `phonton -r` resume behavior.
13+
14+
## Verification
15+
16+
- `cargo fmt --all -- --check`
17+
- `cargo clippy --locked --workspace --all-targets -- -D warnings`
18+
- `cargo test --locked --workspace`
19+
- `cargo build --release --locked -p phonton-cli`

0 commit comments

Comments
 (0)