Repository navigation
feat(tui): fold completed turns into activity sections - #121
openjiuwen-release-bot[bot] merged 2 commits into
Conversation
Keep user messages, injected messages and final replies visible while folding successful turn activity by default. Support keyboard access through /fold and a setting to control automatic folding. Release collapsed thinking bodies, preserve transcript order and copy behavior, and bound foreground history replay. Keep unfinished turns visible and label compressed activity without incomplete tool counts. A compressed turn that ended on a failure status stays unfolded even though compressed history omits the status itself.
Newer Claude models return no thinking text unless the request asks for
it. Use `{"type": "adaptive", "display": "summarized"}` in the Chat
Options example, and explain that iCode's "Show model thinking" setting
only controls whether returned text is shown.
|
head_sha: 变更摘要本 PR 为 TUI 聊天视图引入“已成功轮次自动折叠”:新增 主要改动
|
|
head_sha: 代码审查审查结论
💬 仅评论 |
|
head_sha: 🟡 Medium Priority 改动行:panel.py 新增 证据链:
失败模式:在折叠/展开、连续两次回放或同一轮次里对该 anchor 多次插入活动块时,选中顺序(复制顺序、拖选高亮)与屏幕顺序不一致;触发条件依赖 建议:上界改为按 DOM 顺序取 anchor 的实际后继兄弟(而不是全表最小后继键),并对同一 anchor 的重复插入使用上一次插入的兄弟键作为 previous,确保顺序键与显示顺序一致。 |
|
head_sha: 不成立 |
0a03093
into
openJiuwen-ai:main
|
🤖 This pull request has been merged, and the target branch is up to date. |
[mirror] #121: feat(tui): fold completed turns into activity sections Created-by: openjiuwen-sync Commit-by: Jiaqi (0x7c13) Liu Merged-by: Ox7c13 Description: Paired: [GitHub #121](#121) ↔ [GitCode !88](https://gitcode.com/openJiuwen/iCode/merge_requests/88) <!-- bot1-mirror-meta --> github_pr: 121 head_repo: 0x7c13/iCode head_ref: dev/0x7c13/tui-fold-finished-turns head_sha: d787324 base_repo: openJiuwen-ai/iCode base_ref: main github_repo: openJiuwen-ai/iCode base_branch: main base_sha: 2ced1be github_user: 0x7c13 <!-- /bot1-mirror-meta --> GitHub PR mirror for CodeArts CI. <!-- bot1-source-body --> ## Summary **Successful turns fold their activity under a one-line header.** - A turn that ends with a final reply folds its thinking, intermediate replies, tool groups, and the retry and error notices it recovered from. They sit under **Made N tool calls**, or **Activity** when that section made no tool calls. Clicking the header expands it. Tool groups and thinking inside keep their own state. - The user message, each injected message and the final reply stay visible. Each injected message starts its own section. - These turns stay open: turns that end interrupted, failed or waiting for sub-agents, and the last turn recovered from a crash sidecar. A section holding only one thinking block keeps that block's own header and just collapses it. - Restored sessions fold the same way. Compressed history keeps only some tool details, so its sections all read **Activity**. A compressed turn that ended on a failure status stays open, even though compressed history does not show the status. - `/fold` toggles activity sections, tool groups and thinking together, which gives keyboard users a way to open a section. The header takes no focus and adds no Tab stop. - New setting **Automatically fold completed turns** (`ui.chat.fold_finished_turns`). It sits under Appearance, defaults to on, applies live and is not read from project settings. Copy commands still include intermediate replies and keep their message counts. **Long sessions do less layout and hold less in memory.** - Folded members are hidden with `display`, so they take no layout. Collapsed thinking releases its rendered body, reclaimed through the GC freeze epoch, and rebuilds it when opened. - Tail-first replay counts a hidden entry as 0 rows and a header as 1 row. It caps the first mount at 32 visible and 128 total entries. - Transcript order keys are now `Fraction`s, so a header goes in after its anchor without renumbering. Copy and selection order are unchanged. **Docs: readable Claude thinking summaries** (separate commit). - The Anthropic Chat Options example now uses `{"type": "adaptive", "display": "summarized"}`. The page explains that **Show model thinking** only controls whether returned text is shown, and `models.md` links to it. Both en and zh-Hans are updated. ## Test plan - [x] **New tests:** - `tests/app/tui/widgets/chat/test_process_folding.py`: live and replayed folding, injected messages, failure and status endings (compressed history included), crash-sidecar protection, setting changes, folds waiting on running tools or questions, and `/fold`. - `tests/app/tui/screens/main/test_process_folding.py`: fifty completed turns fold without a global restyle or recompose of the main screen. - `tests/app/tui/widgets/chat/test_thinking_body_release.py`: collapsing releases the thinking body with an epoch-aware reclaim, and a fast collapse and expand keeps one body. - [x] **Updated tests:** tail-first replay budgets; live and replayed thinking; the settings layout, dialog and coordinator; command-suggestion i18n. - [x] Tests pass locally (Smart Test over every file in both commits: 33,163 passed, 60 skipped; 1,241 architecture checks passed). - [x] **Gates:** `ruff check`, `ruff format --check`, `ty check` (linux, darwin, win32) and `scripts/i18n.py check`. The user guide is updated: sessions, settings, the settings reference and slash commands (en and zh-Hans). <!-- /bot1-source-body --> See merge request: openJiuwen/iCode!88
[mirror] #124: chore(release): bump version to 0.32.0 Created-by: openjiuwen-sync Commit-by: Jiaqi (0x7c13) Liu Merged-by: Ox7c13 Description: Paired: [GitHub #124](#124) ↔ [GitCode !91](https://gitcode.com/openJiuwen/iCode/merge_requests/91) <!-- bot1-mirror-meta --> github_pr: 124 head_repo: 0x7c13/iCode head_ref: dev/release-0.32.0 head_sha: c9d1882 base_repo: openJiuwen-ai/iCode base_ref: main github_repo: openJiuwen-ai/iCode base_branch: main base_sha: e225cb1 github_user: 0x7c13 <!-- /bot1-mirror-meta --> GitHub PR mirror for CodeArts CI. <!-- bot1-source-body --> Bump iCode to 0.32.0 so a release is cut from current `main`. ## Changes - `pyproject.toml` and `uv.lock`: the package version moves from 0.31.0 to 0.32.0. - i18n catalogs (`locales/chrys.pot`, `locales/zh-Hans/LC_MESSAGES/chrys.po`, the compiled `chrys.mo`): the `Project-Id-Version` header now says 0.32.0. No message changes. ## Release Merging this changes the version in `pyproject.toml` on `main`, so `tag-release.yml` creates the `v0.32.0` tag and starts `cd.yml` for that tag. This is the first release whose Linux offline binaries bundle Pillow 13.0.0, from the glibc 2.17 wheels published as `pillow-13.0.0-manylinux2014.1` (#122, #123). ## Included since 0.31.0 - #123 Pillow 13.0.0 and pypdf 6.21.2 (pypdf security fixes); the Linux offline binaries take the matching glibc 2.17 Pillow wheels - #122 the manylinux2014 Pillow wheel workflow builds 13.0.0 on patched build images, with every source archive pinned by SHA-256 (build-only); hook indicator tests stabilized - #121 completed turns fold into activity sections; the docs show how to request readable Claude thinking summaries - #120 the prompt editor asks for confirmation before its Discard button closes it - #111 a sidebar Hooks tab lists every hook run, and each run is recorded once - GitCode !85 the main chat shows the model's thinking as it streams; a resumed session replays it folded, and `/fold` folds it too - GitCode !84 the chat follows new content only while you are at the bottom - GitCode !83 a hook run log cut to size keeps file paths that are not valid UTF-8 intact - GitCode !82 faster startup: a loading screen with the logo paints before the main screen and agent load, and F12 works again once the agent is ready ## Verification - `uv lock --check` passes. - `scripts/i18n.py extract/update/compile/check` runs clean, and a second run changes nothing. - Tests were not run locally; CI covers them. <!-- /bot1-source-body --> See merge request: openJiuwen/iCode!91
Paired: GitHub #121 ↔ GitCode !88
Summary
Successful turns fold their activity under a one-line header.
/foldtoggles activity sections, tool groups and thinking together, which gives keyboard users a way to open a section. The header takes no focus and adds no Tab stop.ui.chat.fold_finished_turns). It sits under Appearance, defaults to on, applies live and is not read from project settings. Copy commands still include intermediate replies and keep their message counts.Long sessions do less layout and hold less in memory.
display, so they take no layout. Collapsed thinking releases its rendered body, reclaimed through the GC freeze epoch, and rebuilds it when opened.Fractions, so a header goes in after its anchor without renumbering. Copy and selection order are unchanged.Docs: readable Claude thinking summaries (separate commit).
{"type": "adaptive", "display": "summarized"}. The page explains that Show model thinking only controls whether returned text is shown, andmodels.mdlinks to it. Both en and zh-Hans are updated.Test plan
tests/app/tui/widgets/chat/test_process_folding.py: live and replayed folding, injected messages, failure and status endings (compressed history included), crash-sidecar protection, setting changes, folds waiting on running tools or questions, and/fold.tests/app/tui/screens/main/test_process_folding.py: fifty completed turns fold without a global restyle or recompose of the main screen.tests/app/tui/widgets/chat/test_thinking_body_release.py: collapsing releases the thinking body with an epoch-aware reclaim, and a fast collapse and expand keeps one body.ruff check,ruff format --check,ty check(linux, darwin, win32) andscripts/i18n.py check.The user guide is updated: sessions, settings, the settings reference and slash commands (en and zh-Hans).