@trim21/personal-pi-extensions 0.0.296 → 0.0.297

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/lib/ui.ts +4 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trim21/personal-pi-extensions",
3
- "version": "0.0.296",
3
+ "version": "0.0.297",
4
4
  "type": "module",
5
5
  "description": "Custom pi coding-agent extensions: bwrap sandbox, workspace guard, opencode edit, and more",
6
6
  "keywords": [
package/src/lib/ui.ts CHANGED
@@ -131,9 +131,9 @@ export interface CheckboxActionResult<T extends string> {
131
131
  /**
132
132
  * Checkbox 多选 + 结束动作的组合对话框(selectMultiple 的带操作变体)。
133
133
  *
134
- * 循环列出全部 `entries`(☑/☐ 前缀切换勾选)与全部 `actions`;选中任意
135
- * action 即结束循环并返回勾选结果,对话框关闭(dismiss)返回 undefined
136
- * 结束动作是固定条目(无 ☑/☐ 前缀),不参与勾选。
134
+ * 循环列出全部 `actions`(固定操作,选中即结束循环)与全部 `entries`
135
+ * (☑/☐ 前缀切换勾选);对话框关闭(dismiss)返回 undefined。操作在前、
136
+ * checkbox 条目在后,用户先决定本次动作,需要时再勾选要持久化的规则。
137
137
  */
138
138
  export async function selectCheckboxActions<T extends string>(
139
139
  title: string,
@@ -152,7 +152,7 @@ export async function selectCheckboxActions<T extends string>(
152
152
  displayToLabel.set(display, entry.label);
153
153
  round.push({ ...entry, label: display });
154
154
  }
155
- const result = await selectWithOptionalInput(title, [...round, ...actions], ui, opts);
155
+ const result = await selectWithOptionalInput(title, [...actions, ...round], ui, opts);
156
156
  if (result === undefined) return undefined;
157
157
  const action = actions.find((candidate) => candidate.label === result.label);
158
158
  if (action !== undefined) return { selected, action: action.action, input: result.input };