Skip to content

feat(pwa): persist frontmatter, comments, depth in localStorage (#20)#21

Merged
syswave-dev merged 1 commit intomainfrom
feat/persist-pwa-controls
May 5, 2026
Merged

feat(pwa): persist frontmatter, comments, depth in localStorage (#20)#21
syswave-dev merged 1 commit intomainfrom
feat/persist-pwa-controls

Conversation

@syswave-dev
Copy link
Copy Markdown
Collaborator

Summary

  • Persists #frontmatter-toggle, #comments-toggle, and #depth-input across reloads via localStorage.
  • Keys: pullmd-frontmatter, pullmd-comments, pullmd-comment-depth — follows the existing pullmd-lang / pullmd-theme pattern.
  • Restore happens before the first updateDepthVisibility() call so the depth label correctly hides when a persisted unchecked comments-toggle is restored.
  • Depth value is clamped to the existing [1, 10] HTML range; invalid stored values are ignored and the HTML default (3) is kept.

Bumps version 2.0.02.1.0 and SW cache v18v19.

Closes #20.

Test plan

  • node --test — all 399 tests pass
  • Load PWA, toggle frontmatter on, set depth to 5, reload — both states restored
  • Toggle comments off, reload — depth label correctly hidden after restore
  • Verify comments-toggle persistence works (was not previously persisted)

Note: do not push :latest to v2.x yet — release as :2.1.0 / :2.1 / :2 only. :latest stays on v1.2.x per the v2.0 changelog policy.

🤖 Generated with Claude Code

Closes #20. Three new keys (pullmd-frontmatter, pullmd-comments,
pullmd-comment-depth) follow the existing pullmd-lang/pullmd-theme
pattern. Restored on load before updateDepthVisibility() so the depth
label visibility reflects the persisted comments-toggle state.

Bumps version to 2.1.0 and SW cache to v19.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@syswave-dev syswave-dev merged commit ffafc10 into main May 5, 2026
3 checks passed
@syswave-dev syswave-dev deleted the feat/persist-pwa-controls branch May 5, 2026 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PWA: persist frontmatter toggle and comment depth in localStorage

1 participant