Skip to content

fix(tui): 对齐 pi 现有界面并更新 README 示例图 - #28

Merged
kkkiio merged 10 commits into
mainfrom
align-tui-pi
Oct 3, 2026
Merged

kkkiio merged 10 commits into
mainfrom
align-tui-pi

Conversation

@kkkiio

@kkkiio kkkiio commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

工具调用块原来的 ANSI 全量 reset 会清掉背景,bash 也使用了手动 shell 模式的绿色边框。对照 pi v0.87.1,将现有 TUI 的工具卡片、Markdown、思考段、输入状态与 footer 对齐,并重新渲染 README 示例图。

  • 工具卡片使用 pending / success / error 背景,保留粗体和嵌入 ANSI 后的背景;bash 折叠为最后 5 个可见行,显示截断路径、限制和实时耗时。
  • 使用 pi-tui Markdown 及语义主题色;保留 text/thinking 顺序,支持单块点击展开及全局切换。
  • 对齐 thinking 档位边框、重试倒计时、多行输入溢出提示、启动帮助、搜索和滚动提示。
  • Footer 累计会话用量、保留最近模型缓存命中率,恢复会话名和用量;回合结束刷新分支。
  • 必需 theme role 保留 struct field,并在载入时检查。README 删除实现自证说明。

代码块与 read 输出语法高亮保留 TODO。本 PR 不涉及 hosted tool、tool stream update、steer/follow-up。上下文窗口和自动压缩没有已接入的数据源,继续省略。

验证:moon check --deny-warn、moon fmt、moon test(83/83)、moon build、离线 CLI cram(13/13)和 npm 打包通过。使用隔离配置、离线示例 journal 及公共 TuiApp API 在 tmux 验证真实终端画面,检查工具三种状态、单块点击、全局展开、隐藏思考、搜索、slash 补全、42 列重试和多行溢出;另覆盖大型工具参数截断、渲染缓存更新、bash 首尾空白保留及部分行字节提示、恢复 compaction/独立 usage 用量和失败回合缓存命中率、标题标签净化及 Markdown 缩进代码块。README 图片来自打包后的 CLI 会话回放。未调用真实 provider。

pim TUI 示例

Preserve status backgrounds, themed Markdown and ordered thinking blocks.
Align tool previews, click expansion, editor status, search and session footer.
Leave code syntax highlighting as a TODO.

Amp-Thread-ID: https://ampcode.com/threads/T-01a10215-6e2e-745a-b580-d43025942731
Co-authored-by: Amp <amp@ampcode.com>

@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: 8859639a6c

ℹ️ 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 tui_app/footer.mbt Outdated
Comment thread tui_app/transcript.mbt Outdated
Comment thread tui_app/style.mbt Outdated
Comment thread tui_app/component.mbt
Preserve bash whitespace and restore backgrounds after combined SGR resets.
Cache historical Markdown by content, width, display role and color capability.
Test footer through TuiApp terminal output and keep its renderer private.

Amp-Thread-ID: https://ampcode.com/threads/T-01a10215-6e2e-745a-b580-d43025942731
Co-authored-by: Amp <amp@ampcode.com>
@kkkiio

kkkiio commented Oct 3, 2026

Copy link
Copy Markdown
Owner Author

@codex review

已修复上一轮四项反馈:Footer Widget 实现恢复私有,测试改为捕获公共 TuiApp 的终端输出;保留 bash 前导空格与尾部空行;处理省略参数及组合 SGR reset,并跳过 RGB 色值中的零;缓存历史 Markdown,内容、宽度、显示角色或颜色能力变化时重算。

本地 78 个单元测试、13 个 CLI 契约用例、检查、构建及 npm 打包通过。缩进输出和组合 reset 的背景已在真实终端截图验证。请审查最新提交。

@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: 9107bcf0ed

ℹ️ 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 tui_app/transcript.mbt Outdated
@kkkiio

kkkiio commented Oct 3, 2026

Copy link
Copy Markdown
Owner 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: 2b38588a2c

ℹ️ 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 tui_app/transcript.mbt
Comment thread tui_app/session_host.mbt
@kkkiio

kkkiio commented Oct 3, 2026

Copy link
Copy Markdown
Owner 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: 5c9b7d3a6f

ℹ️ 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 tui_app/transcript.mbt Outdated
@kkkiio

kkkiio commented Oct 3, 2026

Copy link
Copy Markdown
Owner 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: f1fc54ba42

ℹ️ 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 tui_app/session_host.mbt
Comment thread tui_app/app.mbt
@kkkiio

kkkiio commented Oct 3, 2026

Copy link
Copy Markdown
Owner 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: 0bce39dfe1

ℹ️ 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 tui_app/session_host.mbt Outdated
@kkkiio

kkkiio commented Oct 3, 2026

Copy link
Copy Markdown
Owner 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: ef6bbda621

ℹ️ 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 tui_app/transcript.mbt Outdated
@kkkiio

kkkiio commented Oct 3, 2026

Copy link
Copy Markdown
Owner 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: 6ee1a50ec2

ℹ️ 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 tui_app/app.mbt
kkkiio and others added 2 commits October 4, 2026 01:56
Add just screenshot, an offline journal fixture, tmux capture and Freeze config.

Amp-Thread-ID: https://ampcode.com/threads/T-01a10215-6e2e-745a-b580-d43025942731
Co-authored-by: Amp <amp@ampcode.com>
Normalize persistent tmux SGR state for Freeze before rendering the PNG.

Amp-Thread-ID: https://ampcode.com/threads/T-01a10215-6e2e-745a-b580-d43025942731
Co-authored-by: Amp <amp@ampcode.com>
@kkkiio
kkkiio merged commit ea4d881 into main Oct 3, 2026
2 of 3 checks passed
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