pi-note 0.36.0 → 0.37.0

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/README.md CHANGED
@@ -62,6 +62,14 @@ title previews it and double-clicking completes it. A suggested title requires a
62
62
  double-click to accept. Regular mode shows status; `/pinote` provides all actions.
63
63
  No Kitty action handler is needed for this extension.
64
64
 
65
+ Accepting a suggestion, selecting a different task, or creating and selecting one
66
+ renames the current Kitty tab to `[tag] task title` (tag omitted when unset),
67
+ using the footer's first-line title rather than the GUI launcher's shortened name.
68
+ Requires local Kitty with remote control enabled, `kitty` on PATH, and
69
+ `KITTY_LISTEN_ON` / `KITTY_WINDOW_ID`; SSH and other terminals are unchanged.
70
+ Rename failures warn without undoing selection. Completion and deselection leave
71
+ the tab name unchanged; reload/resume and external task edits do not rename it.
72
+
65
73
  Completion keeps the conversation and editor, except for dedicated **Start in Kitty…**
66
74
  sessions (see below). With an empty editor, **Ctrl+D**
67
75
  (or your configured exit key) offers Cancel, Exit without completing, or Complete
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-note",
3
- "version": "0.36.0",
3
+ "version": "0.37.0",
4
4
  "description": "Persistent pinote tasks, Markdown handoffs, and task status for Pi",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/remote/ui.ts CHANGED
@@ -111,6 +111,11 @@ export class RemoteUI {
111
111
  if (!current()) return false;
112
112
  const result = await this.session.action(view, control, value, () => control.id !== 'done' || ctx.isIdle());
113
113
  if (!current()) return false;
114
+ const selected = this.session.view;
115
+ if (selected && typeof selected.state.selectedId === 'number' && selected.state.selectedId !== view.state.selectedId) {
116
+ await this.renameKittyTab(ctx, selected, signal);
117
+ if (!current()) return false;
118
+ }
114
119
  if (control.id === 'done' && ctx.isIdle() && typeof view.state.selectedId === 'number' &&
115
120
  this.session.view && this.session.view.state.selectedId == null && this.exitOnComplete(view.state.selectedId)) {
116
121
  this.closing = true;
@@ -131,6 +136,20 @@ export class RemoteUI {
131
136
  return false;
132
137
  }
133
138
  }
139
+ private async renameKittyTab(ctx: ExtensionContext, view: NativeView, signal: AbortSignal): Promise<void> {
140
+ const window = process.env.KITTY_WINDOW_ID, socket = process.env.KITTY_LISTEN_ON;
141
+ const title = line(view.footer?.find((item) => item.action === 'preview')?.text ?? '').trim();
142
+ // Never fall back to the focused tab or discover an unrelated Kitty instance.
143
+ if (!window || !/^[1-9]\d*$/.test(window) || !socket || !title || process.env.SSH_CONNECTION || process.env.SSH_TTY) return;
144
+ try {
145
+ const result = await this.pi.exec('kitty', ['@', '--to', socket, 'set-tab-title', `--match=window_id:${window}`, '--', title], {
146
+ signal, timeout: 1500,
147
+ });
148
+ if (result.code !== 0) throw new Error('Kitty title update failed');
149
+ } catch {
150
+ if (!signal.aborted) ctx.ui.notify('Pinote task selected, but the Kitty tab could not be renamed.', 'warning');
151
+ }
152
+ }
134
153
  async open(ctx: ExtensionContext): Promise<void> {
135
154
  if (ctx.mode !== 'tui') { ctx.ui.notify('Pinote UI actions require TUI mode', 'warning'); return; }
136
155
  if (this.opening) return;