Skip to content

feat(notes): pin notes, each person's own, at the top of the tree and the Notes page - #414

Merged
adeelahmad merged 1 commit into
mainfrom
claude/project-thread-wm7xc9
Oct 15, 2026
Merged

adeelahmad merged 1 commit into
mainfrom
claude/project-thread-wm7xc9

Conversation

@adeelahmad

Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: there was no way to keep the notes you use most within reach; the tree is in its own order and the Notes page is newest first.

After: Pin in a note's ⋯ menu in the tree pins it for you. Pinned notes show under Pinned at the top of the tree (each with an Unpin button) and first on the Notes page with a pin mark. Pins are each person's own, so pinning changes nothing for anyone else and needs only read access; up to 50 per namespace.

How: notebook.pin() keeps the people who pinned a page in note_page.pinned_by (added and removed with array::union / array::complement, so pinning twice is harmless). PUT and DELETE /api/v1/notes/{pid}/pin pin and unpin; every page in GET /notes and each page read says pinned for the caller, and pinned_by itself is never sent. On the web, components/notes/pin.ts (usePin) pins optimistically and takes it back with a notice when the server refuses.

Motivation and Context

Part of the notes UI audit (Adeel: "notes ui is very bad and is missing tons of things"): favourites or pins are in every notes app.

Steps to reproduce (if appropriate):

Notes tree → ⋯ on a note → Pin. It shows under Pinned at the top of the tree and first on /notes. Unpin from its row under Pinned.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (make hooks checks it on commit).
  • I added or updated tests.
  • My change requires documentation updates, and I have updated docs/ accordingly.
  • Users need more than the title to understand it, so I wrote it under ## Unreleased in CHANGELOG.md.

Done questions (AGENTS.md)

  • Goal: notes can be pinned to the top of the tree and the Notes page; merged on green CI.
  • Agents: PUT/DELETE /api/v1/notes/{pid}/pin with any token; pinned on every page read. No MCP tool, as pins are a person's own view.
  • Zero setup: nothing to install or configure.
  • Fewest clicks: two (⋯, Pin); unpin is one button on the pinned row.
  • Configurable: n/a, no new settings (the 50-pin cap is a guard, not a preference).
  • Light: no new dependency.
  • Private and secure: a page must be readable to pin it; who else pinned a page is never returned.
  • Cost: no model calls.
  • User decides: nothing pins on its own; defaults unchanged.
  • Upgrades: one new optional field on note_page (SCHEMALESS), read as empty when missing; no upgrade step needed.
  • Honest: docs describe what is built.
  • Tests (backend: pin, unpin, cap, not leaked; web: pin, unpin, read-only menu, refused pin, Notes page order) and docs (docs/notes.md Pinned notes, docs/api.md) updated; make openapi regenerated. Local: backend 1110 passed, web 912 passed.
  • Open standards: n/a.
  • Refine later: drag to reorder pinned notes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RrY2byt5BHVeBXJUyfwWpb


Generated by Claude Code

… the Notes page

Pin in a note's ⋯ menu in the tree pins it for that person: it shows under
Pinned at the top of the tree and first on the Notes page. Pins need only read
access and change nothing for anyone else (up to 50 per namespace).
PUT/DELETE /api/v1/notes/{pid}/pin; each page says whether you pinned it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RrY2byt5BHVeBXJUyfwWpb
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.

2 participants