4.5 KiB
SLICE 1 — Groundwork: process rules + body-fetch optimization
State-saving rule: update this file immediately after EVERY completed task (tick the checkbox, update Status and Resume notes) and whenever pausing for input — automatically, without being asked. State on disk must always match reality.
Status
COMPLETE (2026-07-15). All six tasks done; 97/97 tests pass. Ready to proceed to SLICE2.
Decision recorded 2026-07-15: body-fetch optimization (Task 4) is scoped
plumbing-only, behaviour-preserving — add the fields-hint adapter param and
drop body only where extractGtdBlock is provably never called (both-none
paths). No change to card styling/title for todos: all. This lands the adapter
plumbing SLICE3's scope: all needs without altering render output.
Pending user input (non-blocking, defaults recorded in SLICE4):
- gtd-gantt fence disambiguation:
project:key present = item block, absent = chart block (chart filters viafilter-project:). - Dateless gantt items: excluded with a warning (no Unscheduled strip).
Goal
Set up the working rules for the whole effort and land the performance
optimization that scope: all (SLICE3) depends on.
Tasks
- Verify
.git/info/excludecovers local guidance, planning files, and`n other workspace-only metadata. Confirmed 2026-07-15; no change needed. - Establish the .jpl archive rule:
scripts/archive-jpl.shmoves existingpublish/*.jpltobuild-archive/<name>-<version>-<yyyymmdd-HHMMSS>.jpl. Wired as thepredistnpm script so it runs automatically before everynpm run dist. Validated 2026-07-15 (archives + no-op-on-empty both work). CORRECTION (2026-07-15, during first realnpm run dist): the archive was originally written topublish/archive/, but webpack'sbuildMainstep runsfs.removeSync(publishDir)(wipes it) andpackage.json"files": ["publish"]would ship it to npm. Moved to repo-rootbuild-archive/(git-ignored, outside publish/). local guidance + .gitignore updated. Re-validated with a fullnpm run dist: archive survives, fresh jpl written to publish/. - Fix
jest.config.jsESM/CJS mismatch (export default→module.exports). Done 2026-07-15:npx jestruns, all 88 tests pass (8 suites). - Body-fetch optimization (plumbing-only, behaviour-preserving). Done 2026-07-15:
-
DataAdapter.getNotesInFoldergains anincludeBody: booleanfetch hint;RawNote.bodyis now optional. Real adapter (index.ts) requestsNOTE_FIELDS_WITH_BODYvsNOTE_FIELDSaccordingly. - Each collector computesneedsBodybefore the fetch: events =notes !== "none" || todos !== "none"; kanban/matrix =todos !== "none". These are exactly the paths whereextractGtdBlockis reached, so render output is identical — body is only dropped for degenerate empty views. -extractGtdBlockparam widened tostring | undefined(already guarded bybody || ""). Investigation confirmed the slice's stated "todos: all" win is NOT behaviour-preserving (block is read for card styling even inallmode), so it was deliberately excluded per the recorded decision. The value here is the adapter plumbing that SLICE3'sscope: allneeds. - Unit tests for the fields-hint logic. Done 2026-07-15:
src/tests/Gtd/fieldsHint.test.ts— a recording adapter asserts each collector passes the correctincludeBodyflag per mode (9 cases). - Run full test suite; record results here. 2026-07-15: 97 passed, 97 total (9 suites) — 88 pre-existing + 9 new fields-hint cases.
Decisions / notes
- Node on this machine: 18.19.1 (WSL Ubuntu). Jest 30.
- Run all commands via
wsl -d Ubuntu -- bash -c "cd ~/projects/joplin-plugin-gtd-calendar && ...".
Resume notes
SLICE1 is complete. Files touched:
jest.config.js(export default→module.exports)scripts/archive-jpl.sh(new) +predistnpm script inpackage.jsonsrc/Gtd/types.ts(RawNote.bodyoptional;getNotesInFoldergainsincludeBody)src/index.ts(NOTE_FIELDS/NOTE_FIELDS_WITH_BODY, conditional fetch)src/Gtd/collectEvents.ts,collectKanban.ts,collectMatrix.ts(needsBody)src/Gtd/gtdBlock.ts(paramstring | undefined)src/tests/Gtd/fieldsHint.test.ts(new)
Nothing left open. npx tsc --noEmit shows only pre-existing api/ typing
errors (generated Joplin typings referencing absent modules); no new errors in
src/. Next: SLICE2.