feat: add question type presentation controls
This commit is contained in:
@@ -67,6 +67,8 @@ The codebase is split so the implementation reads through file boundaries and na
|
||||
|
||||
- submit is never blocked by unanswered questions
|
||||
- single-select answers serialize as arrays
|
||||
- when `behaviour.presentSingleAsMulti` is enabled, future single-select questions are handled with multi-select state semantics while result metadata preserves the requested `type` and adds `presentedType`
|
||||
- active-flow question type changes are per-question runtime overrides handled in state/controller logic; they do not mutate the stored source payload or global config
|
||||
- single-select free-form answers replace selected options for that question
|
||||
- multi-select free-form answers augment selected options instead of clearing them
|
||||
- preview questions keep their preview-pane behavior while also supporting the synthetic custom-answer option
|
||||
@@ -79,6 +81,8 @@ The codebase is split so the implementation reads through file boundaries and na
|
||||
- invalid persisted keymaps fall back to default keymaps for the current session without discarding valid behaviour, notification, or answer settings
|
||||
- invalid notification channels are skipped and fall back to the default bell channel if none are valid
|
||||
- ask settings behaviour and notification enabled changes persist immediately from the settings list; config reset is guarded by a short double-press confirmation
|
||||
- `presentSingleAsMulti` is applied at ask-flow creation; toggling it does not rewrite already-normalized questions in an open flow
|
||||
- `main.changeQuestionType` changes the active question type live (non-preview: `single <-> multi`; preview: `preview <-> multi`) and may require confirmation before destructive multi-to-single conversion
|
||||
- when the ask config file is missing, the first ask use writes a default persisted config snapshot under `~/.pi/agent/extensions/`
|
||||
- legacy root config files move into `~/.pi/agent/extensions/` only when the current config file is absent
|
||||
- live config updates can affect an in-progress ask flow immediately
|
||||
|
||||
+18
-3
@@ -28,7 +28,7 @@ Unsupported future versions or invalid files are backed up and defaults are load
|
||||
|
||||
```json
|
||||
{
|
||||
"schemaVersion": 4,
|
||||
"schemaVersion": 5,
|
||||
"answer": {
|
||||
"extractionModels": [
|
||||
{ "provider": "openai-codex", "id": "gpt-5.4-mini" },
|
||||
@@ -42,6 +42,7 @@ Unsupported future versions or invalid files are backed up and defaults are load
|
||||
"autoSubmitWhenAnsweredWithoutNotes": false,
|
||||
"confirmDismissWhenDirty": true,
|
||||
"doublePressReviewShortcuts": true,
|
||||
"presentSingleAsMulti": false,
|
||||
"showFooterHints": true
|
||||
},
|
||||
"keymaps": {
|
||||
@@ -50,6 +51,7 @@ Unsupported future versions or invalid files are backed up and defaults are load
|
||||
"confirm": ["enter"],
|
||||
"cancel": ["esc"],
|
||||
"toggle": ["space"],
|
||||
"changeQuestionType": ["t"],
|
||||
"nextTab": ["tab", "right"],
|
||||
"previousTab": ["shift+tab", "left"],
|
||||
"nextOption": ["down"],
|
||||
@@ -133,6 +135,16 @@ These settings affect only the `/answer` command. Normal `ask_user` tool calls d
|
||||
- effect: when enabled, review-tab number shortcuts (`1`, `2`, `3`) only trigger after pressing the same key twice
|
||||
- the review screen shows an inline hint and keeps the pending shortcut armed until another review shortcut is pressed or the user leaves the tab
|
||||
|
||||
### `behaviour.presentSingleAsMulti`
|
||||
|
||||
- type: boolean
|
||||
- default: `false`
|
||||
- effect: future ask flows render requested `single` questions as `multi` questions
|
||||
- result: the question keeps `type: "single"` and adds `presentedType: "multi"`; result text uses one compact note when any answered questions were presented differently
|
||||
- scope: this is a default presentation policy for new/replayed ask flows; it is not hot-applied to the current ask flow
|
||||
- current-flow override: use the configurable main-flow `changeQuestionType` hotkey (default `t`) to change the active question type live: non-preview questions toggle `single <-> multi`; preview questions toggle `preview <-> multi`
|
||||
- destructive confirmation: changing `multi -> single` with multiple selected answers requires pressing the type hotkey again; the pending confirmation has no timeout and clears when another navigation/action is used
|
||||
|
||||
### `behaviour.showFooterHints`
|
||||
|
||||
- type: boolean
|
||||
@@ -201,6 +213,7 @@ Arrays are aliases: any listed key triggers the same action.
|
||||
"main": {
|
||||
"confirm": ["enter"],
|
||||
"cancel": ["esc"],
|
||||
"changeQuestionType": ["t"],
|
||||
"toggle": ["space"],
|
||||
"nextTab": ["tab", "right"],
|
||||
"previousTab": ["shift+tab", "left"],
|
||||
@@ -307,7 +320,7 @@ Invalid keymaps include:
|
||||
|
||||
```json
|
||||
{
|
||||
"schemaVersion": 4,
|
||||
"schemaVersion": 5,
|
||||
"answer": {
|
||||
"extractionRetries": 1,
|
||||
"extractionTimeoutMs": 30000,
|
||||
@@ -319,6 +332,7 @@ Invalid keymaps include:
|
||||
"autoSubmitWhenAnsweredWithoutNotes": true,
|
||||
"confirmDismissWhenDirty": true,
|
||||
"doublePressReviewShortcuts": true,
|
||||
"presentSingleAsMulti": false,
|
||||
"showFooterHints": false
|
||||
},
|
||||
"keymaps": {
|
||||
@@ -330,6 +344,7 @@ Invalid keymaps include:
|
||||
"confirm": ["ctrl+k"],
|
||||
"cancel": ["q"],
|
||||
"toggle": ["ctrl+t"],
|
||||
"changeQuestionType": ["t"],
|
||||
"nextTab": ["tab", "right"],
|
||||
"previousTab": ["shift+tab", "left"],
|
||||
"nextOption": ["down"],
|
||||
@@ -377,7 +392,7 @@ Invalid keymaps include:
|
||||
When editing this config for a user:
|
||||
|
||||
- preserve unrelated fields
|
||||
- keep `schemaVersion` at `4`
|
||||
- keep `schemaVersion` at `5`
|
||||
- preserve `answer.extractionModels` as explicit provider/id pairs
|
||||
- keep `answer.extractionRetries` between `0` and `3`
|
||||
- do not assign fixed numeric shortcuts (`1` through `9`) to configurable actions
|
||||
|
||||
+8
-2
@@ -61,6 +61,7 @@ This document defines the stable external behavior. It does not explain internal
|
||||
label: string;
|
||||
prompt: string;
|
||||
type: "single" | "multi" | "preview";
|
||||
presentedType?: "single" | "multi" | "preview";
|
||||
}>;
|
||||
answers: Record<
|
||||
string,
|
||||
@@ -99,6 +100,7 @@ This document defines the stable external behavior. It does not explain internal
|
||||
label: string;
|
||||
prompt: string;
|
||||
type: "single" | "multi" | "preview";
|
||||
presentedType?: "single" | "multi" | "preview";
|
||||
options: Array<{
|
||||
value: string;
|
||||
label: string;
|
||||
@@ -124,6 +126,7 @@ This document defines the stable external behavior. It does not explain internal
|
||||
label: string;
|
||||
prompt: string;
|
||||
type: "single" | "multi" | "preview";
|
||||
presentedType?: "single" | "multi" | "preview";
|
||||
options: Array<{
|
||||
value: string;
|
||||
label: string;
|
||||
@@ -167,6 +170,7 @@ This document defines the stable external behavior. It does not explain internal
|
||||
- `continuation.affectedQuestionIds` lists the only questions that should be revisited
|
||||
- `continuation.questionStates` marks each question as `answered`, `needs_clarification`, or `unanswered`
|
||||
- single-select answers still use arrays
|
||||
- when `behaviour.presentSingleAsMulti` is enabled, requested single-select questions are presented and handled as multi-select in future/replayed ask flows; result question metadata keeps the requested `type`, adds `presentedType` when final presentation differs, and result text uses one compact note when any answered questions were presented differently
|
||||
- `indices` are 1-based rendered option positions
|
||||
- `customText` stores the free-form answer
|
||||
- on single-select questions, saving free-form text clears selected options for that question
|
||||
@@ -193,6 +197,7 @@ This document defines the stable external behavior. It does not explain internal
|
||||
|
||||
- tabbed multi-question flow
|
||||
- single-select, multi-select, and preview questions
|
||||
- active question type changes via configurable `main.changeQuestionType` hotkey, default `t`; non-preview questions toggle `single <-> multi`; preview questions toggle `preview <-> multi`
|
||||
- inline free-form answers for all question types
|
||||
- native pi-style `@` file path autocomplete inside free-form answer and note editors
|
||||
- question notes via `Shift+N`
|
||||
@@ -208,7 +213,7 @@ This document defines the stable external behavior. It does not explain internal
|
||||
- `/ask:replay` command to replay the latest real `ask_user` form on the current branch
|
||||
- ask settings list with binary behaviour/notification toggles and a guarded reset-to-defaults action
|
||||
- `?` in the ask flow and `/ask-settings` in pi open the same lightweight ask settings overlay
|
||||
- settings persist immediately when changed: `Auto-submit when answered without notes`, `Confirm dismiss when dirty`, `Double-press review shortcuts`, `Notifications`, and `Show footer hints`; resetting config to defaults requires pressing the reset action twice within a short confirmation window
|
||||
- settings persist immediately when changed: `Auto-submit when answered without notes`, `Confirm dismiss when dirty`, `Double-press review shortcuts`, `Notifications`, and `Show footer hints`; `Present single-select as multi-select` persists immediately but applies only to new/replayed ask flows; resetting config to defaults requires pressing the reset action twice within a short confirmation window
|
||||
- `Keymaps` is a persisted, context-aware config section for global, main-flow, editor, note-editor, and settings-modal actions
|
||||
- the settings list shows the absolute config file path for customizing keymaps, notifications, and extraction settings
|
||||
- if the flow is already on the review tab, all questions are answered, and no notes exist, enabling auto-submit can complete the current ask flow immediately
|
||||
@@ -223,6 +228,7 @@ Main flow:
|
||||
- `main.nextTab` / `main.previousTab` move between tabs; defaults: `Tab`/`Right`, `Shift+Tab`/`Left`
|
||||
- `main.nextOption` / `main.previousOption` move between options or review actions; defaults: `Down`, `Up`
|
||||
- `main.confirm`, `main.cancel`, and `main.toggle` confirm, cancel, or toggle; defaults: `Enter`, `Esc`, `Space`
|
||||
- `main.changeQuestionType` changes the active question type (non-preview: `single <-> multi`; preview: `preview <-> multi`); default: `t`; destructive `multi -> single` changes require pressing the type hotkey again, with no timeout, and the pending confirmation clears on other navigation/actions
|
||||
- `main.optionNote` and `main.questionNote` open option/question notes; defaults: `n`, `Shift+N`
|
||||
- `1..9` is fixed and selects or toggles the matching option; on the review tab, `1`, `2`, and `3` trigger `Submit`, `Elaborate`, and `Cancel`
|
||||
- when `Double-press review shortcuts` is enabled, review-tab `1`, `2`, and `3` require the same key twice without a timeout, and the review screen shows an inline hint for the pending action
|
||||
@@ -255,7 +261,7 @@ If `ctx.hasUI === false`, the tool returns a `Needs user input` message in `cont
|
||||
|
||||
Validation is handled inside the tool so malformed calls produce the same structured error shape as other invalid payloads instead of relying on pre-execution schema failures.
|
||||
|
||||
The ask flow subscribes to runtime settings updates while open. In practice, this means changing `Auto-submit when answered without notes`, `Confirm dismiss when dirty`, `Double-press review shortcuts`, `Notifications`, `Show footer hints`, resetting config to defaults, or reloading config-backed keymaps can affect the in-progress ask flow immediately instead of only future asks.
|
||||
The ask flow subscribes to runtime settings updates while open. In practice, this means changing `Auto-submit when answered without notes`, `Confirm dismiss when dirty`, `Double-press review shortcuts`, `Notifications`, `Show footer hints`, resetting config to defaults, or reloading config-backed keymaps can affect the in-progress ask flow immediately instead of only future asks. `Present single-select as multi-select` is applied when an ask flow is created and does not rewrite question semantics for an already-open flow; use `main.changeQuestionType` for live per-question changes.
|
||||
|
||||
## Notifications
|
||||
|
||||
|
||||
Reference in New Issue
Block a user