{"id":"chat-view","repo":"lyhu/paseo-plugin-chat-view","url":"https://github.com/lyhu/paseo-plugin-chat-view","package":"paseo-plugin-chat-view","npm":{"package":"paseo-plugin-chat-view","version":"0.1.0","integrity":"sha512-r4ihKzxgQvxn68caKuipOsmW3e5oLX2TeC7fOpFe8EXOHCk6OpWFszgXdhKDQmX+7XxAQIdqXSxhzuh+0nejXA==","publishedAt":"2026-10-07T13:43:06.816Z","downloadsLast30Days":0},"name":"chat-view","description":"Sticky questions and compact agent activity inside Paseo conversations","categories":["productivity"],"platforms":[],"caveats":["Sticky questions require a DOM and are unavailable on native mobile; compact activity and Mermaid still work there.","Prompt enhancement needs its own OpenAI-compatible endpoint configured in settings and is off by default.","Do not enable alongside compact-agent-activity, reasoning-display, or paseo-plugin-mermaid — the timeline transformers conflict.","Enabling a host switch hides the matching control immediately; allow up to 2s for it to apply across clients."],"images":[],"themes":[],"health":{"manifestValid":true,"hasReadme":true,"hasLicense":true,"hasTests":true,"hasTypecheckScript":true,"updatedRecently":true},"scannedAt":"2026-10-07T14:01:10.096Z","addedAt":"2026-10-07T13:57:54Z","npmSecurity":{"status":"passed","blockingFindings":0,"advisoryFindings":0,"scannedAt":"2026-10-07T14:01:02.562Z","version":"0.1.0","integrity":"sha512-r4ihKzxgQvxn68caKuipOsmW3e5oLX2TeC7fOpFe8EXOHCk6OpWFszgXdhKDQmX+7XxAQIdqXSxhzuh+0nejXA=="},"version":"0.1.0","security":{"status":"passed","blockingFindings":0,"advisoryFindings":0,"scannedAt":"2026-10-07T14:01:02.562Z","commit":"9e28781cfd2457e044b20c6a8583468f9e3c6157"},"license":"MIT","paseoVersionRequirement":">=0.10.3 <0.12.0","descriptionNodes":[{"type":"text","text":"Sticky questions and compact agent activity inside Paseo conversations"}],"caveatNodes":[[{"type":"text","text":"Sticky questions require a DOM and are unavailable on native mobile; compact activity and Mermaid still work there."}],[{"type":"text","text":"Prompt enhancement needs its own OpenAI-compatible endpoint configured in settings and is off by default."}],[{"type":"text","text":"Do not enable alongside compact-agent-activity, reasoning-display, or paseo-plugin-mermaid — the timeline transformers conflict."}],[{"type":"text","text":"Enabling a host switch hides the matching control immediately; allow up to 2s for it to apply across clients."}]],"manifest":{"id":"chat-view","requirements":{"paseo":">=0.10.3 <0.12.0"}},"repoMeta":{"stars":0,"defaultBranch":"main","pushedAt":"2026-10-07T13:59:11Z"},"owner":{"login":"lyhu","avatarUrl":"https://avatars.githubusercontent.com/u/6790020?v=4"},"installNotesHtml":"<h3>Installation &#x26; Loading</h3>\n<p>This plugin is a local source package, installed directly through the Paseo CLI:</p>\n<pre><code class=\"language-bash\"></code></pre>","readmeText":"# Paseo Plugin: chat-view\n\n[English](README.md) | [简体中文](README_zh.md)\n\n> A Paseo interface enhancement plugin focused on reading and debugging efficiency in long conversations: **smart sticky questions for the current turn**, **compact aggregation of reasoning and tool calls**, and **interactive Mermaid diagram rendering**.\n\n---\n\n## Table of Contents\n\n- [Core Features](#core-features)\n- [Platform Support & Compatibility Matrix](#platform-support--compatibility-matrix)\n- [Host Configuration Prerequisites](#host-configuration-prerequisites)\n- [Quick Start](#quick-start)\n  - [Installation & Loading](#installation--loading)\n  - [Maintenance Commands](#maintenance-commands)\n- [Feature Details](#feature-details)\n  - [1. Sticky Questions](#1-sticky-questions)\n  - [2. Compact Activity](#2-compact-activity)\n  - [3. Interactive Mermaid Diagrams](#3-interactive-mermaid-diagrams)\n  - [4. Prompt Enhancement](#4-prompt-enhancement)\n- [Plugin Settings Guide](#plugin-settings-guide)\n- [Architecture & Technical Boundaries](#architecture--technical-boundaries)\n- [Project Structure](#project-structure)\n- [Local Development & Testing](#local-development--testing)\n- [Credits & Licenses](#credits--licenses)\n\n---\n\n## Core Features\n\n| Feature                   | Description                                                                                                                             | Highlights                                                                                              |\n| :------------------------ | :-------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------ |\n| 📌 **Sticky Questions**   | Pins the current turn's user question to the top of the viewport while scrolling through a long conversation.                           | 100ms viewport debounce, native visual inheritance, default 3-line auto fold, one-click full-text copy. |\n| ⚡ **Compact Activity**   | Shows a single-line activity summary by default (compact-agent-activity Folded mode); a click expands thoughts and tool details inline. | Smooth reasoning text, click-to-expand command output, code diffs, first-frame syntax highlighting.     |\n| 📊 **Mermaid Diagrams**   | Built-in Mermaid parser and renderer that turns diagram code blocks into high-quality visual charts.                                    | 25%–400% free zoom, fit-to-width, seamless source/diagram toggle, full-screen preview.                  |\n| ✨ **Prompt Enhancement** | Rewrites a vague composer request into an executable prompt complete with goal / scope / constraints / acceptance, and writes it back.  | One-click enhance, project-environment aware, click again to undo to the original text.                 |\n\n> [!NOTE]\n> **Design philosophy**: zero backend intrusion and strictly built on the public Paseo SDK; user questions and ordinary assistant answers keep Paseo's native fork and copy functionality in full.\n\n---\n\n## Platform Support & Compatibility Matrix\n\n| Platform / Runtime                | Sticky Questions | Compact Activity | Mermaid Diagrams | Experience details                                                                         |\n| :-------------------------------- | :--------------: | :--------------: | :--------------: | :----------------------------------------------------------------------------------------- |\n| **Desktop (Electron / Desktop)**  |   ✅ Supported   |   ✅ Supported   |   ✅ Supported   | DOM-level line spacing tightening, image size constraints (max 440 × 320).                 |\n| **Web browser**                   |   ✅ Supported   |   ✅ Supported   |   ✅ Supported   | Full viewport observation and DOM interaction.                                             |\n| **Native mobile (iOS / Android)** | ⏸️ Not supported |   ✅ Supported   |  ✅ Supported\\*  | Built on standard React Native; no DOM line-spacing tuning (on-device validation pending). |\n\n> [!WARNING]\n> **Plugin conflict notice**:\n> Do not enable this plugin together with `compact-agent-activity`, `reasoning-display`, or the standalone `paseo-plugin-mermaid`, otherwise multiple timeline transformers may conflict with or overwrite each other.\n\n---\n\n## Host Configuration Prerequisites\n\nFor compact activity to parse full tool-call arguments and results, change the Paseo host setting:\n\n> [!IMPORTANT]\n> In the Paseo host settings, set **Tool call detail** to **Detailed**.<br>\n> _If it is set to `Overview`, the host merges tool entries before the plugin takes over, so compact activity details cannot be collected correctly._\n\n---\n\n## Quick Start\n\n### Installation & Loading\n\nThis plugin is a local source package, installed directly through the Paseo CLI:\n\n```bash\n# 1. Install the plugin locally (current directory or an absolute plugin path)\npaseo plugin install .\n# Or: paseo plugin install /path/to/paseo-plugin-chat-view\n\n# 2. Check install and runtime status\npaseo plugin ls chat-view\n```\n\nOnce installed, open or refresh any agent conversation window for it to take effect.\n\n### Maintenance Commands\n\n- **Hot-reload the plugin** (takes effect immediately after source changes; **never restart the host daemon on port 6767**):\n  ```bash\n  paseo plugin reload chat-view\n  ```\n- **List plugins**:\n  ```bash\n  paseo plugin ls\n  ```\n\n---\n\n## Feature Details\n\n### 1. Sticky Questions\n\nWhile reading a long assistant response, you can see the question for the current context at any time without scrolling back up.\n\n```text\n+--------------------------------------------------------------+\n| [User question excerpt (up to 3 lines)...]            [More... / 📋] | <- Sticky bar (same width as the message body)\n+--------------------------------------------------------------+\n| (Assistant answer for this turn / tool execution keeps scrolling...) |\n| ...                                                          |\n```\n\n- **Lifecycle and controls**:\n  - Settings provide a per-host master switch for sticky questions, enabled by default. Disabling it also removes the composer pill of the same name; re-enabling restores it. The pill can temporarily turn sticky questions off or back on for a single conversation, with the master switch taking precedence.\n  - Sticky behavior is driven by mounting the toggle component and is independent of assistant-response render cycles.\n- **Trigger and switching rules**:\n  - Triggers when the turn's user question scrolls **completely out of the top of the viewport**.\n  - If **any pixel** of the question body remains in the viewport, the sticky bar hides immediately.\n  - Scrolling into the next turn switches to that turn's question; scrolling back up restores the previous one.\n  - A **~100ms absence confirmation** eliminates flicker during virtual-list repaints or boundary scrolling.\n  - The rule is the same at the very bottom of a conversation: the bar stays pinned only once the question has left the viewport.\n- **Visual style and adaptation**:\n  - The sticky bar aligns exactly with the message body width and fully inherits the native user bubble's background color, corner radius, padding, and font, adapting seamlessly to light and dark themes.\n  - **Adaptive folding**: shows at most 3 lines by default and offers a \"More…\" action for the rest; once expanded it scrolls independently inside the area and can be collapsed with \"Show less\". Switching turns resets it to the collapsed state.\n  - **Lossless full-text copy**: a copy icon embedded at the bar's bottom-right copies the complete question text of that turn (including the hidden part); it highlights slightly on hover and switches to a check mark for about 1.8 seconds after copying.\n\n### 2. Compact Activity\n\nActivity rendering is migrated from the Folded / Detailed modes of [cnaron/compact-agent-activity](https://github.com/cnaron/compact-agent-activity), with source baseline `4866482961c4c43a2f5f102fd63eadff85e15ef2`. Folded (the default) shows a single-line summary from the start of an activity and does not switch to \"duration\" or second-level command grouping when it finishes; expanding shows the reasoning text and tool details directly. Detailed keeps the upstream per-item cards, status icons, output, diffs, and structured tool details. Old Codex settings are migrated to Folded on read, while the color theme and feature toggle are preserved. User questions and ordinary assistant answers keep native Markdown, copy, and fork behavior.\n\nThe migration keeps the upstream summary, fonts, colors, detail tree, and whole-row click interaction, adapted for stability against the public SDK and virtual lists: history is isolated per connection and per agent, streaming activity rows keep their identity, expand selection survives a row remount, and syntax highlighting is produced on the first frame; on subscription resume, cached state is kept until a history epoch change is confirmed. When the first history read has not completed or cannot be matched, a collapsed single-item summary is shown instead of flashing the whole detail block. DOM handling lives only in each feature domain's own `dom.ts`; spacing and image sizing use declarative CSS rather than walking and adjusting activity node margins after mount.\n\nDense chains of thought and tool calls during agent execution are condensed from a waterfall into a highly compact information capsule:\n\n```text\nThought · Ran 17 commands · Edited 1 file  [▼ click to expand details]\n```\n\n- **Aggregated summary and detail expansion**:\n  - Consecutive reasoning and tool operations collapse into a single summary line;\n  - One click expands the full panel in place: structured reasoning, commands and output terminal, syntax highlighting, file diffs, error stacks, and sub-agent dispatch details.\n- **Natural message boundary isolation**:\n  - As soon as an assistant text answer, a user question, or any other visible node appears, the current activity group is sealed; details never aggregate across messages out of place.\n- **High performance and isolation**:\n  - Isolated by both Paseo session connection and agent instance;\n  - History is loaded forward on demand through the public timeline API; if the connection is not ready or a fetch is in flight, it degrades to per-item details automatically;\n  - Streaming activity **history reads** use a **100ms aggregation window** to merge high-frequency requests; rendering is not delayed—instead, row identity keeps rows stable while streaming grows and folded content stays out of the render path, avoiding extra reflow. Very long output (over 12,000 characters) degrades to plain text to avoid re-tokenizing everything on every frame.\n  - When reasoning text keeps growing, the current folded group is preserved; when the virtual list recycles activity rows, loaded groups are kept and the subscription is paused, then reused directly on remount, reducing scroll jitter from row-height changes.\n  - Groups are preserved while the subscription resumes; identical history content does not rebuild groups or notify rendering. Forward pagination starts only after the first history read completes, avoiding duplicate requests.\n- **Desktop and Web micro-adjustments**:\n  - Tightens conversation message and paragraph spacing (assistant message vertical padding reduced to 4px, paragraph spacing tuned to a professional 8px with trailing double whitespace removed automatically; lists, code blocks, and quotes packed in a golden-ratio rhythm);\n  - Compresses the outer spacing of folded activity rows and the gap to questions, improving the information density and readability of consecutive reasoning and tool output;\n  - Constrains inline images to a maximum of 440 × 320 to keep streaming layouts tidy (full-screen image viewing on click is unaffected).\n\n### 3. Interactive Mermaid Diagrams\n\nFully adopts the rendering implementation of upstream [paseo-plugin-mermaid](https://github.com/dutchakdev/paseo-plugin-mermaid) 0.2.0, natively empowering agents to output visual diagrams.\n\n- **Dynamic interaction controls**:\n  - Automatically intercepts and converts ````mermaid` code blocks in assistant answers;\n  - Presents diagrams progressively while streaming;\n  - Built-in toolbar: **25%–400% free zoom**, **fit to width**, **full-screen preview**, and **one-click diagram / source switching**.\n- **Supported syntax**:\n  - **Fully supported**: `flowchart` / `graph` (all of `TD`, `TB`, `BT`, `LR`, `RL`, including **top-level subgraph cluster boxes**) and `sequenceDiagram` (common node shapes, connector arrows, text labels, participants, actors, inline notes, etc.).\n  - **Not yet supported**: nested subgraphs (folded into the enclosing cluster box), `style` / `classDef` custom styles, and other uncommon diagram types.\n  - **Graceful degradation**: on a parse error or unsupported syntax, it falls back to showing the original source with a helpful error hint.\n- **Takeover behavior**:\n  - The plugin only takes over **assistant answers that contain a Mermaid code block**;\n  - Such a message is rendered with the upstream lightweight Markdown engine (headings, paragraphs, lists, **tables with alignment and inline emphasis in cells**, code blocks, quotes, etc.) and **no longer offers Paseo's native fork and copy buttons** (plain-text answers are completely unaffected).\n\n---\n\n### 4. Prompt Enhancement\n\nAutomatically rewrites a vague composer request (say, \"add caching\") into an executable prompt covering **goal, scope, constraints, and acceptance**, enriched with the real tech stack and verification commands of the current project.\n\n- **Two entry points**:\n  - **composer track pill** (all platforms): the \"Enhance\" button on the plugin track above the input box, next to \"Sticky questions\";\n  - **`/enhance <original prompt>`** (all platforms): since the host does not expose a draft read/write API, native clients and the command line use this entry point.\n- **Click again to undo**: after writing back, the button becomes an undo icon; clicking it restores the pre-enhancement text. Enhanced results are tagged with `origin` and are never enhanced twice.\n- **Environment awareness**: the server read-only collects project manifest files (`package.json` / `Cargo.toml` / `go.mod`, etc.), script commands, dependency frameworks, tsconfig strict, changed Git files, and docs such as `README` / `AGENTS` / `CLAUDE`, and injects them into the prompt as context. **Acceptance criteria may only reference commands that actually exist in the repository**; when nothing can be detected, it falls back to manually checkable observations.\n- **Judge first**: if the original text is already a clear, executable instruction it is returned as is (`applied=false`), with no paraphrasing for its own sake. The same applies when the original already exceeds 200 characters—an enhancement could never be shorter than what the user wrote.\n- **200-character limit**: the rewritten body is hard-capped at 200 characters, one line per element, each stating only the conclusion. The cap is independent of the original length, so short requests are not compressed into fragments.\n- **Visible failures**: model timeouts, endpoint errors, and missing keys all surface the reason through a host toast and keep the original text; nothing fails silently.\n\n> [!NOTE]\n> Prompt enhancement uses its own model endpoint (configured in settings) and does not go through the Paseo host account, so it produces no host conversation record and **sends only the text plus the environment profile summary above—never source file contents**.\n\n---\n\n## Plugin Settings Guide\n\nOpen preferences from the Paseo client menu to configure the plugin:\n\n**Path**: `Settings` → `Plugins` → `chat-view` → `Feature Settings`\n\n| Setting                                       | Options                                   | Description                                                                                                      "}