Skip to content

Conversation

@rui-typelets
Copy link
Collaborator

Summary

  • Add public notes sharing feature allowing users to publish notes as shareable web pages
  • Implement comprehensive security hardening with DOMPurify sanitization (frontend + backend)
  • Add Globe icon indicators, "Public" view filter, and publish/unpublish modal
  • Include SEO support, theme toggle, and collapsible table of contents on public pages

Changes

New Files

  • src/pages/PublicNotePage.tsx - Public note viewer with TipTap rendering
  • src/components/editor/modals/PublishNoteModal.tsx - Publish/unpublish dialog

Modified

  • Added dompurify dependency for XSS protection
  • Updated TabBar and NoteCard with Globe icon for published notes
  • Added "Public" view in sidebar with note count
  • Extended useNotes hook with publish/unpublish operations
  • Updated types and API client for public note fields

Security

  • DOMPurify sanitization on frontend (defense in depth with backend)
  • Internal note IDs stripped from public content
  • Clear E2E bypass warning in publish modal
  • No auth tokens exposed on public page
  • Hard delete on unpublish

Test plan

  • Publish a note and verify public page renders correctly
  • Check Globe icon appears on tabs and note cards
  • Verify theme toggle works (light/dark)
  • Test table of contents collapse/expand
  • Unpublish and confirm 404 returned
  • Verify "Public" filter shows only published notes
  • Test on mobile viewport

Add ability to publish notes as public, shareable pages while maintaining security for the E2E encrypted notes application.

  Features:
  - Publish/unpublish notes via modal with optional author attribution
  - Public page at /p/:slug with full TipTap rendering support
  - Globe icon indicator on tabs and note cards for published notes
  - "Public" view in sidebar to filter published notes
  - Auto-sync: edits to notes automatically update public version
  - Theme toggle (light/dark) on public page, defaults to system
  - Collapsible table of contents support
  - SEO meta tags (Open Graph, Twitter Cards)

  Security:
  - DOMPurify sanitization on both frontend and backend (defense in depth)
  - Strip internal note IDs from public content
  - Clear warning that publishing bypasses E2E encryption
  - Unguessable slugs (nanoid, 839 quadrillion combinations)
  - Hard delete on unpublish (no soft delete)
  - Rate limiting on public endpoints
  - No auth tokens or sensitive data exposed
@rui-typelets rui-typelets self-assigned this Nov 22, 2025
@rui-typelets rui-typelets merged commit 83e6950 into main Nov 22, 2025
3 checks passed
@github-actions
Copy link
Contributor

🎉 This PR is included in version 1.41.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants