pi-cc-extensions 0.9.5 → 0.9.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.en.md CHANGED
@@ -29,7 +29,7 @@ Run `/reload` after installation.
29
29
  | --------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------- |
30
30
  | Claude Code UI | Tool summaries, expand/collapse, rich edit/write diffs, and `on` / `compact` / `off` modes | `/ccstyle` |
31
31
  | Markdown enhancements | Mermaid diagrams, admonitions, URL linking, and more | Automatic |
32
- | Fullscreen mode | Tool card/group expand and collapse, previews, hover highlight, and a back-to-bottom button | `TUIMODE=fullscreen` or `--tui-mode fullscreen` |
32
+ | Fullscreen mode | Tool card/group expand and collapse on click, previews, hover highlight, and a back-to-bottom button | `TUIMODE=fullscreen` or `--tui-mode fullscreen` |
33
33
  | Settings panel | `Style / Features / UI / Diff / Thinking / Footer` tabs | `/ccstyle` |
34
34
  | Context inspection | Usage breakdown and previews for the system prompt, memory, skills, tools definition, and messages | `/context` |
35
35
  | Session/Subagent references | Search and inject effective context from previous Sessions or existing SubAgents | `@` |
@@ -89,7 +89,7 @@ Renderer snapshots for `on` / `compact` modes: [default](./docs/tool-render-exam
89
89
  ```
90
90
 
91
91
  > [!TIP]
92
- > **Fullscreen**: click `click to show more` to expand tool cards, thinking, Skill, and compact summaries. An expanded diff always shows every line; when expanded Input/Output exceeds the line cap, the footer `… +N more lines • click to show more` opens a full preview. Double-click an expanded panel to collapse it.
92
+ > **Fullscreen**: click `click to show more` to expand tool cards, thinking, Skill, and compact summaries. An expanded diff always shows every line; when expanded Input/Output exceeds the line cap, the footer `… +N more lines • click to show more` opens a full preview. Click to collapse (dragging inside the card selects text).
93
93
 
94
94
  > [!NOTE]
95
95
  > **Mermaid rendering**: set `markdown.mermaid` to `final` via `~/.pi/agent/settings.json` or the Mermaid diagrams option in `/settings`. Default `streaming` redraws per frame; `final` renders once at completion.
package/README.md CHANGED
@@ -29,7 +29,7 @@ pi install git:github.com/minuque/pi-cc-extensions
29
29
  | --------------------- | ------------------------------------------------------------------------------- | ----------------------------------------------- |
30
30
  | Claude Code UI | 工具摘要、折叠展开、rich edit/write diff,以及`on` / `compact` / `off` 三种模式 | `/ccstyle` |
31
31
  | Markdown 增强 | Mermaid 图、提示框、URL 链接化等 | 自动生效 |
32
- | Fullscreen mode | 工具卡/group 单击展开、双击收起、预览、hover 高亮、回到底部按钮 | `TUIMODE=fullscreen` 或 `--tui-mode fullscreen` |
32
+ | Fullscreen mode | 工具卡/group 单击展开与收起、预览、hover 高亮、回到底部按钮 | `TUIMODE=fullscreen` 或 `--tui-mode fullscreen` |
33
33
  | 配置面板 | `Style / Features / UI / Diff / Thinking / Footer` 六页签 | `/ccstyle` |
34
34
  | 上下文检查 | 查看上下文占用,并预览 System prompt、Memory、Skills、Tools definition 和消息内容 | `/context` |
35
35
  | Session/Subagent 引用 | 搜索并注入历史 Session 或现有 SubAgent 的有效上下文 | `@` |
@@ -89,7 +89,7 @@ pi install git:github.com/minuque/pi-cc-extensions
89
89
  ```
90
90
 
91
91
  > [!TIP]
92
- > **全屏模式**:单击 `click to show more` 展开工具卡、思考、Skill 和 compact 摘要;工具卡展开态 diff 全量显示,Input/Output 超行时末行 `… +N more lines • click to show more` 打开全量预览,双击展开面板收起。
92
+ > **全屏模式**:单击 `click to show more` 展开工具卡、思考、Skill 和 compact 摘要;工具卡展开态 diff 全量显示,Input/Output 超行时末行 `… +N more lines • click to show more` 打开全量预览,单击收起(卡内拖动为选中文本)。
93
93
 
94
94
  > [!NOTE]
95
95
  > **Mermaid 渲染**:建议把 `markdown.mermaid` 设为 `final`(`~/.pi/agent/settings.json` 或 `/settings` 面板的 Mermaid diagrams 选项)。默认 `streaming` 逐帧重绘,`final` 渲染最终版更稳定。
@@ -323,7 +323,7 @@ function hiddenPreviewHint(
323
323
 
324
324
  const expandedThinking = new Set<number>();
325
325
 
326
- /** 折叠预览 + 展开全文。fullscreen 点击 hint 展开、双击整块收起,对齐工具卡。 */
326
+ /** 折叠预览 + 展开全文。fullscreen 点击 hint 展开、展开卡单击整块收起(拖动选择文本时不收起)。 */
327
327
  export class ThinkingPreviewBlock implements Component {
328
328
  private heading: string;
329
329
  private text: string;
@@ -1,4 +1,10 @@
1
1
  import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
2
+ import { getCompactRunStatusText } from "../../renderer/compact-mode.ts";
3
+ import {
4
+ fullscreenLazyTui,
5
+ getToolMouseTui,
6
+ isFullscreenAtBottom,
7
+ } from "../../renderer/mouse/scroll.ts";
2
8
  import { formatDuration } from "../../utils/format.ts";
3
9
 
4
10
  const REFRESH_INTERVAL_MS = 1_000;
@@ -84,11 +90,24 @@ export default function (pi: ExtensionAPI): void {
84
90
  if (output > 0) providerOutputTokens = output;
85
91
  }
86
92
 
93
+ /**
94
+ * 摘要行滚出视口才镜像:仅 fullscreen 且已离开 transcript 底部。
95
+ * regular 没有“离开底部”信号(transcript 在终端回滚区),保持 Pi 默认文案。
96
+ */
97
+ function compactMirrorText(): string | undefined {
98
+ const tui = getToolMouseTui();
99
+ if (!tui || !fullscreenLazyTui(tui) || isFullscreenAtBottom(tui)) return undefined;
100
+ return getCompactRunStatusText();
101
+ }
102
+
87
103
  function buildWorkingMessage(): string {
88
- const elapsed = Date.now() - (agentStartTime || turnStartTime);
89
- const tokens = tokenCount();
90
104
  const parts: string[] = [];
105
+ const tokens = tokenCount();
91
106
  if (tokens > 0) parts.push(`↓ ${formatCount(tokens)} tokens`);
107
+ // compact 活动回合且已滚出摘要行:直接用摘要行文案(自带回合时长,不叠 agent 计时)。
108
+ const compactStatus = compactMirrorText();
109
+ if (compactStatus) return [compactStatus, ...parts].join(" · ");
110
+ const elapsed = Date.now() - (agentStartTime || turnStartTime);
92
111
  if (elapsed >= SHOW_TIMER_AFTER_MS || tokens > 0) {
93
112
  // formatDuration 低于 1 秒返回 "",此处回退 "0s" 保持计时器连续跳动。
94
113
  parts.push(formatDuration(elapsed) || "0s");