Add favorites and recently visited pages
Pages can be starred from their header; favorites show in the sidebar above the spaces, and Home lists the pages visited last. Both are per user and per workspace, and are filtered by the caller's current rights, so pages that moved out of reach or into the trash drop out. Visits are trimmed to the newest 50 per workspace. The icon set gains the glyphs the rest of Phase 1 needs, and DwIcon can draw a filled variant for on/off states. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
34660c6b46
commit
b0e36fcfaf
19 files changed
+804
-13
No files matched your search
+74
-1
@@ -1209,6 +1209,68 @@ paths:
|
||||
"204": { description: Removed }
|
||||
"403": { $ref: "#/components/responses/Error" }
|
||||
"404": { $ref: "#/components/responses/Error" }
|
||||
/api/v1/workspaces/{id}/favorites:
|
||||
parameters:
|
||||
- { name: id, in: path, required: true, schema: { type: string } }
|
||||
get:
|
||||
operationId: listFavorites
|
||||
tags: [pages]
|
||||
summary: The caller's favorite pages in the workspace, newest first
|
||||
security: [{ bearer: [] }]
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema: { type: array, items: { $ref: "#/components/schemas/PageItem" } }
|
||||
"404": { $ref: "#/components/responses/Error" }
|
||||
/api/v1/workspaces/{id}/recent:
|
||||
parameters:
|
||||
- { name: id, in: path, required: true, schema: { type: string } }
|
||||
get:
|
||||
operationId: listRecentPages
|
||||
tags: [pages]
|
||||
summary: Pages the caller visited last in the workspace
|
||||
security: [{ bearer: [] }]
|
||||
parameters:
|
||||
- { name: limit, in: query, schema: { type: integer, minimum: 1, maximum: 50 } }
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema: { type: array, items: { $ref: "#/components/schemas/PageItem" } }
|
||||
"404": { $ref: "#/components/responses/Error" }
|
||||
/api/v1/pages/{id}/favorite:
|
||||
parameters:
|
||||
- { name: id, in: path, required: true, schema: { type: string } }
|
||||
put:
|
||||
operationId: addFavorite
|
||||
tags: [pages]
|
||||
summary: Add the page to the caller's favorites
|
||||
security: [{ bearer: [] }]
|
||||
responses:
|
||||
"204": { description: Added }
|
||||
"404": { $ref: "#/components/responses/Error" }
|
||||
delete:
|
||||
operationId: removeFavorite
|
||||
tags: [pages]
|
||||
summary: Remove the page from the caller's favorites
|
||||
security: [{ bearer: [] }]
|
||||
responses:
|
||||
"204": { description: Removed }
|
||||
"404": { $ref: "#/components/responses/Error" }
|
||||
/api/v1/pages/{id}/visit:
|
||||
parameters:
|
||||
- { name: id, in: path, required: true, schema: { type: string } }
|
||||
post:
|
||||
operationId: recordPageVisit
|
||||
tags: [pages]
|
||||
summary: Note that the caller opened the page (for the recent list)
|
||||
security: [{ bearer: [] }]
|
||||
responses:
|
||||
"204": { description: Recorded }
|
||||
"404": { $ref: "#/components/responses/Error" }
|
||||
components:
|
||||
securitySchemes:
|
||||
bearer:
|
||||
@@ -1377,7 +1439,7 @@ components:
|
||||
icon: { type: string }
|
||||
Page:
|
||||
type: object
|
||||
required: [id, workspace, space, parent, title, icon, created, updated, deletedAt, inTrash, ancestors, role]
|
||||
required: [id, workspace, space, parent, title, icon, created, updated, deletedAt, inTrash, ancestors, role, favorite]
|
||||
properties:
|
||||
id: { type: string }
|
||||
workspace: { type: string }
|
||||
@@ -1391,6 +1453,7 @@ components:
|
||||
inTrash: { type: boolean, description: The page or one of its ancestors is in the trash }
|
||||
ancestors: { type: array, items: { $ref: "#/components/schemas/PageRef" }, description: Root first }
|
||||
role: { $ref: "#/components/schemas/SpaceRole" }
|
||||
favorite: { type: boolean, description: In the caller's favorites }
|
||||
PageContent:
|
||||
type: object
|
||||
required: [content, updated]
|
||||
@@ -1608,3 +1671,13 @@ components:
|
||||
id: { type: string }
|
||||
name: { type: string }
|
||||
role: { $ref: "#/components/schemas/SpaceRole" }
|
||||
PageItem:
|
||||
type: object
|
||||
required: [id, title, icon, space, spaceName, at]
|
||||
properties:
|
||||
id: { type: string }
|
||||
title: { type: string }
|
||||
icon: { type: string }
|
||||
space: { type: string }
|
||||
spaceName: { type: string }
|
||||
at: { type: string, description: When it was favorited, or last visited }
|
||||
Reference in new issue
Block a user