Skip to content

feat(app): GET /api/surfaces/recent — post-grained recent surfaces#173

Merged
benvinegar merged 2 commits into
mainfrom
feat/recent-surfaces-endpoint
Jun 29, 2026
Merged

feat(app): GET /api/surfaces/recent — post-grained recent surfaces#173
benvinegar merged 2 commits into
mainfrom
feat/recent-surfaces-endpoint

Conversation

@benvinegar

Copy link
Copy Markdown
Member

Adds GET /api/surfaces/recent?limit= to the workspace app: the N most-recently-updated surfaces (posts) across all sessions, newest first — a post-grained source for cross-session "latest posts" feeds, distinct from the session-grained GET /api/sessions.

Each item carries its sessionId, sessionTitle, agent, title, partKinds, timestamps, and parts with oversized inline text capped server-side (8000 chars, truncated: true flag) while images stay referenced by assetId. So a client can render a real, clipped preview cheaply and load the full post on click.

  • listRecentPosts(limit) added to the Store interface and implemented in both SqlStore (ORDER BY updatedAt DESC LIMIT ?) and JsonFileStore; covered by the shared storeContract so both backends are exercised.
  • Auth: gated exactly like /api/sessions. Fixes a latent public-read over-match — /api/surfaces/recent is explicitly excluded from the /api/surfaces/ public prefix so it isn't exposed on session-scoped boards.
  • Integration tests in test/surfaces-recent.test.ts (ordering, limit clamp, truncation, assetId passthrough, auth). Changeset (minor). 389/389 tests pass.

🤖 Generated with Claude Code

benvinegar and others added 2 commits June 29, 2026 13:25
Post-grained source for cross-session feeds (Org Home + per-workspace Home),
distinct from the session-grained /api/sessions. Caps oversized inline text
parts (truncated:true) while images stay by-reference (assetId); same auth as
/api/sessions (not broadened on a session-scoped publicRead board).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@benvinegar benvinegar force-pushed the feat/recent-surfaces-endpoint branch from 4f5e6ab to 9c7654b Compare June 29, 2026 17:28
@benvinegar benvinegar marked this pull request as ready for review June 29, 2026 17:29
@benvinegar benvinegar merged commit 9e61484 into main Jun 29, 2026
9 checks passed
@benvinegar benvinegar deleted the feat/recent-surfaces-endpoint branch June 29, 2026 17:32
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