Something went wrong. Try again.
notes and lists
Something went wrong. Try again.
Pockist — Agent Quick Context #
Pockist is a local-first progressive web app (PWA) for todos and notes.
- Live URL: https://pockist.com
- Stack: Vanilla JS (frontend) + Go 1.25 + SQLite (backend)
- Deployment: Docker on an Ubuntu VPS
- Philosophy: Minimal dependencies. Vanilla everything. No build step for JS.
What It Does #
- Local-first todo lists and notes (all data stays on the user's device)
- No accounts, no tracking
- Temporary anonymous share links (backed by server-side SQLite)
- Weather widget + geocoding
- Archive / restore / search / drag-and-drop reordering
- Import / export JSON backups
Architecture #
| Layer | What It Is |
|---|---|
| Frontend | Single-page vanilla JS app. Web Components via custom elements. Custom event bus + event delegation. |
| Data Store | Browser IndexedDB with a single items object store. Notes, lists, and todos are all item records with a type field. |
| Backend | Go net/http mux. Serves static files and a handful of API endpoints. |
| Database | SQLite for share links only. Frontend data never touches the server. |
| Caching | Service Worker (sw.js) + in-memory Go cache (pkg/cache) for API responses. |
Directory Structure #
├── main.go # Go server entrypoint (routes, middleware, startup)
├── handlers/ # Go HTTP handlers
│ ├── ShareHandler.go # Create / read / delete share links (live)
│ ├── AccountHandlers.go # Auth handlers (dead code — not wired in main.go)
│ ├── weather_handler.go # Weather API proxy + caching
│ ├── geocode_handler.go # Geocode API proxy + caching
│ └── Database.go # SQLite init
├── pkg/cache/ # In-memory TTL cache for Go handlers
├── token/ # JWT creation / validation (used by dead auth code)
├── public/ # Static frontend assets
│ ├── index.html # Single HTML shell
│ ├── app.js # Boot: DB init → migrations → router → service worker
│ ├── sw.js # Service worker (caches static assets + API GETs)
│ ├── app.webmanifest # PWA manifest
│ ├── components/ # Custom element components
│ │ ├── ListBase.js # Shared list CRUD logic
│ │ ├── NoteBase.js # Shared note CRUD logic
│ │ ├── *Page.js # Route-level page components
│ │ └── weather/ # Weather sub-components
│ ├── services/ # Business-logic modules
│ │ ├── DBManager.js # IndexedDB wrapper, migrations, CRUD
│ │ ├── Router.js # Client-side router (event delegation)
│ │ ├── API.js # Fetch wrapper for backend APIs
│ │ ├── ShareService.js # Share link helpers
│ │ ├── ImportExportService.js
│ │ ├── DialogService.js
│ │ ├── DraggableList.js
│ │ └── WeatherService.js
│ └── styles/ # CSS files (one per feature area)
├── docs/ # Deep-dive documentation (see below)
├── Dockerfile # Multi-stage build (Go + alpine)
├── docker-compose.yml # Compose with persistent volume
└── .air.toml # Air live-reload config (Go only)
Key Files to Know #
| File | Why It Matters |
|---|---|
public/services/DBManager.js |
The heart of the app. IndexedDB schema, migrations, and all CRUD. |
public/app.js |
Boot sequence. Initializes DB, runs migrations, starts router, registers SW. |
public/services/Router.js |
Client-side routing. Uses document-level click delegation to intercept <a> tags. |
public/components/ListBase.js |
Shared list logic: add, reorder, complete, archive, drag-drop, clear. |
public/components/NoteBase.js |
Shared note logic: load, sort, actions. |
main.go |
Go server. Serves static files, API routes, and catch-all fallback to index.html. |
handlers/ShareHandler.go |
Only live backend feature: temporary share links with rate limiting. |
handlers/AccountHandlers.go |
Dead code. Auth is not wired up. Do not treat as active. |
token/*.go |
JWT creation / validation — contains log.Fatalf crashes (only used by dead auth code). |
Current State #
Check docs/TODO.md for the canonical task list.
At a glance (as of 2026-07-14):
- Active bugs (max 3):
_clearCompletedsaves list before archiving children — orphaned items on partial failureshowError()alert-modal missing fromindex.html— errors fall back toalert()- Add coordinate validation to weather_handler.go (invalid lat/lon cached 20min)
- Major planned refactor: v11 schema migration (move from
list.items[]child refs toparentId+ compound index in IndexedDB). On hold until active bugs are cleared. - Auth system: Entirely dead code. Consolidated to backlog pending a decision to either wire it up or delete it.
- Recently shipped (v0.1.29): Parent list tracking for archive/restore, API.fetch error handling fix.
- Recently fixed (2026-07-14):
- Object URL revoke race — all downloads defer
URL.revokeObjectURL()by 3 seconds. - Router blob URL interception —
blob:clicks fromImportExportServicewere being hijacked by the router and killed. Addedblob:to Router exclusion list.
- Object URL revoke race — all downloads defer
Critical Context #
Database Version #
- Current:
10 - Next (planned):
11— parentId + compound index to kill N+1 queries and retirelist.items[] - Status: v11 is on hold until Active bug backlog is cleared.
LocalStorage Migration Flags #
| Flag | Migration |
|---|---|
migrationComplete |
textAreaDB → pockist-db |
multiNoteMigrationComplete |
Number IDs → string IDs |
todoDBMigrationComplete |
TodoDB → lists |
itemsMigrationComplete |
notes + lists → unified items (v9) |
itemsArrayMigrationComplete |
links[] → items[] (v10) |
Active Risks #
- N+1 reads —
DBManager.getListItems()fetches children one-by-one. v11 migration is the fix. - Unbounded SW cache —
sw.jscaches every API GET (weather, geocode, shares) with no eviction. - Auth decision pending — All auth work moved to backlog. Need decision: wire up or delete.
List reordering index mismatch— Fixed 2026-07-08._archiveItemnow removes child refs fromlistItem.itemsbefore archiving._loadCurrentListprunes legacy orphaned refs on load._clearCompletedorphan risk — Active bug #1.saveItemcalled beforearchiveItemloop.
Session Notes #
2026-07-08 — Legacy Code Cleanup (Quick Win) #
- Removed 4 dead methods from
DBManager.jswith zero callers anywhere in the codebase:getNote(id)— unreferenced externallygetLists()— unreferenced externallydeleteList(listId)— unreferenced externally#itemToLegacyNote(item)— only called bygetNote
- Migration chain remains intact. All 5 migration methods and their private helpers preserved.
- Adapter methods still referenced by
ImportExportService.js(saveNote,saveList,getList,createList,#itemToLegacyList) kept in place. - Net reduction: ~50 lines. Zero risk.
2026-06-30 — PM Handover #
- Took over as PM from code-author mode.
TODO.mdread and understood.AGENT_NOTES.mdcreated.- Active bugs prioritized: SearchPopover entity corruption, WeatherPage listener leak, and one critical server bug next.
- v11 schema migration confirmed as post-bug-fix roadmap item.
2026-06-30 — SearchPopover Fix Applied #
- Fixed
#highlightTextinSearchPopover.jsto tokenize escaped text into HTML entities and plain-text runs before applying the highlight regex. - Prevents queries like
ampfrom breaking&entities. - Entities are matched by regex
&(?:#\d+|#x[0-9a-fA-F]+|[a-zA-Z][a-zA-Z0-9]*);and skipped during highlighting.
2026-06-30 — Router Event Delegation + Listener Leak Fix #
- Replaced per-page
a.pwaclick interceptors inWeatherPage.js,AboutPage.js,ListPage.js, andHomePage.jswith a singledocument-level event delegation handler inRouter.js. Router.init()now usesdocument.addEventListener("click", ...)withevent.target.closest("a")to catch all clicks on<a>tags — static and dynamically added.- Filters external links (
http://,tel:,mailto:,#) to avoid intercepting non-app navigation. - Removed dead
Routerimports from pages that no longer reference it directly. - Also resolves TODO item: "Router not intercepting dynamically added
<a>tags after init".
2026-06-30 — PM Queue Maintenance #
- Read
TODO.mdandAGENT_NOTES.md. Confirmed docs folder has 6 files. - Moved completed SearchPopover and Router fixes from Active → Recently Completed (they were already there, but still checked in Active).
- Refilled Active queue to max 3:
token/log.FatalfDoS vector (remains)ListBase._handleAddrollback bug (pulled from Next Up)API.jsAuthorization: nullheader (pulled from Next Up)
- Next Up now has 1 item: weather coordinate validation.
- v11 schema migration remains on hold until Active bug backlog is cleared.
2026-06-30 — Auth Consolidated to Backlog #
- User directed: move all auth stuff to backlog.
- Removed auth items from Active:
token/log.Fatalf,API.jsAuthorization: null. - Moved auth bugs from Backlog - Bugs:
AccountHandler.Registername drop,AccountHandler.Authenticateempty name. - Moved auth security: JWT in localStorage.
- Consolidated all under Backlog - Auth Project (On Hold).
- Active queue refilled with non-auth bugs:
ListBase._handleAddrollbackAPI.fetchswallowing errorsImportExportServiceobject URL revoke race
- Next Up:
showError()missing,_clearCompletedorphan risk, weather coordinate validation.
2026-06-30 — ListBase._handleAdd Rollback Fix Verified #
- User fixed
ListBase._handleAddcatch block:listItem.items.pop()→listItem.items.shift(). - Symmetry restored:
unshiftto index 0 on add,shiftfrom index 0 on rollback. - Prevents silent corruption where save failure would drop the wrong (last) item instead of the newly added (first) item.
- File:
public/components/ListBase.js, line 218. - Moved to Recently Completed; pulled
Fix showError() alert-modal missingfrom Next Up into Active.
2026-06-30 — PM Task 1: API.fetch Error Swallowing (In Progress) #
- Confirmed root cause:
response.json()called unconditionally; 404/500 HTML bodies cause SyntaxError → caught → returnsundefined. - Plan provided to user: check
response.ok, parse error body, re-throw afterapp.showError(). - Bonus decision: fix
Authorization: nullheader while editingAPI.js. - Blast-radius mitigation: keep
try/catchinAPI.jsand re-throw, soapp.jsdoesn't need immediate changes. - Status: Awaiting user implementation and verification.
2026-07-08 — List Reordering Fix Applied (Revised: Option A) #
- Initial attempt (Option B): Removed child refs from
listItem.itemsin_archiveItem, added legacy cleanup in_loadCurrentList. - Problem discovered: ArchivePage restore logic expects the ref to still exist in the parent list. Removing it broke restore — archived items became orphans with no way to know which list they belonged to.
- Reverted to Option A:
_archiveItem: reverted to old behavior — just callsDBManager.archiveItem(itemId), ref stays inlistItem.items. Restore behavior preserved.- Added
_pruneArchivedRefs(listItem)helper that strips dead refs fromlistItem.itemsby checkingthis._linkedItemsformeta.archived. Re-sequences remaining refs. - Called
_pruneArchivedRefs()at the start of every reorder entry point:_moveItem,_reorderItem,_moveItemToTop,_moveItemToBottom,_sortItems,_clearCompleted. - Kept
_loadCurrentListlegacy cleanup from Option B — it prunes orphaned refs on page load anyway, so dead refs are cleaned up even if no reorder happens.
- Problem discovered (second round):
_archiveItemrefreshedthis._linkedItemsbut notthis._currentListItem, so the stalelistItem.itemsstill contained the dead ref. Any operation immediately after archive (add, duplicate, action menu) read the stale array and computed wrong indices / disabled wrong buttons. - Fix: Added
_pruneArchivedRefs(listItem)to 4 more entry points:_archiveItem(after refresh),_showItemActions,_handleAdd,_doDuplicateItem. Now_currentListItemis clean immediately after archive, no refresh needed. - Problem discovered (third round): After archive, stale
_currentListItemwas cleaned in-memory by_pruneArchivedRefs, but navigating to the list page would trigger_loadCurrentListwhich saves the pruned array to IndexedDB. The DB permanently lost the archived ref. Restoring from ArchivePage had nowhere to put the item back — it became an orphan. - Root cause of root cause: We wanted to keep refs in the list for restore (Option A), but our own pruning logic was saving those pruned arrays back to the DB. The ref was lost before restore could use it.
- Fix (Path 2 — parent tracking):
DBManager.archiveItem(id, parentListId?)— added optionalparentListIdparameter. Setsitem.meta.parentListIdbefore archiving. Single DB write.ListBase._archiveItem— passeslistItem.idasparentListId.ListBase._clearCompleted— passeslistItem.idfor each archived item.ArchivePage.jsrestore handler — readsitem.meta.parentListId, loads the parent list, re-adds the item ref (appended at end withorder = items.length), saves the list, then unarchives the item.
- Edge cases handled:
- Parent list deleted/archived →
getItemreturns null → skip re-adding, item restored as standalone orphan. - Ref already exists in parent list (shouldn't happen, defensive) → skip duplicate.
- Notes archived without a parent list →
parentListIdis undefined → skip re-adding, note restored as standalone.
- Parent list deleted/archived →
- Result: restore works correctly even if the list's
items[]ref was pruned from the DB by later mutations. Items know where they came from. - Moved list reordering bug from Active → Recently Completed.
- Pulled
_clearCompletedorphan risk into Active (slot 1 of 3). - Active queue now:
- Fix _clearCompleted saving list before archiving items (orphaned items on failure)
- Fix showError() alert-modal missing
- Fix ImportExportService revoking object URL before download starts
2026-07-01 — API.fetch Fix Completed + List Reordering Bug Investigated #
- User completed
API.fetcherror swallowing fix. Moved to Recently Completed. - Active queue refilled to max 3:
- List reordering index mismatch (investigated and detailed below)
showError()alert-modal missing (pulled from Next Up)ImportExportServiceobject URL revoke race (remains)
- List reordering root cause identified:
DBManager.archiveItem()does not remove the child's ref fromlistItem.items[]. DOM renders only non-archived items (_getLinkedItems()filters them).DraggableListindices are DOM-based.ListBase._reorderItemapplies DOM indices directly tolistItem.items, which still contains archived refs. This causes the wrong item to move._moveItemalso swaps with invisible archived refs, appearing to do nothing.ListWidgetpagination compounds the mismatch because#offsetis computed on the filtered array but applied to the unfiltereditems[]. - Suggested fix: In
_reorderItem, resolve item IDs from_getLinkedItems()before splicinglistItem.items. In_moveItem, skip archived refs when finding swap targets. Optionally prune dead archived refs on list load. - Next Up now has:
_clearCompletedorphan risk, weather coordinate validation, ShareView 3-arg confirm.
2026-07-12 — PM Mode Handover + Active Bug Verification #
- Role change: Switched from code-author to project manager mode per user direction.
- Active bug verification (all 3 still present):
_clearCompletedorphan risk:ListBase.js:371still callsDBManager.saveItem(listItem)(removing refs) BEFORE thearchiveItemloop. If archive fails partway, items become orphaned.showError()alert-modal missing:index.htmlhas no<dialog id="alert-modal">element.app.js:215always falls back toalert()+console.error. The modal shell exists in some pages but not the mainindex.htmlshell.ImportExportServiceobject URL revoke race:#downloadJSONat line 1354 callsURL.revokeObjectURL(url)immediately aftera.click(). Mobile browsers may not start the download before the URL is revoked.
- Recent commits reviewed:
b55282eimplemented parent list tracking (Path 2) —archiveItem()now storesmeta.parentListId, andArchivePage.jsrestore re-adds items to parent lists.8945073bumped version to 0.1.29 and updated changelog. - Codebase scan: No new critical issues. Minor notes:
console.log/console.errorstatements throughout frontend (tech debt, not urgent)log.Fatalfintoken/andmain.goremain (already in Auth backlog)public/sw.jsunbounded cache still unaddressed (backlog)
- v11 schema migration: Still on hold. Parent list tracking is a transitional v10 fix that will be superseded by
item.parentIdin v11.
2026-07-14 — Object URL Revoke Race Fix Applied #
- User report: Markdown download stopped working after v0.1.29 release.
- Root cause identified: Object URL revoke race —
URL.revokeObjectURL(url)was called immediately aftera.click()in all download paths. Mobile/slower browsers failed to start the download before the blob URL was destroyed. - Fix applied (Option A): Replaced immediate
URL.revokeObjectURL(url)withsetTimeout(() => URL.revokeObjectURL(url), 3000)in 4 locations:ImportExportService.exportMarkdown()— local note/list markdown exportImportExportService.exportMarkdownFromData()— shared note/list markdown exportImportExportService.#downloadJSON()— full backup & item JSON exportShareView.#downloadJSON()— share page direct JSON download
- Active queue updated: Moved object URL race from Active #3 → Recently Completed. Pulled weather coordinate validation from Next Up into Active #3.
- Files changed:
public/services/ImportExportService.js(3 edits),public/components/ShareView.js(1 edit).
Important Conventions #
- Minimal dependencies. The project is intentionally vanilla. Do not introduce frameworks, bundlers, or heavy libraries without explicit user approval.
- Data flow: Load → mutate via
DBManager→ reload → re-render. Components do not hold long-lived state caches. - Events: Use custom events (
bubbles: true) + event delegation. Calle.stopPropagation()on native clicks to prevent double handling. - Max 3 active items in
TODO.md. When one is done, pull the next highest-priority item from Next Up or Backlog. - Document everything:
- Bug fixes → add a note to
docs/audit-2026-06-29.mdunder Fixes Applied. - Schema / architecture changes → update the relevant deep-dive doc.
- Decisions → append to this file under Session Notes.
- Bug fixes → add a note to
Deeper Documentation #
All detailed docs live in docs/:
docs/TODO.md— canonical task list and roadmapdocs/db-and-components.md— database schema and component deep-divesdocs/migrations-and-compat.md— migration history and backwards compatibility rulesdocs/dialog-service.md— DialogService API and patternsdocs/draggable-list.md— Drag-and-drop implementation detailsdocs/deploy_notes.md— deployment instructionsdocs/audit-2026-06-29.md— security / code audit findings
Running Locally #
# Go backend only (no JS build step)
go run main.go
# → http://localhost:4242
# Or with Docker
docker compose up --build
The frontend is served as static files from public/. Any changes to JS/CSS/HTML are reflected immediately on refresh. Go changes require a rebuild (or use air if installed).
2026-07-14 — Router Blob URL Fix + PWA Class Review TODO #
- User report: Markdown download still not working after object URL revoke defer fix.
- Root cause (second round): Router event delegation (2026-06-30) intercepts all
<a>clicks globally. Programmatica.click()fromImportExportServicecreates an<a>withhref="blob:...". The Router's filter only excludedhttp,tel,mailto,#—blob:passed through →event.preventDefault()→Router.go('blob:...')→ "Page not found 😦" → download silently killed. - Fix: Added
href.startsWith("blob:")to Router exclusion list (Router.js:15). Single line. Zero HTML changes. Also preventsdata:URL issues in future. - TODO added: "Review PWA class usage" — the old per-page
a.pwaclick interceptors were removed in 2026-06-30. Thepwaclass may be dead or may be worth standardizing. Needs audit. - Files changed:
public/services/Router.js,docs/todo.md,docs/context.md.
2026-07-14 — PM Handover + Active Bug Verification (Session 2) #
- Role confirmed: Project Manager mode. User directed: stop writing code, manage
docs/todo.md, find bugs/warnings, document changes. _clearCompletedorphan risk VERIFIED FIXED:ListBase.js:371-374now callsarchiveItemloop BEFOREsaveItem. If any archive fails, catch block fires,saveItemnever runs, list retains original refs. Moved to Recently Completed.- Active bug verification (remaining 2):
showError()alert-modal missing:index.htmlhas no<dialog id="alert-modal">element anywhere.app.js:215always falls back toalert()+console.error. Status: Unchanged. Needs HTML template addition.- Weather coordinate validation:
weather_handler.go:79-88parseslat/lonas floats but does not validate ranges (-90to90,-180to180). Invalid values likelat=999are forwarded to Open-Meteo and the error response is cached for 20 minutes. Status: Unchanged. Needs validation.
- Next Up verification (all 3 still present):
ShareView3-arg confirm bug:ShareView.js:239-242passes 3 arguments toDialogService.confirm(message, confirmText, 'Stay Here').DialogService.confirmonly accepts 2 parameters. The 3rd argument'Stay Here'is silently ignored. User sees standard Confirm/Cancel instead of intended choice. Status: Unchanged.DBManager.getDeletionTokenfire-and-forget:DBManager.js:494callsthis.deleteDeletionToken(shareId)withoutawaitinside theonsuccesscallback. If deletion fails, the expired token remains indefinitely. Status: Unchanged.- PWA class review: The
pwaclass on anchor tags was used by old per-page click interceptors removed in 2026-06-30. Need to audit if any dead CSS/JS/HTML references remain, or standardize it for Router delegation. Status: Unchanged.
- Codebase scan: No new critical issues. Notable observations:
console.log/console.errorspam throughout frontend (~100 matches). Tech debt, not urgent.CACHE_NAMEbumped to"32"insw.jsand changelog updated inindex.html(commit28257e9). Routine deployment.AGENT_NOTES.mdmarked as deprecated and merged intocontext.md— safe to ignore.
- v11 schema migration: Remains on hold until Active bug backlog is cleared.
2026-07-23 — NoteWidget New Note Flow Simplified #
- User request: Make new notes open straight into the detail page instead of a dialog prompt.
- Changed:
public/components/NoteWidget.js— replacedDialogService.promptTextareaflow with a direct call to_createNewNote()(inherited fromNoteBase). This matches the behavior already used byNoteIndexPage. - Impact: Homepage "+ New Note" button now creates an empty note and navigates to
/note/:idimmediately, same as the full index page. No changes needed inNoteBase,NoteDetailPage, orDBManager. - Removed: Unused
DialogServiceimport fromNoteWidget.js. - Docs: Marked
new note, open straight to detail pageas completed inTODO.md.
2026-07-14 — v11 Migration Plan Review #
- User asked: Review relationship between recent
parentListIdfix and v11parentIdmigration goals. - Findings:
meta.parentListId(current workaround) is NOT the same as v11parentId. Different placement (metavs top-level), different scope (archive-only vs all children), and different queryability (unindexed vs compound index). The workaround is tactical; v11 is strategic. No collision.- v11 WILL solve
getListItems()N+1 query (Backlog - Tech Debt). Compound['parentId', 'order']index replaces per-childgetItem()calls. - v11 will NOT solve
searchItems()loading entire DB into memory (Backlog - Bugs).getAllItems()+ flat array scan remains. Search needs a separate fix: full-text index, pagination, or Web Worker.
- Action: Updated
docs/todo.md— clarifiedsearchItems()backlog item to note v11 doesn't fix it. MarkedgetListItems()N+1 as solved-by-v11.
2026-08-09 — ATProto Integration Exploration #
- User request: Explore integrating ATProto (Bluesky protocol) into Pockist.
- Research: Read ATProto docs (lexicons, auth, sync, self-hosting, Go SDK
indigo). - Findings: ATProto is a strong fit for Pockist's long-term goals:
- Replaces dead auth code — OAuth via existing Bluesky/DID identities. No custom accounts.
- Replaces "Pockist cloud" — User data syncs to their Personal Data Server (PDS), not our VPS.
- Replaces SQLite share links — Public ATProto records (
com.pockist.share) are natively shareable without a backend. - Enables social features — publish lists to Bluesky, collaborative lists, public feeds via AppView.
- Recommended approach: Tier 2 — ATProto as sync + identity layer. Keep IndexedDB primary (offline-first), sync to PDS when online. This preserves Pockist philosophy while adding cross-device sync.
- Custom lexicons proposed:
com.pockist.note,com.pockist.list,com.pockist.item,com.pockist.settings,com.pockist.share. Seedocs/atproto-integration.mdfor full schemas. - Backend impact: Go backend gets simpler. Delete
AccountHandlers.go,token/, SQLite user/share tables. Keep static file server, weather/geocode proxies. Optional: add lightweight AppView for public discovery. - Open questions: (1) Use
@atproto/apiSDK or hand-roll XRPC in vanilla JS? (2) OAuth callback — client-side or Go BFF? (3) What about users without Bluesky accounts? (4) Does this align with v11 schema migration? - Decision needed: User must confirm if ATProto is the desired direction vs. other sync options (Electric SQL, custom backend, etc.).
- Files created:
docs/atproto-integration.md - Files updated:
docs/todo.md(added to Backlog - Features)
2026-08-05 — NoteDetailPage Archive Race Fix #
- User report: Archiving a note from its detail page doesn't archive it — the note reappears in the index.
- Root cause:
_doArchive()calledDBManager.archiveItem()which setsarchived: truein the DB, then immediately calledRouter.go('/note'). Router removal of the page from DOM triggersdisconnectedCallback(), which calls_save()._save()spreadsthis._note.meta(stale — noarchived: true) and overwrites the DB record. The note is archived for ~0ms then silently un-archived. - Fix: Added
this._note.meta.archived = truein_doArchive()afterarchiveItemresolves. The subsequentdisconnectedCallback._save()now preserves the archived state. - Files changed:
public/components/NoteDetailPage.js - Audit: Checked
ListDetailPage— nodisconnectedCallbacksave pattern, so not affected.WorkoutDetailPagehasdisconnectedCallbackbut no save-on-exit pattern. Safe.
2026-07-23 — Workout Bug Fix + Changelog Nav Link #
- Workout
meta.entriesbug: User reported code not working after a field rename. Investigation foundWorkoutPage.jssave functions (_saveWorkout,_saveWorkoutEdit) wrote exercise data tometa.exercises, but render/edit functions read frommeta.entries. Workouts appeared empty after creation or reload. Root cause: rename refactor updated reads but missed writes. - Fix: Changed both save functions to use
meta: { ..., entries: exercises }andworkout.meta = { ..., entries: exercises, ... }. Two one-word key changes. Existing workouts withmeta.exerciseswill migrate tometa.entrieson next edit. - Changelog nav link: Added "Changelog" drawer link (
<a href="/about#changelog">) below About. Router updated to:- Strip
#hashfromroutePathbefore route matching (route.split(/[?#]/)[0]) - Scroll to hash target after page render via
requestAnimationFrame - Pass
location.hashthroughpopstatehandler
- Strip
- Version bump:
0.1.30→0.1.31.CACHE_NAMEbumped to"35". Changelog entry added: "Bug fixes and internal improvements". - Files changed:
public/components/WorkoutPage.js,public/services/Router.js,public/index.html,public/sw.js,docs/todo.md,docs/context.md.