Skip to content

feat(tui): name each approval once and open the inspector only with content (ENG-1071) - #360

Closed
lg2m wants to merge 33 commits into
feat/eng-1070-tui-session-pickerfrom
feat/eng-1071-tui-one-place
Closed

lg2m wants to merge 33 commits into
feat/eng-1070-tui-session-pickerfrom
feat/eng-1071-tui-one-place

Conversation

@lg2m

@lg2m lg2m commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

F4–F5: name each approval once and open the inspector only with content

Spec: docs/plans/tui-focus.md#f4f5-one-place-per-fact-panes-on-demand Linear: ENG-1071 (parent ENG-1067)
Stacked on #358.

What changed

  • Inspector on demand. compute_layout takes LayoutDemand { sessions, inspector_content }. Auto shows the inspector from Wide only while the focused pane has an expanded tool call or a workspace view (/attention, /changes); otherwise its 40–80 columns go back to the transcript. Alt-I → Shown still pins it (empty hint kept).
  • One place per fact. The composer rule names a waiting approval only when the rail is not on screen (Compact, single session, rail hidden). With the rail up, the rail's ↳ ◇ row names it and the rule leads with M-A/M-D answer ^G jump.
  • related sessions (agents not under a spawn call) collapses to one row: ↳ 1 agent · ◐ 1 · ◇ 1 /agents.
  • The top row omits a known zero cost ($0.00).

How verified

cargo xtask check

Head a90638fe8359 vs origin/main; 85 changed file(s); scope: qq, qq-tui, xtask.

Gate Result Tests Time Command
fmt pass 1.6s cargo fmt --all -- --check
lint pass 2.2s cargo xtask lint
clippy pass 4.9s cargo clippy --color never -p qq -p qq-tui -p xtask --all-targets --all-features -- -D warnings
test fail 843/844 passed, 3 skipped 72.8s cargo nextest run --color never --profile default -p qq -p qq-tui -p xtask
  • qq headless::tests::closing_goal_host_drains_accepted_work_without_admitting_successors: panicked at src/headless.rs:4553:18

The one failure is the pre-existing wall-clock flake ENG-1074 (fails identically on origin/main on this loaded host; passed in CI on #356; src/headless.rs untouched). All 404 qq-tui tests pass.

  • New: a_waiting_approval_is_named_once_per_frame_outside_its_transcript (Regular with rail, rail hidden, Compact), the_top_row_omits_a_known_zero_cost; wide_carves_an_inspector_past_the_measure now covers empty-Auto-hides and Shown-pins; inspector/workspace/related tests updated.
  • Goldens: 65 moved deliberately (no $0.00; no empty inspector at 200/320/480 so the transcript regains the width; summary row; rule chords).

Measurements

cargo bench -p qq-tui --bench render medians (raw: target/qq-perf/tui-focus-F4-2026-10-18/), vs #356:

Gate Before After
steady_state_frame 22.4 µs 22.0 µs
steady_state_with_sidebar 34.1 µs 33.7 µs
streaming_focused 35.5 µs 35.3 µs
streaming_run_on_32kb 438.5 µs 420.9 µs
golden_path_first_minute 39.5 µs 38.8 µs
resize_horizontal 30.6 µs 30.4 µs
resize_ultra_480x120 125.2 µs (stack base) 101.2 µs

Docs

  • docs/design/layout.md § Principles, § Tiers, § Inspector; docs/guide/tui.md § Layout, § Files the agents changed; ledger receipt.

Compatibility

  • PROTOCOL / DESCRIPTOR / schema: unchanged. No new dependencies.

…ontent (ENG-1071)

Slice F4-F5 of docs/plans/tui-focus.md. Auto inspector needs an expanded call or a workspace view; the rule names a waiting approval only when the rail is off-screen; related sessions collapse to one summary row; the top row drops a known zero cost.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T08:13:03.244698Z fb9f041 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lg2m

lg2m commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@lg2m
lg2m added this pull request to stack #357 October 19, 2026 05:04

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a90638fe83

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/qq-tui/src/view/chrome.rs Resolved
Comment thread crates/qq-tui/src/view/chrome.rs Resolved
…i-one-place

Also: the rule names waiting approvals the rail did not paint (capped or scrolled out), so each is named exactly once.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

1 similar comment
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@lg2m

lg2m commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d38566052b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/qq-tui/src/view/layout.rs Resolved
lg2m added 2 commits October 18, 2026 23:11
…i-one-place

# Conflicts:
#	docs/plans/progress/tui-focus.md
…tent-gated inspector (ENG-1071)

Addresses Codex on #360 (layout.md inspector section) and the #354 plan rule: delegate-owned holds are not named, a failed or unseen agent whose row is off-screen is named on the rule. Merges the F1-F3 review fixes.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

1 similar comment
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@lg2m

lg2m commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

match waiting.as_slice() {
[one] => format!("{one} needs approval"),
[first, rest @ ..] => format!("{first} +{} need approval", rest.len()),

P2 Badge Reserve room for the off-rail approval count

When two or more approvals are off the rail and the first session has a long title—for example on a Compact terminal—this formats the title and +N need approval as one string, after which rule_with truncates from the right. The count and answer/jump hints therefore disappear before the title is shortened, leaving no indication that additional approvals are waiting despite the F4–F5 requirement to truncate the name before the count. Truncate the first title to a budget that reserves space for the count and controls.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/qq-tui/src/view/chrome.rs Resolved
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@lg2m

lg2m commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 989fd25029

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/qq-tui/src/view/chrome.rs Resolved
Comment thread crates/qq-tui/src/view/chrome.rs Resolved
Comment thread crates/qq-tui/src/view/transcript.rs Resolved
lg2m added 2 commits October 18, 2026 23:56
…nswer chords on a full rule (ENG-1071)

Addresses the second Codex review on #360: Alt-A/Alt-D, Ctrl-G and the related-agents summary skip delegate-owned holds; when the rail names every approval the rule drops ordinary hints and truncates the status before the approval chords. Merges the F1-F3 fixes.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@lg2m

lg2m commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3375d38753

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/qq-tui/src/view/transcript.rs Resolved
lg2m added 3 commits October 19, 2026 10:21
…i-one-place

# Conflicts:
#	crates/qq-tui/src/app.rs
…ces, drop the third pointer (ENG-1071)

Addresses Codex on #360 and the fourth #354 round: unseen session failures and scrolled-out agents are named or counted on the rule, a notice no longer hides the answer chords, and the related-agents row counts work by the rail's rules with no approval count. Merges F1-F3 fixes.
lg2m added 2 commits October 19, 2026 16:02
…eed at minimum width, document LayoutDemand (ENG-1071)

Addresses the latest Codex review on #360.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

1 similar comment
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@lg2m

lg2m commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2361601223

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/qq-tui/src/view.rs Resolved
Comment thread crates/qq-tui/src/view/sidebar.rs Resolved
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

1 similar comment
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@lg2m

lg2m commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e75fe013b7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/qq-tui/src/view.rs Resolved
lg2m added 2 commits October 19, 2026 20:46
… strip under a notice (ENG-1071)

A drawn card row carries its child's SessionId, so message text shaped
like a card no longer suppresses the rule's naming. With the strip on
screen a transient notice keeps the answer and jump chords but no second
count; without it a long notice truncates so the pointer stays.

Addresses the 11th Codex review on #360 and #354.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

1 similar comment
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@lg2m

lg2m commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0699f1b76f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/qq-tui/src/view/sidebar.rs Outdated
// title happens to start with, sits at another column and does
// not count, and a title squeezed to its ellipsis is gone.
let title = &app.sessions[&id].summary.title;
let want: String = title.chars().take(2).collect();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Count a one-cell title as visible

When a 20-column rail's agent, working, and unread badges leave exactly one cell of a multi-character title, the row visibly renders that first character before the ellipsis, but this two-character predicate treats it as unnamed. The composer therefore repeats the same approval even though the rail's title span retained a cell, violating the one-place-per-fact contract. Fresh evidence beyond the settled fully-clipped-title cases is this partially visible one-cell title; detect whether the title span retained any cell rather than requiring its first two characters.

AGENTS.md reference: AGENTS.md:L207-L207

Useful? React with 👍 / 👎.

lg2m added 6 commits October 19, 2026 22:18
…i-one-place

# Conflicts:
#	crates/qq-tui/src/view/chrome.rs
#	docs/plans/progress/tui-focus.md
…ne title cell names a rail row (ENG-1071)

The frame commits the sessions it named outside the rule; Alt-A/Alt-D
answer the first waiting approval not among them, the one the rule names
beside the chords.

Addresses the 11th Codex review on #360 and a pre-review of #354.
…i-one-place

# Conflicts:
#	crates/qq-tui/src/app.rs
#	crates/qq-tui/src/view.rs
#	crates/qq-tui/src/view/tests.rs
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fb9f041baf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}
column += UnicodeWidthChar::width(character).unwrap_or_default();
}
column >= title_column && text[at..].starts_with(want.as_str())

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Distinguish the ellipsis from a visible title

When a waiting session title begins with . and the rail badges leave no cells for the title, truncate_line places ... at title_column, so this string comparison mistakes the generated ellipsis for the title's first character. The fresh evidence beyond the prior marker and badge collision cases is this truncation-generated text: the composer suppresses the only named approval notice even though the rail shows no title. Track whether the title span retained a display cell instead of comparing rendered text.

Useful? React with 👍 / 👎.

Comment thread crates/qq-tui/src/view.rs
Comment on lines +209 to +210
app.frame_named = std::mem::take(&mut self.named);
app.frame_carded = std::mem::take(&mut self.carded);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Clear frame naming state on undersized frames

When the terminal is resized below 32×9 after a frame containing a named rail row or child card, the undersized-frame return clears rail_painted and drawn but leaves the renderer's new named and carded vectors intact; commit therefore copies stale visibility into these app fields. Keyboard commands are still handled on the warning screen, so Alt-A/Alt-D can treat an old card as painted and answer an approval whose title is no longer visible. Clear both naming vectors before returning the undersized frame.

Useful? React with 👍 / 👎.

@lg2m

lg2m commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator Author

Closing in favor of the v0.1.11 TUI plan (ENG-1104, docs/plans/0.1.11.md). This PR's design is carried into section D (ENG-1108: https://linear.app/retsu-ai/issue/ENG-1108), and its unresolved review findings are listed there as required tests. The code will be redone against main, because this stack no longer merges cleanly.

@lg2m lg2m closed this Oct 29, 2026
@lg2m
lg2m deleted the feat/eng-1071-tui-one-place branch October 29, 2026 04:35
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.

1 participant