Skip to content

Add document bookmarks#13

Draft
tnsardesai wants to merge 3 commits into
mainfrom
hypeship/bookmark-docs
Draft

Add document bookmarks#13
tnsardesai wants to merge 3 commits into
mainfrom
hypeship/bookmark-docs

Conversation

@tnsardesai

@tnsardesai tnsardesai commented Jul 20, 2026

Copy link
Copy Markdown

Summary

Adds document bookmarks. Every doc page gets a bookmark button that saves the doc to the signed-in user's bookmarks, and /bookmarks lists them — split into "your documents" and "shared with you", mirroring the /docs design.

Bookmarks re-resolve access on every load rather than trusting save-time access, so they honor the same authorization as the viewer:

  • A doc whose access is later revoked (grant removed, token rotated, or doc deleted) stays listed as revoked with no link, showing only its doc id — never the live title of a doc the viewer can no longer see.
  • View-token sharing is preserved: the token a doc was bookmarked through is stored and re-checked, so a token-shared private doc stays reachable (the token is re-appended to its link) until that token is rotated or the doc is deleted.

Behavior

  • /bookmarks route with OWNED and SHARED-WITH-YOU sections, man-page styled like /docs.
  • Bookmark button on doc pages: a real toggle (add when unsaved, remove when saved) that preserves the return URL and any submitted view token.
  • Per-row remove on /bookmarks, keyed by doc id so revoked/deleted docs can still be dropped.
  • Access labels: owner / editor / commenter / viewer / public / link (token-only) / revoked.
  • bookmarks table migration; nav links added from / and /docs.
  • Pure row rendering lives in lib/docs/bookmarks-view.ts (unit-tested).

Tests

  • npm test (includes lib/docs/bookmarks-view.test.ts covering revoked / token-link / remove-form rendering)
  • npm run build

@vercel

vercel Bot commented Jul 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
justhtml Ready Ready Preview, Comment Jul 21, 2026 6:49am

- persist the view token a doc was bookmarked through and re-check access
  with it on /bookmarks, so a token-shared doc stays linkable (token
  re-appended) until the token is rotated or the doc is revoked
- make the doc-page bookmark button a real toggle (add/remove)
- add a per-row remove control on /bookmarks, working for revoked docs too
- revoked bookmarks show "<doc id> — revoked" with no link, never the
  live title of a doc the viewer can no longer access
- label token-only access "link" (was mislabeled "public")
- extract pure row rendering to lib/docs/bookmarks-view.ts with unit tests

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add the /bookmarks web surface to the Viewing listing in skill-content.ts
(the source for /llms.txt and SKILL.md), alongside its sibling /docs.
Regenerated SKILL.md via gen:skill.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant