@skillre/dsh-plugin-sticky-wall 0.9.3 → 0.9.4
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.en.md +2 -1
- package/README.md +2 -1
- package/compatibility.json +96 -0
- package/lib/client.js +27 -6
- package/lib/index.js +1 -0
- package/lib/layout.js +15 -4
- package/lib/store.d.ts +14 -0
- package/lib/store.js +18 -0
- package/lib/transport.d.ts +12 -0
- package/lib/transport.js +4 -0
- package/lib/types.d.ts +47 -7
- package/lib/types.js +22 -6
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -26,6 +26,7 @@ Non-goals: task management (no scheduling, assignment or reminders), collaborati
|
|
|
26
26
|
- **Full-window canvas** — the wall fills the entire window: no title row and no toolbar row. Every control lives in one **floating dock** at the bottom.
|
|
27
27
|
- **A compact dock** — only the frequent actions stay in the strip: search, filters, three **icon** view buttons, zoom (`− / percent / +`, where the percentage is itself the reset button), tidy and new. Sort, show-archived and clear-archive moved into a `⋯` overflow menu. The dock is a **single row**, centred, and sizes to the window, so no button spills past the strip it is drawn on.
|
|
28
28
|
- **Camera** — drag empty paper to pan, scroll to pan, `⌘/Ctrl + wheel` to zoom around the pointer (0.35×–2×). Opening the wall and pressing reset both frame the whole wall and centre it. The greeting and the capture field are **page chrome**: they keep their natural size at every zoom level instead of shrinking with the canvas.
|
|
29
|
+
- **The centre tally** — the "N notes · M archived" line under the greeting describes the **whole wall**, not the current filter, so the archive count stays correct while archived notes are hidden (an older build counted archived notes out of the visible list, which by default excludes them and therefore always read zero). How many notes the current view holds is the dock's count label.
|
|
29
30
|
- **Markdown bodies** — headings, paragraphs, bold/italic/strikethrough, `code`, code blocks, ordered and unordered lists, `- [ ]` checkboxes, quotes, rules, tables and http(s)/mailto links. The composer has a "Preview" toggle.
|
|
30
31
|
- **Quick capture** — "New" opens a note sheet with an optional title, required body, tags, six pastel colors and a width preset. The sheet starts out large (880×680, still centred on its scrim) and carries a grip in its bottom-right corner: drag it to resize with the pointer, or focus it and use the arrow keys — left/right change the width, up/down the height, `Shift` plus an arrow takes a bigger step, `0` restores the default, and double-clicking the grip resets it too. A size is clamped to stay inside the window with a 24px margin and never goes below 460×380. The size you choose is remembered on this machine and restored next time, and it is **that size** that is remembered: open the wall in a small window and the sheet shrinks to fit, then returns to what you actually picked once the window grows back. The body editor and the preview both fill the sheet instead of each carrying its own height cap.
|
|
31
32
|
- **Pin and archive** — pinned notes carry a coloured left rail and a star; archived notes hide by default, the "Archive" filter fetches them on its own, and "Clear archive" is a permanent delete.
|
|
@@ -160,7 +161,7 @@ The install path was verified end to end: derive the spec from the live index, i
|
|
|
160
161
|
- Card width has only **three presets** (small/medium/large); there is no arbitrary resize. A drag keeps the card's existing tilt. This is about a **card on the canvas** — the only thing you can size freely is the note sheet.
|
|
161
162
|
- Tidy is O(n) spiral placement plus a spatial-grid collision check; the wall holds at most 400 notes, and a wall larger than the viewport needs panning or zooming out.
|
|
162
163
|
- The canvas is a flat plane: no grouping, layers, connectors or snap alignment, and no rotation gesture beyond the stored tilt.
|
|
163
|
-
- Auto-framing has a legibility floor (42%): a large wall is centred rather than crammed entirely into view, so panning is expected. The middle is
|
|
164
|
+
- Auto-framing has a legibility floor (42%): a large wall is centred rather than crammed entirely into view, so panning is expected. The reserved middle is sized for that **framing floor** (42%) rather than for 100%, so at every zoom level tidy keeps cards out of the space the greeting and the capture field occupy; a capture on a panned or zoomed wall avoids wherever the field currently sits. The greeting and the capture field are **page chrome**, so they keep a fixed size instead of scaling with the canvas.
|
|
164
165
|
- Placement is owned by the Host, but two windows open on the same wall each render their own snapshot and do not live-push the other's drags — they do refetch on focus and on the slow poll, so neither stays stale for long.
|
|
165
166
|
- Archived notes do not occupy a `maxNotes` slot, but restoring them does; a restore at the cap is rejected instead of silently overshooting.
|
|
166
167
|
- "Clear archive" is a permanent, irreversible delete.
|
package/README.md
CHANGED
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
- **全幅画布**:便签墙占满整个窗口,没有顶部标题栏和工具栏;所有控件收进底部一条**浮动菜单栏**。
|
|
27
27
|
- **紧凑菜单栏**:底部只留高频动作 —— 搜索、筛选、三个**图标**视图切换、缩放(`− / 百分比 / +`,百分比本身可点即重置)、整理、新建。排序、显示归档、清空归档收进 `⋯` 溢出菜单。菜单栏是**单行**、居中、宽度自适应窗口,任何按钮都不会溢出背景条。
|
|
28
28
|
- **相机**:拖动空白纸面平移,滚轮平移,`⌘/Ctrl + 滚轮` 以指针为锚点缩放(0.35×–2×);打开与重置时自动把整面墙框进视野。中间的问候语与记录框是**页面控件**,任何缩放级别下都保持原始大小,不会跟着画布一起缩小。
|
|
29
|
+
- **中间的统计**:问候语下面那行「N 张便签 · M 张已归档」说的是**整面墙**的构成,不是当前筛选结果 —— 所以归档被隐藏时它照样报出归档数量(旧版从当前列表里数归档,而默认列表本来就不含归档便签,于是永远显示 0)。当前视图里有多少条,由底部菜单栏的计数负责。
|
|
29
30
|
- **Markdown 正文**:正文按 Markdown 渲染 —— 标题、段落、粗体/斜体/删除线、`代码`、代码块、有序/无序列表、`- [ ]` 复选、引用、分隔线、表格、http(s)/mailto 链接。编辑时右侧有「预览」切换。
|
|
30
31
|
- **随手记录**:`+ 新建` 打开便签纸,标题可选、正文必填,可打标签、选六种柔和底色、选卡片宽度。便签纸默认就很大(880×680,仍然在遮罩里居中),右下角有一个握把:拖它用指针改尺寸,聚焦后方向键也能改 —— 左右改宽、上下改高,`Shift + 方向键` 一次走更大的步长,`0` 恢复默认,双击握把同样恢复默认。尺寸被限制在「始终待在窗口内、四周留 24px」与 460×380 的下限之间。选好的尺寸记在本机、下次打开照旧,而且记的是**你选的那个尺寸本身**:小窗口里打开会先缩到装得下,窗口放大后回到你真正选过的尺寸。正文编辑器与预览都撑满整张便签纸,不再各自带一个高度上限。
|
|
31
32
|
- **置顶与归档**:置顶的便签带左侧色条与星标;归档的便签默认隐藏,「归档」筛选会单独拉取它们,「清空归档」是永久删除。
|
|
@@ -171,7 +172,7 @@ node scripts/preview.mjs check # 离线校验预览图与 locale 元数据(n
|
|
|
171
172
|
- 卡片宽度只有小/中/大**三档预设**,不支持任意拖拽调整宽度;拖动会保留卡片原有的轻微倾角。这一条说的是**画布上的卡片**,大小可调的只有随手记录的便签纸。
|
|
172
173
|
- 整理是 O(n) 的螺旋放置 + 网格碰撞检测;便签上限 400 张,超出视野的墙需要自己平移或缩小。
|
|
173
174
|
- 画布是二维平面:没有分组、图层、连线或吸附对齐;也不支持双指旋转或触屏捏合之外的手势。
|
|
174
|
-
- 自动取景有可读性下限(42
|
|
175
|
+
- 自动取景有可读性下限(42%):便签很多时整面墙不会全部挤进视野,而是居中显示、需要平移查看。中间那块留白是按**取景下限**(42%)而不是按 100% 算出来的,所以任何缩放级别下整理都不会把卡片放进问候语和记录框占用的区域;平移到别处再新建时,落点也会避开记录框当前所在的位置。中间的问候语和记录框是**页面控件**,缩放时保持固定大小、不跟随画布放大缩小。
|
|
175
176
|
- 便签的位置由 Host 保存;同一面墙在两个窗口同时打开时,各自渲染自己的快照,不会实时推送另一个窗口的拖动结果 —— 但窗口重新获得焦点/重新可见时会重新拉取,所以不会长期停在旧状态。
|
|
176
177
|
- 归档便签不占 `maxNotes` 名额,但恢复它们会占名额;名额已满时恢复会被拒绝而不是悄悄超限。
|
|
177
178
|
- 「清空归档」是永久删除,不可撤销。
|
package/compatibility.json
CHANGED
|
@@ -2,6 +2,102 @@
|
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"package": "@skillre/dsh-plugin-sticky-wall",
|
|
4
4
|
"verified": [
|
|
5
|
+
{
|
|
6
|
+
"dsh": "0.2.2-rc.5",
|
|
7
|
+
"verifiedAt": "2026-11-20",
|
|
8
|
+
"result": "passed",
|
|
9
|
+
"checks": [
|
|
10
|
+
"dsh-version",
|
|
11
|
+
"profile-template-created",
|
|
12
|
+
"profile-tarball-install",
|
|
13
|
+
"packed-dependency-and-selection",
|
|
14
|
+
"dump-config",
|
|
15
|
+
"packed-payload-present",
|
|
16
|
+
"legacy-domain-seeded",
|
|
17
|
+
"bounded-startup",
|
|
18
|
+
"api-list",
|
|
19
|
+
"legacy-migration-carries-every-note",
|
|
20
|
+
"legacy-migration-writes-markdown",
|
|
21
|
+
"api-create",
|
|
22
|
+
"api-update",
|
|
23
|
+
"api-move",
|
|
24
|
+
"api-move-clamped",
|
|
25
|
+
"api-move-bounds",
|
|
26
|
+
"api-arrange",
|
|
27
|
+
"api-archive",
|
|
28
|
+
"api-archive-hides-note",
|
|
29
|
+
"api-counts-survive-filtering",
|
|
30
|
+
"storage-persistence-across-restart",
|
|
31
|
+
"storage-persistence-layout",
|
|
32
|
+
"api-delete",
|
|
33
|
+
"api-delete-verified",
|
|
34
|
+
"api-auth-fence",
|
|
35
|
+
"browser-shell-overlays-dismissed",
|
|
36
|
+
"browser-sidebar-entry-present",
|
|
37
|
+
"browser-sidebar-click-attempts",
|
|
38
|
+
"browser-sidebar-entry-selects-panel",
|
|
39
|
+
"browser-wall-page-mounted",
|
|
40
|
+
"browser-welcome-note-seeded",
|
|
41
|
+
"browser-zh-copy",
|
|
42
|
+
"browser-composer-opens",
|
|
43
|
+
"browser-composer-sheet-is-large",
|
|
44
|
+
"browser-composer-sheet-stays-centred",
|
|
45
|
+
"browser-composer-editor-fills-the-sheet",
|
|
46
|
+
"browser-composer-grip-works-from-the-keyboard",
|
|
47
|
+
"browser-composer-grip-resizes-the-sheet",
|
|
48
|
+
"browser-composer-double-click-resets-the-size",
|
|
49
|
+
"browser-composer-size-is-remembered",
|
|
50
|
+
"browser-composer-minimum-size-stays-usable",
|
|
51
|
+
"browser-composer-preview-fills-the-sheet",
|
|
52
|
+
"browser-preview-renders-nested-lists",
|
|
53
|
+
"browser-preview-toggle-keeps-the-editor-and-caret",
|
|
54
|
+
"browser-caret-survives-the-preview-round-trip",
|
|
55
|
+
"browser-composer-sheet-fits-a-small-window",
|
|
56
|
+
"browser-composer-keeps-the-preference-through-a-squeeze",
|
|
57
|
+
"browser-composer-save-creates-note",
|
|
58
|
+
"browser-pin-action-sorts-note-first",
|
|
59
|
+
"browser-search-filters-wall",
|
|
60
|
+
"browser-archive-hides-note",
|
|
61
|
+
"browser-centre-tally-reports-the-hidden-archive",
|
|
62
|
+
"browser-show-archived-toggle",
|
|
63
|
+
"browser-centre-tally-is-stable-when-the-archive-is-shown",
|
|
64
|
+
"browser-note-persists-across-ui-reload",
|
|
65
|
+
"browser-canvas-positions-cards-absolutely",
|
|
66
|
+
"browser-canvas-tidy-repacks-the-wall",
|
|
67
|
+
"browser-canvas-tidy-leaves-no-overlap",
|
|
68
|
+
"browser-canvas-camera-frames-the-wall-centre",
|
|
69
|
+
"browser-canvas-camera-is-a-transform-not-scroll",
|
|
70
|
+
"browser-canvas-drag-persists-placement",
|
|
71
|
+
"browser-canvas-drag-keeps-rotation",
|
|
72
|
+
"browser-canvas-drag-on-paper-pans-the-camera",
|
|
73
|
+
"browser-canvas-wheel-zoom-keeps-the-pointer-anchored",
|
|
74
|
+
"browser-canvas-reset-frames-the-whole-wall",
|
|
75
|
+
"browser-canvas-large-wall-is-a-centred-cluster",
|
|
76
|
+
"browser-canvas-centrepiece-is-at-the-middle",
|
|
77
|
+
"browser-canvas-tidy-keeps-the-centre-clear",
|
|
78
|
+
"browser-canvas-centrepiece-stays-put-while-panning",
|
|
79
|
+
"browser-canvas-centrepiece-keeps-its-size-while-zooming",
|
|
80
|
+
"browser-centre-capture-creates-a-note",
|
|
81
|
+
"browser-centre-capture-lands-visible-and-clear-of-the-field",
|
|
82
|
+
"browser-no-card-covers-the-centrepiece",
|
|
83
|
+
"browser-capture-on-a-panned-wall-stays-clear-of-the-field",
|
|
84
|
+
"browser-capture-on-a-zoomed-wall-stays-clear-of-the-field",
|
|
85
|
+
"browser-canvas-fills-the-page-with-a-floating-dock",
|
|
86
|
+
"browser-canvas-large-wall-screenshot",
|
|
87
|
+
"browser-card-body-renders-markdown",
|
|
88
|
+
"browser-card-body-renders-nested-lists",
|
|
89
|
+
"browser-grid-view-renders-notes",
|
|
90
|
+
"browser-list-view-renders-rows",
|
|
91
|
+
"browser-theme-switches-note-palette",
|
|
92
|
+
"browser-no-uncaught-errors"
|
|
93
|
+
],
|
|
94
|
+
"evidence": {
|
|
95
|
+
"isolatedMount": "docs/evidence/isolated-mount-0.9.4.json",
|
|
96
|
+
"uiVerification": "docs/evidence/ui-verification.json",
|
|
97
|
+
"tarballSha256": "9d10ac6d944e9e24c571c204193c93fdfa604059cd167d4294e8c03e4216200b"
|
|
98
|
+
},
|
|
99
|
+
"notes": "Verified for the 0.9.4 centre-tally release against DSH 0.2.2-rc.5. The mount run installs the packed tarball into an owned disposable profile, composes it, boots a bounded startup and exercises the Connection API; the UI run drives the real DSH Web app over CDP (58/58). Release-specific checks: (1) the list response reports whole-wall counts (total/live/archived) that survive the archived filter — the mount run observed total 3 / live 1 / archived 2 on a filtered request, and the real UI shows \"1 张便签 · 1 张已归档\" while zero archived cards are on screen, the exact state in which the previous build reported 0 archived; (2) tidy keeps every card clear of the capture field at framing zoom, which is asserted with pixel-level intrusion reporting (0px² across six consecutive UI runs) after the reserve was sized for the framing floor."
|
|
100
|
+
},
|
|
5
101
|
{
|
|
6
102
|
"dsh": "0.2.2-rc.5",
|
|
7
103
|
"verifiedAt": "2026-11-19",
|
package/lib/client.js
CHANGED
|
@@ -73,7 +73,7 @@ window.__ModuleLoader__.load({
|
|
|
73
73
|
md: 222,
|
|
74
74
|
lg: 276
|
|
75
75
|
});
|
|
76
|
-
var CENTRE_RESERVE = Object.freeze({ halfWidth:
|
|
76
|
+
var CENTRE_RESERVE = Object.freeze({ halfWidth: 605, halfHeight: 200 });
|
|
77
77
|
var LAYOUT_LIMITS = Object.freeze({
|
|
78
78
|
/** Absolute value of x and y, in world pixels. */
|
|
79
79
|
coord: 2e4,
|
|
@@ -95,6 +95,16 @@ window.__ModuleLoader__.load({
|
|
|
95
95
|
if (!result.ok) throw new ActionError(result.error.code, result.error.message, result.error.details);
|
|
96
96
|
return result.value;
|
|
97
97
|
}
|
|
98
|
+
function normalizeCounts(raw, notes) {
|
|
99
|
+
if (raw !== void 0 && raw !== null && typeof raw === "object") {
|
|
100
|
+
const total = typeof raw.total === "number" && Number.isFinite(raw.total) ? raw.total : notes.length;
|
|
101
|
+
const archived2 = typeof raw.archived === "number" && Number.isFinite(raw.archived) ? raw.archived : 0;
|
|
102
|
+
const live = typeof raw.live === "number" && Number.isFinite(raw.live) ? raw.live : Math.max(0, total - archived2);
|
|
103
|
+
return { total, live, archived: archived2 };
|
|
104
|
+
}
|
|
105
|
+
const archived = notes.filter((note) => note.archived).length;
|
|
106
|
+
return { total: notes.length, live: notes.length - archived, archived };
|
|
107
|
+
}
|
|
98
108
|
function createApi(connection, lifetime) {
|
|
99
109
|
const call = async (request, signal) => {
|
|
100
110
|
const signalToUse = signal === void 0 ? lifetime : AbortSignal.any([lifetime, signal]);
|
|
@@ -103,8 +113,10 @@ window.__ModuleLoader__.load({
|
|
|
103
113
|
return {
|
|
104
114
|
async list(includeArchived, sort, signal) {
|
|
105
115
|
const value = await call({ action: "list", includeArchived, sort }, signal);
|
|
116
|
+
const notes = Array.isArray(value?.notes) ? value.notes : [];
|
|
106
117
|
return {
|
|
107
|
-
notes
|
|
118
|
+
notes,
|
|
119
|
+
counts: normalizeCounts(value?.counts, notes),
|
|
108
120
|
revision: typeof value?.revision === "number" ? value.revision : 0,
|
|
109
121
|
notesDir: typeof value?.notesDir === "string" ? value.notesDir : "",
|
|
110
122
|
domain: value?.domain ?? { name: "", version: 0 }
|
|
@@ -164,6 +176,9 @@ window.__ModuleLoader__.load({
|
|
|
164
176
|
"title": "\u4FBF\u7B7E\u5899",
|
|
165
177
|
"empty": "\u8FD8\u6CA1\u6709\u4FBF\u7B7E\u3002\u70B9\u300C\u65B0\u5EFA\u300D\u5199\u4E0B\u7B2C\u4E00\u6761\u3002",
|
|
166
178
|
"emptyArchived": "\u5F52\u6863\u533A\u662F\u7A7A\u7684\u3002",
|
|
179
|
+
// Shown when the wall HAS notes but every one of them is archived. Saying
|
|
180
|
+
// "no notes yet" there was false and hid the way back to them.
|
|
181
|
+
"emptyAllArchived": "\u4FBF\u7B7E\u90FD\u6536\u8FDB\u5F52\u6863\u4E86\u3002\u7528\u4E0B\u65B9\u83DC\u5355\u91CC\u7684\u300C\u663E\u793A\u5F52\u6863\u300D\u67E5\u770B\u3002",
|
|
167
182
|
"new": "\u65B0\u5EFA",
|
|
168
183
|
"save": "\u4FDD\u5B58",
|
|
169
184
|
"cancel": "\u53D6\u6D88",
|
|
@@ -273,6 +288,9 @@ window.__ModuleLoader__.load({
|
|
|
273
288
|
"title": "Sticky wall",
|
|
274
289
|
"empty": 'No notes yet. Hit "New" to write the first one.',
|
|
275
290
|
"emptyArchived": "Nothing archived yet.",
|
|
291
|
+
// Shown when the wall HAS notes but every one of them is archived. Saying
|
|
292
|
+
// "no notes yet" there was false and hid the way back to them.
|
|
293
|
+
"emptyAllArchived": 'Every note is in the archive. Use "Show archived" in the menu below to see them.',
|
|
276
294
|
"new": "New",
|
|
277
295
|
"save": "Save",
|
|
278
296
|
"cancel": "Cancel",
|
|
@@ -870,7 +888,8 @@ window.__ModuleLoader__.load({
|
|
|
870
888
|
function previewLayout(note, index) {
|
|
871
889
|
const width = previewWidth(note.id);
|
|
872
890
|
const reserve = CENTRE_RESERVE;
|
|
873
|
-
const
|
|
891
|
+
const widest = Math.max(...Object.values(WIDTH_PX));
|
|
892
|
+
const startRadius = Math.hypot(reserve.halfWidth, reserve.halfHeight) + Math.hypot(widest, PREVIEW_NOMINAL_HEIGHT) / 2;
|
|
874
893
|
const radius = PREVIEW_STEP * Math.sqrt(Math.max(0, index) + (startRadius / PREVIEW_STEP) ** 2);
|
|
875
894
|
const theta = index * GOLDEN_ANGLE + (unit(`${note.id}:pa`) - 0.5) * 0.55;
|
|
876
895
|
return clampLayout({
|
|
@@ -3120,6 +3139,7 @@ window.__ModuleLoader__.load({
|
|
|
3120
3139
|
}
|
|
3121
3140
|
function WallPage({ api, locale, t }) {
|
|
3122
3141
|
const [notes, setNotes] = (0, import_react3.useState)([]);
|
|
3142
|
+
const [counts, setCounts] = (0, import_react3.useState)({ total: 0, live: 0, archived: 0 });
|
|
3123
3143
|
const [filter, setFilter] = (0, import_react3.useState)("all");
|
|
3124
3144
|
const [sort, setSort] = (0, import_react3.useState)("pinned");
|
|
3125
3145
|
const [view, setView] = (0, import_react3.useState)("canvas");
|
|
@@ -3199,6 +3219,7 @@ window.__ModuleLoader__.load({
|
|
|
3199
3219
|
const snapshot = await api.list(options.includeArchived, options.sort, life.current.signal);
|
|
3200
3220
|
if (alive.current && seq === sequence.current) {
|
|
3201
3221
|
setNotes((previous) => reconcileNotes(previous, snapshot.notes));
|
|
3222
|
+
setCounts(snapshot.counts);
|
|
3202
3223
|
if (snapshot.revision > 0) revision.current = snapshot.revision;
|
|
3203
3224
|
if (snapshot.notesDir !== "") setNotesDir(snapshot.notesDir);
|
|
3204
3225
|
if (options.clearError !== false) setError("");
|
|
@@ -3341,13 +3362,13 @@ window.__ModuleLoader__.load({
|
|
|
3341
3362
|
return `${note.title} ${note.body} ${note.tags.join(" ")}`.toLowerCase().includes(needle);
|
|
3342
3363
|
});
|
|
3343
3364
|
}, [notes, filter, query, showArchived]);
|
|
3344
|
-
const archivedCount =
|
|
3365
|
+
const archivedCount = counts.archived;
|
|
3345
3366
|
const greeting = (0, import_react3.useMemo)(() => {
|
|
3346
3367
|
const hour = (/* @__PURE__ */ new Date()).getHours();
|
|
3347
3368
|
const key = hour < 5 ? "greetNight" : hour < 12 ? "greetMorning" : hour < 18 ? "greetAfternoon" : "greetEvening";
|
|
3348
3369
|
return t(key);
|
|
3349
3370
|
}, [t, activeLocale]);
|
|
3350
|
-
const emptyCopy = filter === "archived" ? t("emptyArchived") : query.trim() !== "" ? t("noResults") : t("empty");
|
|
3371
|
+
const emptyCopy = filter === "archived" ? t("emptyArchived") : query.trim() !== "" ? t("noResults") : counts.total > 0 && counts.archived === counts.total ? t("emptyAllArchived") : t("empty");
|
|
3351
3372
|
const wallBounds = (0, import_react3.useMemo)(() => {
|
|
3352
3373
|
let minX = Number.POSITIVE_INFINITY;
|
|
3353
3374
|
let minY = Number.POSITIVE_INFINITY;
|
|
@@ -3871,7 +3892,7 @@ window.__ModuleLoader__.load({
|
|
|
3871
3892
|
)) }),
|
|
3872
3893
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "skw-centre", ref: centreRef, "aria-hidden": false, children: [
|
|
3873
3894
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "skw-centre-hello", children: greeting }),
|
|
3874
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "skw-centre-tally", "data-empty": visible.length === 0, children: visible.length === 0 ? emptyCopy : t("centreTally", { count:
|
|
3895
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "skw-centre-tally", "data-empty": visible.length === 0, children: visible.length === 0 ? emptyCopy : t("centreTally", { count: counts.live, archived: counts.archived }) }),
|
|
3875
3896
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
3876
3897
|
"form",
|
|
3877
3898
|
{
|
package/lib/index.js
CHANGED
|
@@ -368,6 +368,7 @@ export function apply(ctx, rawConfig = {}) {
|
|
|
368
368
|
const store = await ready;
|
|
369
369
|
return {
|
|
370
370
|
list: (includeArchived, sort) => store.list(includeArchived, sort),
|
|
371
|
+
counts: () => store.counts(),
|
|
371
372
|
revisionOf: () => store.revision,
|
|
372
373
|
notesDir: store.notesDir,
|
|
373
374
|
create: (input, id, options) => store.create(input, id, options),
|
package/lib/layout.js
CHANGED
|
@@ -292,11 +292,22 @@ export function previewLayout(note, index) {
|
|
|
292
292
|
// lands outside the rectangle at any reserve size.
|
|
293
293
|
const reserve = CENTRE_RESERVE;
|
|
294
294
|
// The reserve's half-diagonal is how far the RECTANGLE's corner is from the
|
|
295
|
-
// middle;
|
|
296
|
-
//
|
|
297
|
-
//
|
|
295
|
+
// middle; a card's half-diagonal is how far it reaches back inward from its
|
|
296
|
+
// centre. Adding both is what guarantees the derived box cannot clip a corner
|
|
297
|
+
// of the reserved band.
|
|
298
|
+
//
|
|
299
|
+
// The card half-diagonal is the WIDEST preset's, not this card's. Using the
|
|
300
|
+
// card's own width made the start radius — and therefore the whole spiral —
|
|
301
|
+
// depend on which preset the id happened to hash to, so a narrow card at index
|
|
302
|
+
// `i+1` could land INSIDE a wide card at index `i` and the radii stopped
|
|
303
|
+
// increasing with the index. The old reserve's numbers happened to keep that
|
|
304
|
+
// inversion invisible; sizing the reserve for the framing floor exposed it.
|
|
305
|
+
// Reserving for the widest preset costs a few pixels of paper and makes the
|
|
306
|
+
// radius a function of the index alone, which is what "the spiral grows
|
|
307
|
+
// outward" actually requires.
|
|
308
|
+
const widest = Math.max(...Object.values(WIDTH_PX));
|
|
298
309
|
const startRadius = Math.hypot(reserve.halfWidth, reserve.halfHeight) +
|
|
299
|
-
Math.hypot(
|
|
310
|
+
Math.hypot(widest, PREVIEW_NOMINAL_HEIGHT) / 2;
|
|
300
311
|
const radius = PREVIEW_STEP * Math.sqrt(Math.max(0, index) + (startRadius / PREVIEW_STEP) ** 2);
|
|
301
312
|
const theta = index * GOLDEN_ANGLE + (unit(`${note.id}:pa`) - 0.5) * 0.55;
|
|
302
313
|
return clampLayout({
|
package/lib/store.d.ts
CHANGED
|
@@ -172,6 +172,20 @@ export declare class StickyWallStore {
|
|
|
172
172
|
read(id: string): Note | null;
|
|
173
173
|
/** Every stored note, newest-relevant first; archived ones only on request. */
|
|
174
174
|
list(includeArchived?: boolean, sort?: 'pinned' | 'created' | 'updated'): Note[];
|
|
175
|
+
/**
|
|
176
|
+
* The wall's real composition: how many notes exist, live and archived.
|
|
177
|
+
*
|
|
178
|
+
* This is the ONLY honest source for those numbers. `list` returns a
|
|
179
|
+
* projection — the default call omits archived notes entirely — so a caller
|
|
180
|
+
* counting `archived` out of a `list` result is counting its own filter and
|
|
181
|
+
* will read zero on a wall that has an archive. Every note in the map is
|
|
182
|
+
* counted here, archived or not.
|
|
183
|
+
*/
|
|
184
|
+
counts(): {
|
|
185
|
+
total: number;
|
|
186
|
+
live: number;
|
|
187
|
+
archived: number;
|
|
188
|
+
};
|
|
175
189
|
/**
|
|
176
190
|
* The snapshot the store's own mutations work from.
|
|
177
191
|
*
|
package/lib/store.js
CHANGED
|
@@ -415,6 +415,24 @@ export class StickyWallStore {
|
|
|
415
415
|
this.assertOpen();
|
|
416
416
|
return this.gathered(includeArchived, sort);
|
|
417
417
|
}
|
|
418
|
+
/**
|
|
419
|
+
* The wall's real composition: how many notes exist, live and archived.
|
|
420
|
+
*
|
|
421
|
+
* This is the ONLY honest source for those numbers. `list` returns a
|
|
422
|
+
* projection — the default call omits archived notes entirely — so a caller
|
|
423
|
+
* counting `archived` out of a `list` result is counting its own filter and
|
|
424
|
+
* will read zero on a wall that has an archive. Every note in the map is
|
|
425
|
+
* counted here, archived or not.
|
|
426
|
+
*/
|
|
427
|
+
counts() {
|
|
428
|
+
this.assertOpen();
|
|
429
|
+
let archived = 0;
|
|
430
|
+
for (const note of this.notes.values())
|
|
431
|
+
if (note.archived)
|
|
432
|
+
archived += 1;
|
|
433
|
+
const total = this.notes.size;
|
|
434
|
+
return { total, live: total - archived, archived };
|
|
435
|
+
}
|
|
418
436
|
/**
|
|
419
437
|
* The snapshot the store's own mutations work from.
|
|
420
438
|
*
|
package/lib/transport.d.ts
CHANGED
|
@@ -30,6 +30,18 @@ export interface HostConnection {
|
|
|
30
30
|
/** The store operations the route dispatches onto. */
|
|
31
31
|
export interface WallActions {
|
|
32
32
|
list(includeArchived?: boolean, sort?: NoteSort): Note[];
|
|
33
|
+
/**
|
|
34
|
+
* The wall's real composition, counted over every stored note.
|
|
35
|
+
*
|
|
36
|
+
* Separate from {@link WallActions.list} on purpose: `list` returns only what
|
|
37
|
+
* the caller asked for, so a count derived from it describes the request
|
|
38
|
+
* rather than the wall.
|
|
39
|
+
*/
|
|
40
|
+
counts(): {
|
|
41
|
+
total: number;
|
|
42
|
+
live: number;
|
|
43
|
+
archived: number;
|
|
44
|
+
};
|
|
33
45
|
/** The Host's current change counter, for the Client's cheap poll. */
|
|
34
46
|
revisionOf(): number;
|
|
35
47
|
/** Absolute directory the notes live in. */
|
package/lib/transport.js
CHANGED
|
@@ -131,6 +131,10 @@ async function dispatch(actions, request) {
|
|
|
131
131
|
case 'list':
|
|
132
132
|
return {
|
|
133
133
|
notes: actions.list(request.includeArchived, request.sort),
|
|
134
|
+
// Counted by the Host over EVERY note, never derived from the filtered
|
|
135
|
+
// array above: the default request omits archived notes, so a count
|
|
136
|
+
// taken from `notes` would always report zero archived.
|
|
137
|
+
counts: actions.counts(),
|
|
134
138
|
revision: actions.revisionOf(),
|
|
135
139
|
notesDir: actions.notesDir,
|
|
136
140
|
domain: { name: 'sticky-wall', version: 2 },
|
package/lib/types.d.ts
CHANGED
|
@@ -89,15 +89,31 @@ export declare const WIDTH_PX: Readonly<Record<NoteWidth, number>>;
|
|
|
89
89
|
* wasted a tall column of paper above and below the field while still letting a
|
|
90
90
|
* wide card reach in from the side.
|
|
91
91
|
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
92
|
+
* **These numbers are derived from the framing floor, not from zoom 1.** The
|
|
93
|
+
* centrepiece is a screen-space HUD: it keeps its painted size (a measured
|
|
94
|
+
* 560x167 block, so half-extents 280x84) at every camera zoom, which means the
|
|
95
|
+
* patch of WORLD it covers is `painted / zoom` and grows as the wall zooms out.
|
|
96
|
+
* A reserve sized for zoom 1 was therefore too small for every framed wall: at
|
|
97
|
+
* 75% the painted field alone needs 339 world px per side against a 330 reserve,
|
|
98
|
+
* so a tidied card grazed the field's edge — measured in the real UI as 1-2
|
|
99
|
+
* cards clipping the field by ~9x17px. That is why this is 605x200 and not
|
|
100
|
+
* 330x136.
|
|
101
|
+
*
|
|
102
|
+
* The value is the smallest one that still contains the HUD at the camera's
|
|
103
|
+
* framing floor (0.42, the lowest zoom `fitWall` will ever frame a wall at):
|
|
104
|
+
* `280 / 0.42 ≈ 667` is the strict bound, and 605 is the measured point at which
|
|
105
|
+
* a 100-card wall still frames with a hole of 508x168 screen px — exactly the
|
|
106
|
+
* painted field. Enlarging it further only buys empty paper in the middle and
|
|
107
|
+
* costs framing zoom (667 frames a 14-card wall at 56% instead of 60%), so the
|
|
108
|
+
* reserve is deliberately the tight bound rather than a comfortable one.
|
|
109
|
+
*
|
|
110
|
+
* The number cannot be derived per-wall from the live zoom without creating the
|
|
111
|
+
* feedback loop documented on `WallPage.centreReserve`, so it is a constant and
|
|
112
|
+
* the cost is accepted: a wall frames slightly lower than it otherwise would.
|
|
97
113
|
*/
|
|
98
114
|
export declare const CENTRE_RESERVE: Readonly<{
|
|
99
|
-
halfWidth:
|
|
100
|
-
halfHeight:
|
|
115
|
+
halfWidth: 605;
|
|
116
|
+
halfHeight: 200;
|
|
101
117
|
}>;
|
|
102
118
|
/**
|
|
103
119
|
* A clear rectangle around the wall's centrepiece, in WORLD pixels.
|
|
@@ -202,9 +218,33 @@ export interface Note {
|
|
|
202
218
|
*/
|
|
203
219
|
extra?: Readonly<Record<string, string>> | undefined;
|
|
204
220
|
}
|
|
221
|
+
/**
|
|
222
|
+
* How many notes the wall holds, independent of what the Client asked for.
|
|
223
|
+
*
|
|
224
|
+
* This exists because the Client cannot derive it. `list` only returns what the
|
|
225
|
+
* caller requested, and the default request excludes archived notes — so
|
|
226
|
+
* counting archived notes out of the returned array always yields zero on a
|
|
227
|
+
* normal wall. The Host is the only side that knows the real composition, so it
|
|
228
|
+
* states it explicitly instead of letting every caller guess.
|
|
229
|
+
*/
|
|
230
|
+
export interface WallCounts {
|
|
231
|
+
/** Every stored note, archived ones included. */
|
|
232
|
+
total: number;
|
|
233
|
+
/** Notes that are not archived; the documented `maxNotes` cap applies here. */
|
|
234
|
+
live: number;
|
|
235
|
+
/** Notes the user archived, whether or not they are in `notes`. */
|
|
236
|
+
archived: number;
|
|
237
|
+
}
|
|
205
238
|
/** The complete wall state a Client renders. */
|
|
206
239
|
export interface WallSnapshot {
|
|
207
240
|
notes: Note[];
|
|
241
|
+
/**
|
|
242
|
+
* The wall's real composition, counted by the Host over EVERY stored note.
|
|
243
|
+
*
|
|
244
|
+
* Deliberately not derived from `notes`: that array is a filtered projection,
|
|
245
|
+
* so a count taken from it describes the request, not the wall.
|
|
246
|
+
*/
|
|
247
|
+
counts: WallCounts;
|
|
208
248
|
/**
|
|
209
249
|
* Monotonic change counter.
|
|
210
250
|
*
|
package/lib/types.js
CHANGED
|
@@ -97,13 +97,29 @@ export const WIDTH_PX = Object.freeze({
|
|
|
97
97
|
* wasted a tall column of paper above and below the field while still letting a
|
|
98
98
|
* wide card reach in from the side.
|
|
99
99
|
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
100
|
+
* **These numbers are derived from the framing floor, not from zoom 1.** The
|
|
101
|
+
* centrepiece is a screen-space HUD: it keeps its painted size (a measured
|
|
102
|
+
* 560x167 block, so half-extents 280x84) at every camera zoom, which means the
|
|
103
|
+
* patch of WORLD it covers is `painted / zoom` and grows as the wall zooms out.
|
|
104
|
+
* A reserve sized for zoom 1 was therefore too small for every framed wall: at
|
|
105
|
+
* 75% the painted field alone needs 339 world px per side against a 330 reserve,
|
|
106
|
+
* so a tidied card grazed the field's edge — measured in the real UI as 1-2
|
|
107
|
+
* cards clipping the field by ~9x17px. That is why this is 605x200 and not
|
|
108
|
+
* 330x136.
|
|
109
|
+
*
|
|
110
|
+
* The value is the smallest one that still contains the HUD at the camera's
|
|
111
|
+
* framing floor (0.42, the lowest zoom `fitWall` will ever frame a wall at):
|
|
112
|
+
* `280 / 0.42 ≈ 667` is the strict bound, and 605 is the measured point at which
|
|
113
|
+
* a 100-card wall still frames with a hole of 508x168 screen px — exactly the
|
|
114
|
+
* painted field. Enlarging it further only buys empty paper in the middle and
|
|
115
|
+
* costs framing zoom (667 frames a 14-card wall at 56% instead of 60%), so the
|
|
116
|
+
* reserve is deliberately the tight bound rather than a comfortable one.
|
|
117
|
+
*
|
|
118
|
+
* The number cannot be derived per-wall from the live zoom without creating the
|
|
119
|
+
* feedback loop documented on `WallPage.centreReserve`, so it is a constant and
|
|
120
|
+
* the cost is accepted: a wall frames slightly lower than it otherwise would.
|
|
105
121
|
*/
|
|
106
|
-
export const CENTRE_RESERVE = Object.freeze({ halfWidth:
|
|
122
|
+
export const CENTRE_RESERVE = Object.freeze({ halfWidth: 605, halfHeight: 200 });
|
|
107
123
|
/** Bounds of the free canvas: a note may sit anywhere inside this square. */
|
|
108
124
|
export const LAYOUT_LIMITS = Object.freeze({
|
|
109
125
|
/** Absolute value of x and y, in world pixels. */
|