Notechondria

Version: 0.1.5 Build Date: 2026-04-07T07:00

What's Changed

Note UUID routing and access policy

  • Added uuid (UUIDField, unique, auto-generated) to the Note model with a safe three-step migration (add nullable, backfill, enforce unique constraint).
  • Added note_type field (CharField, choices: N=Normal, C=Comment) and source_note self-referential ForeignKey for comment notes. When a source note is deleted, its comments become private (not deleted).
  • New API endpoint GET/PATCH/DELETE /api/v1/notes/uuid/<uuid>/ (NoteByUuidApiView) with full access control: public notes readable by anyone, private notes only by the owner, edits/deletes restricted to owner. Response includes can_edit boolean.
  • Existing NoteDetailApiView.get now also returns can_edit.
  • NoteSummarySerializer and NoteDetailSerializer include uuid, note_type, and source_note_uuid.
  • NoteWriteSerializer accepts note_type and source_note_uuid for creating comment notes.
  • Frontend URL routing: hash-based deep links at #/notes/<uuid>. URL updates on note select/create/save. Deep-linked notes auto-open in editor (owner) or read-only viewer (non-owner).
  • "Copy link" button in both the note editor toolbar and note viewer options menu.
  • 11 new backend tests covering UUID lookup, access control, comment creation, source-delete privacy, and 404 handling.

Files Changed

  • backend/notes/models.py -- Added uuid, note_type, source_note fields to Note model
  • backend/notes/migrations/0013_add_uuid_note_type_source_note.py -- Three-step migration with UUID backfill
  • backend/notes/api.py -- NoteByUuidApiView, updated serializers, comment privacy on delete
  • backend/notechondria/api_urls.py -- Added notes/uuid/<uuid>/ route
  • backend/notes/tests.py -- 11 new tests in NoteUuidApiTests, fixed anonymous notes test
  • frontend/editor_app/lib/main.dart -- Added dart:js_interop and package:web imports
  • frontend/editor_app/pubspec.yaml -- Added web: ^1.1.0 dependency
  • frontend/editor_app/lib/core/client.dart -- getNoteByUuid() method
  • frontend/editor_app/lib/app_shell.dart -- URL routing helpers, deep-link bootstrap, _openNoteByUuid, _showNoteDialogForDeepLink, URL sync on select/create/save
  • frontend/editor_app/lib/components/note_viewer.dart -- "Copy link" menu item
  • frontend/editor_app/lib/modules/note_editor.dart -- "Copy link" toolbar button