@sigrun/tui 0.11.1 → 0.11.2

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
@@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
8
 
9
+ ## [0.11.2] - 2026-11-08
10
+
11
+ - Notices overlay: an extension action carrying a confirm asks before running (y/n); n/Esc/q cancels without posting.
12
+
13
+
9
14
  ## [0.11.1] - 2026-11-07
10
15
 
11
16
  - Version-locked bump with the 0.11.1 core line (no changes).
@@ -65,6 +65,8 @@ class NoticesOverlay {
65
65
  #overlay;
66
66
  /** The selected row index into {@link rows}. */
67
67
  #index = 0;
68
+ /** An extension action waiting for an explicit yes/no confirmation. */
69
+ #confirming;
68
70
  constructor(chrome, options) {
69
71
  this.#chrome = chrome;
70
72
  this.#options = options;
@@ -95,6 +97,10 @@ class NoticesOverlay {
95
97
  const row = this.rows[this.#index];
96
98
  if (row === undefined || row.action === undefined)
97
99
  return;
100
+ if (row.action.kind === "extension" && row.action.confirm !== undefined && row.action.confirm !== "") {
101
+ this.#confirming = { notice: row.notice, action: row.action };
102
+ return;
103
+ }
98
104
  void this.#chrome.run(row.notice, row.action);
99
105
  }
100
106
  #dismissSelected() {
@@ -106,6 +112,19 @@ class NoticesOverlay {
106
112
  this.#index -= 1;
107
113
  }
108
114
  handleInput(data) {
115
+ if (this.#confirming !== undefined) {
116
+ const confirming = this.#confirming;
117
+ if (data === "y" || data === "Y") {
118
+ this.#confirming = undefined;
119
+ void this.#chrome.run(confirming.notice, confirming.action);
120
+ return;
121
+ }
122
+ if (data === "n" || data === "N" || matchesKey(data, Key.escape) || data === "q" || data === "\x07") {
123
+ this.#confirming = undefined;
124
+ }
125
+ // Every other key is consumed while the confirm is pending.
126
+ return;
127
+ }
109
128
  if (matchesKey(data, Key.escape) || data === "q" || data === "\x07") {
110
129
  this.#close();
111
130
  return;
@@ -132,7 +151,10 @@ class NoticesOverlay {
132
151
  const lines = [];
133
152
  const rows = this.rows;
134
153
  let rowIndex = 0;
135
- lines.push(`notices (${rows.length}) — enter run · d dismiss · esc close`);
154
+ const confirming = this.#confirming?.action;
155
+ lines.push(confirming === undefined
156
+ ? `notices (${rows.length}) — enter run · d dismiss · esc close`
157
+ : `${confirming.kind === "extension" ? confirming.confirm : ""} (y/n)`);
136
158
  for (const notice of this.#chrome.notices) {
137
159
  const age = relativeAge(notice.at);
138
160
  lines.push(`${toneMark(notice.tone)} ${notice.title}${age === "" ? "" : ` · ${age}`}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sigrun/tui",
3
- "version": "0.11.1",
3
+ "version": "0.11.2",
4
4
  "description": "sigrun terminal client (pi-tui based) over the \u00a75 API \u2014 spawned by the sigrun CLI, or standalone against a server URL",
5
5
  "type": "module",
6
6
  "bin": {
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@earendil-works/pi-tui": "^1.3.0",
24
- "@sigrun/shared": "0.11.1"
24
+ "@sigrun/shared": "0.11.2"
25
25
  },
26
26
  "devDependencies": {
27
27
  "typescript": "^7.0.2",