@shivaedev/work-board 0.4.0 → 0.4.1
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 +9 -0
- package/dist/cli.js +1 -1
- package/dist/history/script.d.ts.map +1 -1
- package/dist/history/script.js +15 -3
- package/dist/history/script.js.map +1 -1
- package/package.json +2 -2
- package/src/cli.ts +1 -1
- package/src/history/script.ts +15 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.1 - 2026-10-05
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- Let an explicit Mark seen observation finish through background/live refresh
|
|
8
|
+
and then reconcile current source. Keep newer clearing or another tab's
|
|
9
|
+
storage changes authoritative so a cancelled observation cannot restore
|
|
10
|
+
discarded history. Preserve the existing browser-local retention limits.
|
|
11
|
+
|
|
3
12
|
## 0.4.0 - 2026-10-05
|
|
4
13
|
|
|
5
14
|
### Added
|
package/dist/cli.js
CHANGED
|
@@ -3,7 +3,7 @@ import { NodeRuntime, NodeServices } from "@effect/platform-node";
|
|
|
3
3
|
import { Effect, Layer, Option, Path } from "effect";
|
|
4
4
|
import { Argument, Command, Flag } from "effect/unstable/cli";
|
|
5
5
|
import { HOST, serveBoard } from "./serve.js";
|
|
6
|
-
const VERSION = "0.4.
|
|
6
|
+
const VERSION = "0.4.1";
|
|
7
7
|
const serve = Effect.fn("WorkBoard.serve")(function* (input) {
|
|
8
8
|
const path = yield* Path.Path;
|
|
9
9
|
return yield* Layer.launch(serveBoard({ home: Option.getOrUndefined(input.home), port: input.port, root: path.resolve(input.dir) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"script.d.ts","sourceRoot":"","sources":["../../src/history/script.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"script.d.ts","sourceRoot":"","sources":["../../src/history/script.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,IAAI,MAAM,CA2HtC"}
|
package/dist/history/script.js
CHANGED
|
@@ -8,6 +8,7 @@ let storageNotice = "";
|
|
|
8
8
|
let unavailableHtml = "";
|
|
9
9
|
let generation = 0;
|
|
10
10
|
let controller;
|
|
11
|
+
let observing = null;
|
|
11
12
|
const baseline = () => {
|
|
12
13
|
if (memory !== undefined) return memory;
|
|
13
14
|
try { return localStorage.getItem(key); }
|
|
@@ -63,6 +64,7 @@ const query = async (action) => {
|
|
|
63
64
|
return result;
|
|
64
65
|
};
|
|
65
66
|
const refresh = async () => {
|
|
67
|
+
if (observing !== null) return;
|
|
66
68
|
const visible = document.getElementById("doc")?.dataset.view === "changes";
|
|
67
69
|
try {
|
|
68
70
|
const result = await query(visible ? "compare" : "check");
|
|
@@ -81,6 +83,7 @@ const refresh = async () => {
|
|
|
81
83
|
};
|
|
82
84
|
document.addEventListener("click", async (event) => {
|
|
83
85
|
if (event.target.closest?.("#history-clear")) {
|
|
86
|
+
observing = null;
|
|
84
87
|
++generation;
|
|
85
88
|
controller?.abort();
|
|
86
89
|
forget();
|
|
@@ -88,6 +91,9 @@ document.addEventListener("click", async (event) => {
|
|
|
88
91
|
await refresh();
|
|
89
92
|
}
|
|
90
93
|
if (event.target.closest?.("#history-mark")) {
|
|
94
|
+
if (observing !== null) return;
|
|
95
|
+
const mine = generation + 1;
|
|
96
|
+
observing = mine;
|
|
91
97
|
controls(false, true);
|
|
92
98
|
try {
|
|
93
99
|
const result = await query("observe");
|
|
@@ -95,16 +101,22 @@ document.addEventListener("click", async (event) => {
|
|
|
95
101
|
if (result.snapshot === null) { render(result.html); controls(false); return; }
|
|
96
102
|
keep(result.snapshot);
|
|
97
103
|
unavailableHtml = "";
|
|
98
|
-
await refresh();
|
|
99
104
|
} catch (error) {
|
|
100
105
|
if (error.name !== "AbortError") { render("<p>Could not remember the current observation. Your previous baseline is preserved.</p>"); controls(false); }
|
|
101
|
-
|
|
106
|
+
return;
|
|
107
|
+
} finally { if (observing === mine) observing = null; }
|
|
108
|
+
await refresh();
|
|
102
109
|
}
|
|
103
110
|
});
|
|
104
111
|
document.addEventListener("board-page", refresh);
|
|
105
112
|
document.addEventListener("visibilitychange", () => { if (!document.hidden) refresh(); });
|
|
106
113
|
window.addEventListener("storage", (event) => {
|
|
107
|
-
if (event.key === key || event.key === null) {
|
|
114
|
+
if (event.key === key || event.key === null) {
|
|
115
|
+
observing = null;
|
|
116
|
+
++generation;
|
|
117
|
+
controller?.abort();
|
|
118
|
+
memory = undefined; storageNotice = ""; unavailableHtml = ""; refresh();
|
|
119
|
+
}
|
|
108
120
|
});
|
|
109
121
|
setInterval(() => { if (baseline() !== null) refresh(); }, 60000);
|
|
110
122
|
refresh();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"script.js","sourceRoot":"","sources":["../../src/history/script.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,aAAa;IAC5B,OAAO
|
|
1
|
+
{"version":3,"file":"script.js","sourceRoot":"","sources":["../../src/history/script.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,aAAa;IAC5B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyHP,CAAC;AACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shivaedev/work-board",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Serve a folder of markdown files as a live local page that updates in place when a file changes",
|
|
5
5
|
"homepage": "https://github.com/ShivaeDev/platform/tree/main/packages/work-board#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@effect/platform-node": "4.0.0-rc.112",
|
|
54
54
|
"@effect/platform-node-shared": "4.0.0-rc.112",
|
|
55
|
-
"@shivaedev/quality": "0.
|
|
55
|
+
"@shivaedev/quality": "0.15.0",
|
|
56
56
|
"@types/hast": "3.0.5",
|
|
57
57
|
"@types/mdast": "4.0.4",
|
|
58
58
|
"@types/node": "24.10.1",
|
package/src/cli.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { Effect, Layer, Option, Path } from "effect";
|
|
|
4
4
|
import { Argument, Command, Flag } from "effect/unstable/cli";
|
|
5
5
|
import { HOST, serveBoard } from "./serve.ts";
|
|
6
6
|
|
|
7
|
-
const VERSION = "0.4.
|
|
7
|
+
const VERSION = "0.4.1";
|
|
8
8
|
|
|
9
9
|
const serve = Effect.fn("WorkBoard.serve")(function* (input: { readonly dir: string; readonly port: number; readonly home: Option.Option<string> }) {
|
|
10
10
|
const path = yield* Path.Path;
|
package/src/history/script.ts
CHANGED
|
@@ -8,6 +8,7 @@ let storageNotice = "";
|
|
|
8
8
|
let unavailableHtml = "";
|
|
9
9
|
let generation = 0;
|
|
10
10
|
let controller;
|
|
11
|
+
let observing = null;
|
|
11
12
|
const baseline = () => {
|
|
12
13
|
if (memory !== undefined) return memory;
|
|
13
14
|
try { return localStorage.getItem(key); }
|
|
@@ -63,6 +64,7 @@ const query = async (action) => {
|
|
|
63
64
|
return result;
|
|
64
65
|
};
|
|
65
66
|
const refresh = async () => {
|
|
67
|
+
if (observing !== null) return;
|
|
66
68
|
const visible = document.getElementById("doc")?.dataset.view === "changes";
|
|
67
69
|
try {
|
|
68
70
|
const result = await query(visible ? "compare" : "check");
|
|
@@ -81,6 +83,7 @@ const refresh = async () => {
|
|
|
81
83
|
};
|
|
82
84
|
document.addEventListener("click", async (event) => {
|
|
83
85
|
if (event.target.closest?.("#history-clear")) {
|
|
86
|
+
observing = null;
|
|
84
87
|
++generation;
|
|
85
88
|
controller?.abort();
|
|
86
89
|
forget();
|
|
@@ -88,6 +91,9 @@ document.addEventListener("click", async (event) => {
|
|
|
88
91
|
await refresh();
|
|
89
92
|
}
|
|
90
93
|
if (event.target.closest?.("#history-mark")) {
|
|
94
|
+
if (observing !== null) return;
|
|
95
|
+
const mine = generation + 1;
|
|
96
|
+
observing = mine;
|
|
91
97
|
controls(false, true);
|
|
92
98
|
try {
|
|
93
99
|
const result = await query("observe");
|
|
@@ -95,16 +101,22 @@ document.addEventListener("click", async (event) => {
|
|
|
95
101
|
if (result.snapshot === null) { render(result.html); controls(false); return; }
|
|
96
102
|
keep(result.snapshot);
|
|
97
103
|
unavailableHtml = "";
|
|
98
|
-
await refresh();
|
|
99
104
|
} catch (error) {
|
|
100
105
|
if (error.name !== "AbortError") { render("<p>Could not remember the current observation. Your previous baseline is preserved.</p>"); controls(false); }
|
|
101
|
-
|
|
106
|
+
return;
|
|
107
|
+
} finally { if (observing === mine) observing = null; }
|
|
108
|
+
await refresh();
|
|
102
109
|
}
|
|
103
110
|
});
|
|
104
111
|
document.addEventListener("board-page", refresh);
|
|
105
112
|
document.addEventListener("visibilitychange", () => { if (!document.hidden) refresh(); });
|
|
106
113
|
window.addEventListener("storage", (event) => {
|
|
107
|
-
if (event.key === key || event.key === null) {
|
|
114
|
+
if (event.key === key || event.key === null) {
|
|
115
|
+
observing = null;
|
|
116
|
+
++generation;
|
|
117
|
+
controller?.abort();
|
|
118
|
+
memory = undefined; storageNotice = ""; unavailableHtml = ""; refresh();
|
|
119
|
+
}
|
|
108
120
|
});
|
|
109
121
|
setInterval(() => { if (baseline() !== null) refresh(); }, 60000);
|
|
110
122
|
refresh();
|