@alexleekt/pi-ask-user-glimpse 0.2.1 → 0.3.1

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/CHANGELOG.md CHANGED
@@ -2,6 +2,30 @@
2
2
 
3
3
  All notable changes to `@alexleekt/pi-ask-user-glimpse` are documented in this file.
4
4
 
5
+ ## [0.3.1] — 2026-05-20
6
+
7
+ ### Fixed
8
+ - **Mermaid rendering was missing from v0.3.0** — The mermaid ContextPanel changes were committed on an orphaned branch and never merged into main before the v0.3.0 publish. This release includes them properly.
9
+
10
+ ## [0.3.0] — 2026-05-20
11
+
12
+ ### Added
13
+ - **Always-present "Additional Comments"** — Every dialog type (SingleSelect, MultiSelect, Questionnaire) now shows a non-toggleable freeform textarea at the bottom. Users can submit just additional comments without answering the main question.
14
+ - **Empty submission allowed** — Submit button is always enabled. Users can submit without selecting options, answering questions, or typing freeform text.
15
+ - **"All of the above" radio toggle** — Multi-select options matching patterns like "All of the above", "Select all", "Everything" render as radio buttons. Clicking them selects all regular options at once. Selecting any individual option automatically deselects the "All" toggle.
16
+ - **Auto-split long questions** — When the `question` field exceeds 120 characters and no separate `context` is provided, the first sentence becomes the dialog title and the remainder flows to the left context panel.
17
+ - **Mermaid diagram rendering** — The context panel now renders ` ```mermaid ` code blocks as interactive SVG diagrams (flowcharts, sequence diagrams, etc.). The `mermaid` package is bundled into the webview.
18
+ - **Shared icon components** — Extracted `RadioIcon`, `CheckIcon`, `CommentIcon`, and `isSelectAllOption` from duplicated inline SVGs into `webview/src/components/icons.tsx`.
19
+ - **New `/ask-debug` test scenarios** — Added `mermaid` and `long-question` mock modes, plus "All of the above" options in multi-select and questionnaire mocks.
20
+
21
+ ### Changed
22
+ - **Prompt guidelines** — Updated tool description and parameter docs to encourage agents to include Mermaid diagrams in the `context` field when visualizing architecture, flows, or relationships would aid understanding.
23
+ - **Max-height headers** — Added `max-h-24 overflow-y-auto` to all component headers and `max-h-32` to the global App header as a defensive cap against long titles.
24
+ - **Response formatter** — Added `additionalComments` field to both `selection` and `questionnaire` response kinds. Empty answers are now filtered from questionnaire submissions.
25
+
26
+ ### Fixed
27
+ - **Questionnaire focus-steal bug** — The mount-only auto-focus `useEffect` was incorrectly including `answers` in its dependency array, causing it to re-run on every keystroke and steal focus from the current textarea to the next question.
28
+
5
29
  ## [0.2.1] — 2026-05-16
6
30
 
7
31
  ### Fixed
package/CONTRIBUTING.md CHANGED
@@ -5,8 +5,8 @@ Thanks for your interest in improving `@alexleekt/pi-ask-user-glimpse`!
5
5
  ## Development Setup
6
6
 
7
7
  ```bash
8
- git clone https://github.com/alexleekt/pi-ask-user-glimpse.git
9
- cd pi-ask-user-glimpse
8
+ git clone https://github.com/alexleekt/pi-extensions.git
9
+ cd pi-extensions/packages/pi-ask-user-glimpse
10
10
  npm install
11
11
  ```
12
12
 
package/README.md CHANGED
@@ -5,6 +5,29 @@
5
5
 
6
6
  A Pi extension that replaces `ask_user` with rich native WebView dialogs powered by [glimpseui](https://npmjs.com/package/glimpseui) and styled with shadcn/ui design tokens.
7
7
 
8
+ > **Stop reading terminal walls of text.** This extension turns every `ask_user` call into a beautiful, searchable, keyboard-navigable dialog — complete with markdown context panels, inline descriptions, and dark mode. Your agent asks better questions. You answer faster.
9
+
10
+ ### Use Case: Scoping a New Project
11
+
12
+ Instead of the agent dumping a wall of questions into the terminal, it opens a native dialog:
13
+
14
+ ```
15
+ ┌──────────────────────────────────────────────┐
16
+ │ Which database should we use? │
17
+ │ ───────────────────────────────────────── │
18
+ │ Context: We need something reliable for │
19
+ │ production. │
20
+ │ │
21
+ │ ○ PostgreSQL · Relational, proven │
22
+ │ ○ SQLite · Zero-config, embedded │
23
+ │ ○ Custom... │
24
+ │ │
25
+ │ [Cancel] [Submit] │
26
+ └──────────────────────────────────────────────┘
27
+ ```
28
+
29
+ The agent gets a clean selection back. You get a decision made in seconds, not minutes of scrolling.
30
+
8
31
  ## Features
9
32
 
10
33
  - **Single-select** — searchable option list with inline descriptions
@@ -14,7 +37,6 @@ A Pi extension that replaces `ask_user` with rich native WebView dialogs powered
14
37
  - **Native WebView** — renders in a real window (macOS WKWebView / Linux GTK4 / Windows WebView2)
15
38
  - **Terminal fallback** — gracefully degrades to TUI prompts when glimpseui is unavailable
16
39
 
17
-
18
40
  ## Install
19
41
 
20
42
  ```bash
@@ -126,20 +148,20 @@ Each question is shown as a card with a progress bar at the top. Questions with
126
148
  |-----------|------|---------|-------------|
127
149
  | `question` | `string` | *(required)* | The question to ask |
128
150
  | `context` | `string` | — | Additional context shown in a left-side markdown panel |
129
- | `options` | `Array<string \| {title, description?}>` | — | Options for flat single/multi-select mode |
151
+ | `options` | `Array<string &#124; {title, description?}>` | — | Options for flat single/multi-select mode |
130
152
  | `questions` | `Array<{title, description?, options?, allowMultiple?}>` | — | Questions for questionnaire mode. When present, `options` is ignored. Each question can have its own `options` (same shape as top-level `options`) and `allowMultiple`. Questions without `options` render as freeform textareas. |
131
153
  | `allowMultiple` | `boolean` | `false` | Allow selecting multiple options |
132
154
  | `allowFreeform` | `boolean` | `true` | Show a freeform "Custom" option |
133
155
  | `allowComment` | `boolean` | `false` | Collect an optional comment after selection |
134
156
  | `allowSkip` | `boolean` | `false` | Allow submitting a questionnaire without answering all questions (questionnaire mode only) |
135
157
  | `followCursor` | `boolean` | `false` | Make the 1200×900 dialog follow the terminal cursor |
136
- | `displayMode` | `"overlay" \| "inline"` | — | Legacy option; ignored (always centered dialog) |
158
+ | `displayMode` | `"overlay" &#124; "inline"` | — | Legacy option; ignored (always centered dialog) |
137
159
 
138
160
  ## Development
139
161
 
140
162
  ```bash
141
- git clone https://github.com/alexleekt/pi-ask-user-glimpse.git
142
- cd pi-ask-user-glimpse
163
+ git clone https://github.com/alexleekt/pi-extensions.git
164
+ cd pi-extensions/packages/pi-ask-user-glimpse
143
165
  npm install
144
166
  ```
145
167