Skip to content

Commit 165e076

Browse files
HMarzbancursoragent
andcommitted
feat(documents): add first-page paper and Last opened
The owner list shows a first-page paper on each row. Date sorts add headers on the rest after Favorites. Last opened does not move Last modified. Public create, slug GET, update, and the fleet omit preview and lastOpenedAt. Refs #221 Co-authored-by: Cursor <[email protected]>
1 parent 8bf8ebb commit 165e076

40 files changed

Lines changed: 1412 additions & 173 deletions

‎.cursor/docs/design-system.md‎

Lines changed: 9 additions & 9 deletions
Large diffs are not rendered by default.

‎AGENTS.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,9 @@ Inbox only. New cross-cutting working-style preferences go into §Workflow And R
339339

340340
- After substantive pad/TOC/design-system/chatroom work, run the continual-learning memory updater so regressions are not repeated.
341341
- Settings Documents list UX should follow a Google Docs-like per-row ⋮ menu, not inline visibility toggles. The menu lists Open, Copy link when public, Rename, Duplicate, Favorite or Unfavorite, then Private and Read-only. Favorite sits after Duplicate and before the Private divider. No toolbar star. Name is Favorite, never Bookmark or Pin (see CONTEXT.md §Documents list). Keep it minimal and size-fit for the settings panel. On mobile the Documents toolbar must stay 44px-target size-fit (flex/truncate sort, icon-only Trash, no desktop-width overflow). Private ON must clear and disable Read-only on that menu and on `DocumentSettingsPanel` (see §Document Access).
342+
- Date sorts on Settings → Documents use Date buckets on the rest after Favorites. No Favorites heading.
343+
- Last opened is a sort. The pad owner stamps `lastOpenedAt` via `POST /api/documents/:documentId/opened`. Last modified does not move.
344+
- Owner live list and Owner Trash list lead with `size-10` DocumentPreviewPaper (DocumentGridPreview), not `LuFileText`. Grid is 4/3 first-page paper. No screenshot thumbs. Create stays empty-state only.
342345
- TOC long heading titles must wrap (e.g. `text-pretty` / `whitespace-pre-line`), never truncate — use the full row width left of the trailing chat/unread rail. Tree connectors use daisyUI nested menu rails on `toc__children` only (vertical rails, no L-elbows). Accept stock rail opacity — do not reintroduce a TOC `::before` strengthen overwrite.
343346
- Mobile heading control stays a one-frame stepper, name first: `[name | − | +]`. Do not replace it with a chip that opens a list. The three cells share one join; no inner box around plus and minus. When the caret is Title, the join uses the same `is-active` color as other heading levels.
344347
- TOC chat/unread/presence all live in-flow in `TocRowTrail`. Desktop presence is `<AvatarStack anchor="right">` right of the chat trigger (right-anchored, fixed right edge, grows left, `translate-x-3` to the column inner edge). The scrollbar must stay inside the column, so do NOT widen `.toc__scroll` to overhang presence beyond the wrapper. That widening pushed the scrollbar out over the editor. Fix broken shipped UI motion (e.g. `RollingNumber`) in place — never strip it for a static fallback unless the maintainer asks.

‎CHANGELOG.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ This file is the product changelog. It names the live webapp. The hocuspocus app
2222
export turns a lone video, audio, or embed URL into a player, and writes each
2323
picture's natural width and height. A labeled link and a filter link stay links.
2424
Paste of a bare file address is unchanged.
25+
- Paint a first-page paper on Settings → Documents grid, list, and Trash. The
26+
paper paints stored DocumentGridPreview JSON in React. It is not a screenshot.
27+
Empty paper shows “Empty document”.
28+
- Sort Settings → Documents by Last opened. Opening an owned pad stamps Last
29+
opened. Last modified does not move. A document never opened shows
30+
“Never opened”.
31+
- Group the rest of the list and the grid with date headers: Today, Yesterday,
32+
Previous 7 days, Previous 30 days, and Earlier. Favorites stay unbucketed at
33+
the top, then a hairline. Title sorts stay a flat list. Last opened sort also
34+
uses Never opened when `lastOpenedAt` is null.
2535

2636
### Fixed
2737

‎CONTEXT.md‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,16 @@ Shared names for docs.plus domain concepts. Architecture reviews and deepenings
1313

1414
## Documents list
1515

16-
- **Favorite** — a per-user mark that pins a document to the top of Settings → Documents. Stored as `DocumentFavorite` (`userId` + `documentId`). Owner-only. Soft-delete keeps the row; purge cascade drops it. Not **Bookmark** (chat messages and the hyperlink picker) and not **Pin** (channel messages).
16+
- **Favorite** — a per-user mark that pins a document to the top of Settings → Documents. Stored as `DocumentFavorite` (`userId` + `documentId`). Owner-only. Soft-delete keeps the row; purge cascade drops it.
17+
_Avoid_: Bookmark (chat messages and the hyperlink picker), Pin (channel messages)
18+
- **Owner live list** — the owner's undeleted Documents in Settings. Pins Favorites first. Includes `isFavorite`, DocumentGridPreview, and Last opened.
19+
_Avoid_: public fleet (omits Favorite, DocumentGridPreview, and Last opened)
20+
- **Owner Trash list** — the owner's soft-deleted Documents. Includes DocumentGridPreview and Last opened. Omits Favorite. Same NULL fill as the Owner live list.
21+
_Avoid_: Owner live list
22+
- **DocumentGridPreview** — the first-page extract painted on Documents paper (grid, list thumb, Trash thumb). SQL NULL means never extracted. `{ heading: null, lines: [] }` means empty or a failed extract. The paper omits heading at paint when it equals Title.
23+
_Avoid_: DocumentPreview (admin stale-doc shape), screenshot, thumbnail
24+
- **Last opened** — `DocumentMetadata.lastOpenedAt`, stamped when the owner opens the pad. Sort key `lastOpenedAt_desc`. Does not move Last modified. Owner lists only.
25+
- **Date buckets** — Today / Yesterday / Previous 7 days / Previous 30 days / Earlier / Never opened. Used on date sorts in Settings → Documents. Favorites stay unbucketed. Never opened is for a null sort timestamp (Last opened with no stamp).
1726

1827
## Document access
1928

0 commit comments

Comments
 (0)