@abhishek944/pi-tasks 0.2.0 → 0.3.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 +1 -1
- package/dist/index.js +2 -8
- package/dist/ui/panel.d.ts +0 -1
- package/dist/ui/panel.js +35 -49
- package/dist/ui/works-dashboard.d.ts +12 -2
- package/dist/ui/works-dashboard.js +125 -9
- package/docs/REFERENCE.md +2 -2
- package/docs/USAGE_GUIDE.md +5 -2
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ WorkUpdate workId="W1" status="completed"
|
|
|
35
35
|
|
|
36
36
|
Run `/works` to inspect full `workInfo` and `taskInfo` in an interactive overlay.
|
|
37
37
|
|
|
38
|
-
The panel defaults to the floating top-right layout. When its rows overflow,
|
|
38
|
+
The panel defaults to the floating top-right layout. When its rows overflow, it shows the newest rows; in fullscreen TUI mode, scroll directly over the panel with the mouse wheel. Open `/works` to inspect every row in regular terminal mode. Switch layouts at runtime with `/works-panel floating`, `/works-panel widget`, or `/works-panel off`.
|
|
39
39
|
|
|
40
40
|
See [the usage guide](docs/USAGE_GUIDE.md) and [reference](docs/REFERENCE.md).
|
|
41
41
|
|
package/dist/index.js
CHANGED
|
@@ -11,18 +11,12 @@ export default function tasksExtension(pi) {
|
|
|
11
11
|
registerTrackingGuidance(pi);
|
|
12
12
|
registerWorksCommand(pi, state);
|
|
13
13
|
pi.registerCommand("works-panel", {
|
|
14
|
-
description: "Set the works panel mode
|
|
14
|
+
description: "Set the works panel display mode",
|
|
15
15
|
handler: async (args, ctx) => {
|
|
16
16
|
const requested = args.trim();
|
|
17
|
-
if (requested === "browse") {
|
|
18
|
-
const error = panel?.browse();
|
|
19
|
-
if (error)
|
|
20
|
-
ctx.ui.notify(error, "warning");
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
17
|
const mode = requested === "floating" || requested === "widget" || requested === "off" ? requested : undefined;
|
|
24
18
|
if (!mode) {
|
|
25
|
-
ctx.ui.notify("Usage: /works-panel floating|widget|off
|
|
19
|
+
ctx.ui.notify("Usage: /works-panel floating|widget|off", "info");
|
|
26
20
|
return;
|
|
27
21
|
}
|
|
28
22
|
panel?.setMode(mode);
|
package/dist/ui/panel.d.ts
CHANGED
package/dist/ui/panel.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
|
|
2
2
|
const EMPTY_COMPONENT = { render: () => [], invalidate: () => { } };
|
|
3
3
|
export class TasksPanelHost {
|
|
4
4
|
state;
|
|
@@ -23,19 +23,6 @@ export class TasksPanelHost {
|
|
|
23
23
|
getMode() {
|
|
24
24
|
return this.mode;
|
|
25
25
|
}
|
|
26
|
-
browse() {
|
|
27
|
-
if (this.mode !== "floating")
|
|
28
|
-
return "Use /works-panel floating before browsing the panel.";
|
|
29
|
-
if (!this.tui || !this.panel || !this.handle)
|
|
30
|
-
return "The Works panel is not available.";
|
|
31
|
-
const columns = this.tui.terminal.columns || process.stdout.columns || 0;
|
|
32
|
-
const rows = this.tui.terminal.rows || process.stdout.rows || 0;
|
|
33
|
-
if (columns < 90 || rows < 18)
|
|
34
|
-
return "The terminal is too small to browse the Works panel.";
|
|
35
|
-
this.handle.focus();
|
|
36
|
-
this.tui.requestRender();
|
|
37
|
-
return undefined;
|
|
38
|
-
}
|
|
39
26
|
update() {
|
|
40
27
|
this.panel?.invalidate();
|
|
41
28
|
this.tui?.requestRender();
|
|
@@ -62,7 +49,7 @@ export class TasksPanelHost {
|
|
|
62
49
|
}
|
|
63
50
|
ui.setWidget("pi-tasks-panel-host", (tui, theme) => {
|
|
64
51
|
this.tui = tui;
|
|
65
|
-
this.panel = new TasksPanel(tui, this.state, theme, "floating"
|
|
52
|
+
this.panel = new TasksPanel(tui, this.state, theme, "floating");
|
|
66
53
|
this.handle = tui.showOverlay(this.panel, {
|
|
67
54
|
anchor: "top-right",
|
|
68
55
|
width: "42%",
|
|
@@ -89,17 +76,15 @@ class TasksPanel {
|
|
|
89
76
|
state;
|
|
90
77
|
theme;
|
|
91
78
|
placement;
|
|
92
|
-
releaseFocus;
|
|
93
|
-
focused = false;
|
|
94
79
|
scrollOffset = 0;
|
|
95
80
|
pageSize = 1;
|
|
96
81
|
contentLength = 0;
|
|
97
|
-
|
|
82
|
+
followTail = true;
|
|
83
|
+
constructor(tui, state, theme, placement) {
|
|
98
84
|
this.tui = tui;
|
|
99
85
|
this.state = state;
|
|
100
86
|
this.theme = theme;
|
|
101
87
|
this.placement = placement;
|
|
102
|
-
this.releaseFocus = releaseFocus;
|
|
103
88
|
}
|
|
104
89
|
render(width) {
|
|
105
90
|
if (width < 38)
|
|
@@ -120,16 +105,24 @@ class TasksPanel {
|
|
|
120
105
|
this.contentLength = content.length;
|
|
121
106
|
const terminalRows = this.tui.terminal.rows || process.stdout.rows || 30;
|
|
122
107
|
this.pageSize = this.placement === "widget" ? Math.max(1, content.length) : Math.max(1, Math.floor(terminalRows * 0.48) - 4);
|
|
123
|
-
this.
|
|
108
|
+
if (this.placement === "widget") {
|
|
109
|
+
this.scrollOffset = 0;
|
|
110
|
+
this.followTail = true;
|
|
111
|
+
}
|
|
112
|
+
else if (this.followTail) {
|
|
113
|
+
this.scrollOffset = this.maxScrollOffset();
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
this.clampScrollOffset();
|
|
117
|
+
}
|
|
124
118
|
const shown = content.slice(this.scrollOffset, this.scrollOffset + this.pageSize);
|
|
125
|
-
const hasOverflow = content.length >
|
|
119
|
+
const hasOverflow = content.length > this.pageSize;
|
|
126
120
|
const range = `${this.scrollOffset + 1}–${this.scrollOffset + shown.length}/${content.length}`;
|
|
127
121
|
let title = "Works";
|
|
128
|
-
if (this.placement === "floating" &&
|
|
129
|
-
title += this.
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
title += " · Esc to return";
|
|
122
|
+
if (this.placement === "floating" && hasOverflow) {
|
|
123
|
+
title += this.tui.mode === "fullscreen"
|
|
124
|
+
? ` · ${range} · wheel to scroll`
|
|
125
|
+
: ` · ${range} · latest · /works for all`;
|
|
133
126
|
}
|
|
134
127
|
const lines = [
|
|
135
128
|
border(innerWidth, "top", this.theme),
|
|
@@ -140,36 +133,29 @@ class TasksPanel {
|
|
|
140
133
|
];
|
|
141
134
|
return lines.map((line) => `${leftPad}${line}`);
|
|
142
135
|
}
|
|
143
|
-
|
|
144
|
-
if (
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
149
|
-
if (matchesKey(data, Key.up))
|
|
150
|
-
this.scrollBy(-1);
|
|
151
|
-
else if (matchesKey(data, Key.down))
|
|
152
|
-
this.scrollBy(1);
|
|
153
|
-
else if (matchesKey(data, Key.pageUp))
|
|
154
|
-
this.scrollBy(-this.pageSize);
|
|
155
|
-
else if (matchesKey(data, Key.pageDown))
|
|
156
|
-
this.scrollBy(this.pageSize);
|
|
157
|
-
else if (matchesKey(data, Key.home))
|
|
158
|
-
this.scrollTo(0);
|
|
159
|
-
else if (matchesKey(data, Key.end))
|
|
160
|
-
this.scrollTo(this.contentLength);
|
|
136
|
+
handleMouse(event) {
|
|
137
|
+
if (this.placement !== "floating" || event.type !== "wheel" || !event.wheelDelta)
|
|
138
|
+
return undefined;
|
|
139
|
+
const changed = this.scrollBy(event.wheelDelta < 0 ? -1 : 1);
|
|
140
|
+
return { handled: true, render: changed };
|
|
161
141
|
}
|
|
162
142
|
invalidate() { }
|
|
163
143
|
scrollBy(lines) {
|
|
164
|
-
this.scrollTo(this.scrollOffset + lines);
|
|
144
|
+
return this.scrollTo(this.scrollOffset + lines);
|
|
165
145
|
}
|
|
166
146
|
scrollTo(offset) {
|
|
167
|
-
this.scrollOffset
|
|
168
|
-
this.
|
|
169
|
-
this.
|
|
147
|
+
const previous = this.scrollOffset;
|
|
148
|
+
this.scrollOffset = Math.max(0, Math.min(offset, this.maxScrollOffset()));
|
|
149
|
+
this.followTail = this.scrollOffset >= this.maxScrollOffset();
|
|
150
|
+
return this.scrollOffset !== previous;
|
|
170
151
|
}
|
|
171
152
|
clampScrollOffset() {
|
|
172
|
-
this.scrollOffset = Math.max(0, Math.min(this.scrollOffset,
|
|
153
|
+
this.scrollOffset = Math.max(0, Math.min(this.scrollOffset, this.maxScrollOffset()));
|
|
154
|
+
if (this.scrollOffset >= this.maxScrollOffset())
|
|
155
|
+
this.followTail = true;
|
|
156
|
+
}
|
|
157
|
+
maxScrollOffset() {
|
|
158
|
+
return Math.max(0, this.contentLength - this.pageSize);
|
|
173
159
|
}
|
|
174
160
|
}
|
|
175
161
|
function workSummaryLine(status, name, count, width, theme) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { type Component, type Focusable, type TUI } from "@earendil-works/pi-tui";
|
|
1
|
+
import { type KeybindingsManager, type Theme } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import { type Component, type Focusable, type TUI, type TuiMouseEvent, type TuiMouseEventResult } from "@earendil-works/pi-tui";
|
|
3
3
|
import type { TaskState } from "../state.js";
|
|
4
4
|
export declare class WorksDashboard implements Component, Focusable {
|
|
5
5
|
private readonly tui;
|
|
@@ -14,11 +14,17 @@ export declare class WorksDashboard implements Component, Focusable {
|
|
|
14
14
|
private detailPageSize;
|
|
15
15
|
private detailsVisible;
|
|
16
16
|
private message;
|
|
17
|
+
private messageColor;
|
|
18
|
+
private copying;
|
|
19
|
+
private minimized;
|
|
20
|
+
private copyHitRegion;
|
|
21
|
+
private toggleHitRegion;
|
|
17
22
|
private disposed;
|
|
18
23
|
private readonly refreshTimer;
|
|
19
24
|
constructor(tui: TUI, theme: Theme, keybindings: KeybindingsManager, state: TaskState, close: () => void);
|
|
20
25
|
render(width: number): string[];
|
|
21
26
|
handleInput(data: string): void;
|
|
27
|
+
handleMouse(event: TuiMouseEvent): TuiMouseEventResult | undefined;
|
|
22
28
|
invalidate(): void;
|
|
23
29
|
dispose(): void;
|
|
24
30
|
private items;
|
|
@@ -27,5 +33,9 @@ export declare class WorksDashboard implements Component, Focusable {
|
|
|
27
33
|
private keepSelectionVisible;
|
|
28
34
|
private renderRow;
|
|
29
35
|
private renderDetails;
|
|
36
|
+
private renderHeader;
|
|
37
|
+
private toggleMinimized;
|
|
38
|
+
private isHit;
|
|
39
|
+
private copyAllAsMarkdown;
|
|
30
40
|
private renderFooter;
|
|
31
41
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { copyToClipboard } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import { matchesKey, truncateToWidth, visibleWidth, wrapTextWithAnsi, } from "@earendil-works/pi-tui";
|
|
2
3
|
import { safeMultiline, safeSingleLine } from "../text.js";
|
|
3
4
|
import { border, frame, rule, todoIcon, workIcon } from "./panel.js";
|
|
4
5
|
const CHROME_LINES = 8;
|
|
@@ -15,6 +16,11 @@ export class WorksDashboard {
|
|
|
15
16
|
detailPageSize = 1;
|
|
16
17
|
detailsVisible = true;
|
|
17
18
|
message = "Ready. Select an item; Escape closes.";
|
|
19
|
+
messageColor = "warning";
|
|
20
|
+
copying = false;
|
|
21
|
+
minimized = false;
|
|
22
|
+
copyHitRegion;
|
|
23
|
+
toggleHitRegion;
|
|
18
24
|
disposed = false;
|
|
19
25
|
refreshTimer;
|
|
20
26
|
constructor(tui, theme, keybindings, state, close) {
|
|
@@ -32,12 +38,20 @@ export class WorksDashboard {
|
|
|
32
38
|
render(width) {
|
|
33
39
|
const dialogWidth = Math.max(1, width);
|
|
34
40
|
const innerWidth = Math.max(1, dialogWidth - 2);
|
|
35
|
-
const
|
|
41
|
+
const works = this.state.listWorks();
|
|
42
|
+
const todos = works.flatMap((work) => work.tasks);
|
|
43
|
+
const header = this.renderHeader(innerWidth, works.length, todos.length);
|
|
44
|
+
if (this.minimized) {
|
|
45
|
+
return [
|
|
46
|
+
border(innerWidth, "top", this.theme),
|
|
47
|
+
frame(header, innerWidth, this.theme),
|
|
48
|
+
border(innerWidth, "bottom", this.theme),
|
|
49
|
+
];
|
|
50
|
+
}
|
|
51
|
+
const items = this.items(works);
|
|
36
52
|
this.syncSelection(items);
|
|
37
53
|
const terminalRows = this.tui.terminal.rows || process.stdout.rows || 30;
|
|
38
54
|
const dialogHeight = Math.max(8, Math.min(36, Math.floor(terminalRows * 0.82)));
|
|
39
|
-
const works = this.state.listWorks();
|
|
40
|
-
const todos = works.flatMap((work) => work.tasks);
|
|
41
55
|
const activeWorks = works.filter((work) => work.status === "active").length;
|
|
42
56
|
const completedTodos = todos.filter((todo) => todo.status === "completed").length;
|
|
43
57
|
const summary = `${activeWorks}/${works.length} works active · ${completedTodos}/${todos.length} todos completed · session scoped`;
|
|
@@ -52,12 +66,12 @@ export class WorksDashboard {
|
|
|
52
66
|
rows.push("");
|
|
53
67
|
return [
|
|
54
68
|
border(innerWidth, "top", this.theme),
|
|
55
|
-
frame(
|
|
69
|
+
frame(header, innerWidth, this.theme),
|
|
56
70
|
frame(this.theme.fg("dim", summary), innerWidth, this.theme),
|
|
57
71
|
rule(innerWidth, this.theme),
|
|
58
72
|
...[...rows, ...details].map((line) => frame(line, innerWidth, this.theme)),
|
|
59
73
|
rule(innerWidth, this.theme),
|
|
60
|
-
frame(this.theme.fg(
|
|
74
|
+
frame(this.theme.fg(this.messageColor, truncateToWidth(this.message, innerWidth, "")), innerWidth, this.theme),
|
|
61
75
|
frame(this.renderFooter(innerWidth), innerWidth, this.theme),
|
|
62
76
|
border(innerWidth, "bottom", this.theme),
|
|
63
77
|
];
|
|
@@ -72,6 +86,17 @@ export class WorksDashboard {
|
|
|
72
86
|
this.close();
|
|
73
87
|
return;
|
|
74
88
|
}
|
|
89
|
+
if (matchesKey(data, "c")) {
|
|
90
|
+
void this.copyAllAsMarkdown();
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (matchesKey(data, "m")) {
|
|
94
|
+
this.toggleMinimized();
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
if (this.minimized)
|
|
98
|
+
return;
|
|
99
|
+
this.messageColor = "warning";
|
|
75
100
|
if (this.keybindings.matches(data, "tui.select.up")) {
|
|
76
101
|
this.select(items, index - 1);
|
|
77
102
|
}
|
|
@@ -93,6 +118,19 @@ export class WorksDashboard {
|
|
|
93
118
|
}
|
|
94
119
|
this.tui.requestRender();
|
|
95
120
|
}
|
|
121
|
+
handleMouse(event) {
|
|
122
|
+
if (this.disposed || event.type !== "click" || event.button !== "left" || event.y !== 1)
|
|
123
|
+
return undefined;
|
|
124
|
+
if (this.isHit(event.x, this.toggleHitRegion)) {
|
|
125
|
+
this.toggleMinimized();
|
|
126
|
+
return { handled: true, focus: true, render: true };
|
|
127
|
+
}
|
|
128
|
+
if (this.isHit(event.x, this.copyHitRegion)) {
|
|
129
|
+
void this.copyAllAsMarkdown();
|
|
130
|
+
return { handled: true, focus: true, render: true };
|
|
131
|
+
}
|
|
132
|
+
return undefined;
|
|
133
|
+
}
|
|
96
134
|
invalidate() { }
|
|
97
135
|
dispose() {
|
|
98
136
|
if (this.disposed)
|
|
@@ -100,9 +138,9 @@ export class WorksDashboard {
|
|
|
100
138
|
this.disposed = true;
|
|
101
139
|
clearInterval(this.refreshTimer);
|
|
102
140
|
}
|
|
103
|
-
items() {
|
|
141
|
+
items(works = this.state.listWorks()) {
|
|
104
142
|
const items = [];
|
|
105
|
-
for (const work of
|
|
143
|
+
for (const work of works) {
|
|
106
144
|
items.push({ key: `work:${work.workId}`, kind: "work", work });
|
|
107
145
|
for (const todo of work.tasks)
|
|
108
146
|
items.push({ key: `todo:${todo.taskId}`, kind: "todo", todo, workName: work.workName });
|
|
@@ -161,8 +199,86 @@ export class WorksDashboard {
|
|
|
161
199
|
...shown,
|
|
162
200
|
].slice(0, budget);
|
|
163
201
|
}
|
|
202
|
+
renderHeader(width, workCount, todoCount) {
|
|
203
|
+
const titleText = this.minimized
|
|
204
|
+
? `Works (${workCount} work${workCount === 1 ? "" : "s"}, ${todoCount} todo${todoCount === 1 ? "" : "s"})`
|
|
205
|
+
: "Works · session work and todos";
|
|
206
|
+
const title = this.theme.fg("accent", this.theme.bold(titleText));
|
|
207
|
+
const copyAction = this.copying
|
|
208
|
+
? this.theme.fg("dim", "[Copying…]")
|
|
209
|
+
: this.theme.fg("accent", this.theme.bold("[C Copy]"));
|
|
210
|
+
const toggleLabel = this.minimized ? "[M Maximize]" : "[M Minimize]";
|
|
211
|
+
const toggleAction = this.theme.fg("accent", this.theme.bold(toggleLabel));
|
|
212
|
+
const actionsWidth = visibleWidth(copyAction) + 1 + visibleWidth(toggleAction);
|
|
213
|
+
const titleWidth = Math.max(0, width - actionsWidth - 1);
|
|
214
|
+
const shownTitle = truncateToWidth(title, titleWidth, "");
|
|
215
|
+
const gap = " ".repeat(Math.max(1, width - visibleWidth(shownTitle) - actionsWidth));
|
|
216
|
+
const copyStart = 1 + visibleWidth(shownTitle) + gap.length;
|
|
217
|
+
this.copyHitRegion = { start: copyStart, end: copyStart + visibleWidth(copyAction) };
|
|
218
|
+
const toggleStart = this.copyHitRegion.end + 1;
|
|
219
|
+
this.toggleHitRegion = { start: toggleStart, end: toggleStart + visibleWidth(toggleAction) };
|
|
220
|
+
return `${shownTitle}${gap}${copyAction} ${toggleAction}`;
|
|
221
|
+
}
|
|
222
|
+
toggleMinimized() {
|
|
223
|
+
this.minimized = !this.minimized;
|
|
224
|
+
if (!this.minimized) {
|
|
225
|
+
this.message = "Dashboard maximized.";
|
|
226
|
+
this.messageColor = "warning";
|
|
227
|
+
}
|
|
228
|
+
this.tui.requestRender();
|
|
229
|
+
}
|
|
230
|
+
isHit(x, region) {
|
|
231
|
+
return region !== undefined && x >= region.start && x < region.end;
|
|
232
|
+
}
|
|
233
|
+
async copyAllAsMarkdown() {
|
|
234
|
+
if (this.copying)
|
|
235
|
+
return;
|
|
236
|
+
this.copying = true;
|
|
237
|
+
this.message = "Copying all works and todos as Markdown…";
|
|
238
|
+
this.messageColor = "warning";
|
|
239
|
+
this.tui.requestRender();
|
|
240
|
+
const works = this.state.listWorks();
|
|
241
|
+
try {
|
|
242
|
+
await copyToClipboard(formatWorksMarkdown(works));
|
|
243
|
+
const todoCount = works.reduce((total, work) => total + work.tasks.length, 0);
|
|
244
|
+
this.message = `Copied ${works.length} work${works.length === 1 ? "" : "s"} and ${todoCount} todo${todoCount === 1 ? "" : "s"} as Markdown.`;
|
|
245
|
+
this.messageColor = "success";
|
|
246
|
+
}
|
|
247
|
+
catch (error) {
|
|
248
|
+
const reason = error instanceof Error && error.message ? ` ${safeSingleLine(error.message)}` : "";
|
|
249
|
+
this.message = `Could not copy works and todos.${reason}`;
|
|
250
|
+
this.messageColor = "error";
|
|
251
|
+
}
|
|
252
|
+
finally {
|
|
253
|
+
this.copying = false;
|
|
254
|
+
if (!this.disposed)
|
|
255
|
+
this.tui.requestRender();
|
|
256
|
+
}
|
|
257
|
+
}
|
|
164
258
|
renderFooter(width) {
|
|
165
|
-
const text = "configured ↑/↓ select · PgUp/PgDn scroll details · confirm toggles · cancel closes";
|
|
259
|
+
const text = "C copy all · M minimize · configured ↑/↓ select · PgUp/PgDn scroll details · confirm toggles · cancel closes";
|
|
166
260
|
return truncateToWidth(this.theme.fg("muted", text), width, "");
|
|
167
261
|
}
|
|
168
262
|
}
|
|
263
|
+
function formatWorksMarkdown(works) {
|
|
264
|
+
const lines = ["# Works and Todos", ""];
|
|
265
|
+
if (works.length === 0)
|
|
266
|
+
return `${lines.join("\n")}\n_No works or todos in this session._\n`;
|
|
267
|
+
for (const work of works) {
|
|
268
|
+
lines.push(`## ${work.workId} — ${escapeMarkdownInline(safeSingleLine(work.workName))}`, "", `**Status:** ${work.status}`, "", "### Details", "", markdownBody(work.workInfo), "", "### Todos", "");
|
|
269
|
+
if (work.tasks.length === 0) {
|
|
270
|
+
lines.push("_No todos._", "");
|
|
271
|
+
continue;
|
|
272
|
+
}
|
|
273
|
+
for (const todo of work.tasks) {
|
|
274
|
+
lines.push(`#### ${todo.taskId} — ${escapeMarkdownInline(safeSingleLine(todo.taskName))}`, "", `**Status:** ${todo.status}`, "", markdownBody(todo.taskInfo), "");
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
return `${lines.join("\n").trimEnd()}\n`;
|
|
278
|
+
}
|
|
279
|
+
function markdownBody(value) {
|
|
280
|
+
return safeMultiline(value).join("\n").trim() || "_No details provided._";
|
|
281
|
+
}
|
|
282
|
+
function escapeMarkdownInline(value) {
|
|
283
|
+
return value.replace(/([-\\`*_[\]{}()<>#+.!|])/g, "\\$1");
|
|
284
|
+
}
|
package/docs/REFERENCE.md
CHANGED
|
@@ -30,6 +30,6 @@ The guidance is not added when the tracking tools have been removed from the act
|
|
|
30
30
|
|
|
31
31
|
## Interfaces
|
|
32
32
|
|
|
33
|
-
The compact panel defaults to a non-capturing floating overlay anchored at the top-right. It shows work and todo names, status icons, completion counts, and a visible row range when content exceeds the terminal-aware viewport. It hides on terminals narrower than 90 columns or shorter than 18 rows.
|
|
33
|
+
The compact panel defaults to a non-capturing floating overlay anchored at the top-right. It shows work and todo names, status icons, completion counts, and a visible row range when content exceeds the terminal-aware viewport. It hides on terminals narrower than 90 columns or shorter than 18 rows. Overflow starts at the newest rows and follows newly added tail rows until the user scrolls upward. In fullscreen TUI mode, mouse-wheel events over the panel scroll it directly without taking keyboard focus; regular terminal mode shows the newest rows and uses `/works` for complete browsing. Because Pi treats any persistent overlay as active, the floating mode can block display-mode changes. `/works-panel widget` switches to a right-aligned widget above the editor and renders all rows, while `/works-panel off` hides it.
|
|
34
34
|
|
|
35
|
-
`/works` opens a top-centered detailed overlay. Configured selection keys choose records, configured Page Up and Page Down keys scroll long details, the configured confirmation key toggles details, and the configured cancel key closes it.
|
|
35
|
+
`/works` opens a top-centered detailed overlay. Its top-right Copy action uses `c` to copy every work and nested todo to the system clipboard as Markdown. Its Minimize action uses `m` to collapse the overlay to a framed top bar containing live total work and todo counts, Copy, and a Maximize action; activating Maximize restores the full dashboard. In fullscreen TUI mode, Copy and Minimize/Maximize also respond to left clicks. Configured selection keys choose records, configured Page Up and Page Down keys scroll long details, the configured confirmation key toggles details, and the configured cancel key closes it.
|
package/docs/USAGE_GUIDE.md
CHANGED
|
@@ -37,12 +37,15 @@ TodoDelete taskId="T1"
|
|
|
37
37
|
|
|
38
38
|
## TUI
|
|
39
39
|
|
|
40
|
-
The panel defaults to a floating top-right layout and does not take keyboard focus. It hides on small terminals. When
|
|
40
|
+
The panel defaults to a floating top-right layout and does not take keyboard focus. It hides on small terminals. When more rows exist than fit, it starts at the newest rows. In fullscreen TUI mode, move the mouse over the panel and use the wheel to scroll older or newer rows without taking focus from the editor. In regular terminal mode, open `/works` to browse the complete list.
|
|
41
41
|
|
|
42
42
|
Use `/works-panel widget` for a right-aligned layout above the editor that renders every row, `/works-panel floating` to return to the floating layout, or `/works-panel off` to hide it.
|
|
43
43
|
|
|
44
|
-
Run `/works` for full details
|
|
44
|
+
Run `/works` for full details. Its top bar includes Copy and Minimize actions. In fullscreen TUI mode, click Minimize to collapse the dashboard to a top bar showing the current work and todo totals; click Maximize to restore it. The actions also have keyboard shortcuts that work in regular terminal mode.
|
|
45
45
|
|
|
46
|
+
- `c`: copy all works and todos as Markdown
|
|
47
|
+
- `m`: minimize or maximize the dashboard
|
|
48
|
+
- Fullscreen left click: activate Copy, Minimize, or Maximize
|
|
46
49
|
- Configured Up/Down keys: select
|
|
47
50
|
- Configured Page Up/Page Down keys: scroll long details
|
|
48
51
|
- Configured confirmation key: show or hide detailed information
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abhishek944/pi-tasks",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Session-scoped work and todo tracking for Pi.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"./package.json": "./package.json"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@earendil-works/pi-coding-agent": ">=0.
|
|
35
|
-
"@earendil-works/pi-tui": "
|
|
34
|
+
"@earendil-works/pi-coding-agent": ">=0.85.1",
|
|
35
|
+
"@earendil-works/pi-tui": ">=0.85.1",
|
|
36
36
|
"@earendil-works/pi-ai": "*",
|
|
37
37
|
"typebox": "*"
|
|
38
38
|
},
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@biomejs/biome": "^2.4.13",
|
|
49
|
-
"@earendil-works/pi-ai": "0.
|
|
50
|
-
"@earendil-works/pi-coding-agent": "0.
|
|
51
|
-
"@earendil-works/pi-tui": "0.
|
|
49
|
+
"@earendil-works/pi-ai": "0.85.1",
|
|
50
|
+
"@earendil-works/pi-coding-agent": "0.85.1",
|
|
51
|
+
"@earendil-works/pi-tui": "0.85.1",
|
|
52
52
|
"@types/node": "^26.1.2",
|
|
53
53
|
"typebox": "1.3.16",
|
|
54
54
|
"typescript": "^7.0.2"
|