revspec 0.8.5 → 0.8.6
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/bin/revspec.ts +1 -2
- package/package.json +1 -1
- package/src/cli/watch.ts +12 -1
- package/src/tui/pager.ts +4 -13
- package/src/tui/ui/theme.ts +5 -5
package/bin/revspec.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { existsSync } from "fs";
|
|
3
3
|
import { resolve, basename, extname, dirname, join } from "path";
|
|
4
4
|
import { runTui } from "../src/tui/app";
|
|
5
|
+
import pkg from "../package.json";
|
|
5
6
|
|
|
6
7
|
const args = process.argv.slice(2);
|
|
7
8
|
const subcommand = args[0];
|
|
@@ -36,7 +37,6 @@ if (args.length === 0 || args.includes("--help") || args.includes("-h")) {
|
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
if (args.includes("--version") || args.includes("-v")) {
|
|
39
|
-
const pkg = await Bun.file(new URL("../package.json", import.meta.url)).json();
|
|
40
40
|
console.log(`revspec ${pkg.version}`);
|
|
41
41
|
process.exit(0);
|
|
42
42
|
}
|
|
@@ -55,7 +55,6 @@ if (!existsSync(specPath)) {
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
// 2. Launch TUI
|
|
58
|
-
const pkg = await Bun.file(new URL("../package.json", import.meta.url)).json();
|
|
59
58
|
await runTui(specPath, pkg.version);
|
|
60
59
|
|
|
61
60
|
process.exit(0);
|
package/package.json
CHANGED
package/src/cli/watch.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { existsSync, readFileSync, writeFileSync, unlinkSync, renameSync } from "fs";
|
|
1
|
+
import { existsSync, readFileSync, writeFileSync, unlinkSync, renameSync, statSync } from "fs";
|
|
2
2
|
import { watch as fsWatch } from "fs";
|
|
3
3
|
import { resolve, dirname, basename, join } from "path";
|
|
4
4
|
import {
|
|
@@ -69,6 +69,17 @@ export async function runWatch(specFile: string): Promise<void> {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
+
// Reset offset if JSONL was deleted/recreated/truncated (file smaller than offset)
|
|
73
|
+
if (existsSync(jsonlPath)) {
|
|
74
|
+
if (offset > statSync(jsonlPath).size) {
|
|
75
|
+
offset = 0;
|
|
76
|
+
lastSubmitTs = 0;
|
|
77
|
+
}
|
|
78
|
+
} else {
|
|
79
|
+
offset = 0;
|
|
80
|
+
lastSubmitTs = 0;
|
|
81
|
+
}
|
|
82
|
+
|
|
72
83
|
// Read spec lines for context
|
|
73
84
|
const specLines = readFileSync(specPath, "utf8").split("\n");
|
|
74
85
|
|
package/src/tui/pager.ts
CHANGED
|
@@ -30,14 +30,7 @@ export function buildPagerContent(state: ReviewState, searchQuery?: string | nul
|
|
|
30
30
|
}
|
|
31
31
|
let indicator = " ";
|
|
32
32
|
if (thread) {
|
|
33
|
-
|
|
34
|
-
if (isUnread) {
|
|
35
|
-
indicator = "\u2588";
|
|
36
|
-
} else if (thread.status === "resolved") {
|
|
37
|
-
indicator = "=";
|
|
38
|
-
} else {
|
|
39
|
-
indicator = "\u258c";
|
|
40
|
-
}
|
|
33
|
+
indicator = "\u2588"; // █ full block for all statuses
|
|
41
34
|
}
|
|
42
35
|
const numStr = String(lineNum);
|
|
43
36
|
const padded = " ".repeat(numWidth - numStr.length) + numStr;
|
|
@@ -156,20 +149,18 @@ export function buildPagerNodes(lineNode: TextRenderable, state: ReviewState, se
|
|
|
156
149
|
const prefix = isCursor ? ">" : " ";
|
|
157
150
|
const specText = state.specLines[i];
|
|
158
151
|
|
|
159
|
-
// Thread indicator — gutter bar on the left
|
|
152
|
+
// Thread indicator — gutter bar on the left (all █, color-coded)
|
|
160
153
|
let indicator = " ";
|
|
161
154
|
let indicatorColor: string = theme.textDim;
|
|
162
155
|
if (thread) {
|
|
156
|
+
indicator = "\u2588"; // █ full block
|
|
163
157
|
const isUnread = unreadThreadIds && unreadThreadIds.has(thread.id);
|
|
164
158
|
if (isUnread) {
|
|
165
|
-
indicator = "\u2588"; // █ full block — unread reply
|
|
166
159
|
indicatorColor = theme.yellow;
|
|
167
160
|
} else if (thread.status === "resolved") {
|
|
168
|
-
indicator = "="; // resolved
|
|
169
161
|
indicatorColor = theme.green;
|
|
170
162
|
} else {
|
|
171
|
-
|
|
172
|
-
indicatorColor = theme.blue;
|
|
163
|
+
indicatorColor = theme.text; // open — white
|
|
173
164
|
}
|
|
174
165
|
}
|
|
175
166
|
|
package/src/tui/ui/theme.ts
CHANGED
|
@@ -2,7 +2,7 @@ export const theme = {
|
|
|
2
2
|
// Surfaces
|
|
3
3
|
base: undefined,
|
|
4
4
|
backgroundPanel: "#313244",
|
|
5
|
-
backgroundElement:
|
|
5
|
+
backgroundElement: "#313244",
|
|
6
6
|
|
|
7
7
|
// Text hierarchy
|
|
8
8
|
text: "#cdd6f4",
|
|
@@ -28,10 +28,10 @@ export const theme = {
|
|
|
28
28
|
} as const;
|
|
29
29
|
|
|
30
30
|
export const STATUS_ICONS: Record<string, string> = {
|
|
31
|
-
open: "\
|
|
32
|
-
pending: "\u2588", // █ full block
|
|
33
|
-
resolved: "
|
|
34
|
-
outdated: "
|
|
31
|
+
open: "\u2588", // █ full block — white
|
|
32
|
+
pending: "\u2588", // █ full block — yellow (unread)
|
|
33
|
+
resolved: "\u2588", // █ full block — green
|
|
34
|
+
outdated: "\u2588", // █ full block — dim
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
export const SPLIT_BORDER = {
|