feat/pin-message #66

Merged
longjacksonle merged 7 commits from feat/pin-message into main 2026-05-10 23:56:29 +02:00
No description provided.
Add the `pinned_messages` SQLite table (migration 0016) and a new `db::pinned` module with idempotent pin/unpin operations, per-room cap enforcement (50 pins), bulk-fetch helpers, and a soft-delete-aware count query. Also add `db::auth::display_names_for_ids` for bulk cross-pool user resolution to avoid N+1 lookups when rendering the pin strip and full-list page.
Implements the HTTP layer for Phase 19 pinned messages:

- POST /messages/{id}/pin and DELETE /messages/{id}/pin write to the DB, broadcast MessagePinned/MessageUnpinned WS events, and return an OOB-swapped pinned strip fragment so the requesting tab updates immediately.
- GET /room/{id}/pins and GET /dm/{peer_id}/pins render a standalone page listing all pins for the room newest-first, with per-row Unpin buttons that remove themselves from the list via hx-swap="outerHTML".
- A pinned strip appears below the room/DM header, pre-rendered server-side at page load and updated live via WS broadcasts. Caps display at 3 entries with a "See all (N) pinned" link to the full list.
- MessageView gains is_pinned so the hover menu shows Pin vs Unpin without an extra per-message query; page renders bulk-load pinned ids in a single query, while per-message broadcast sites set it to false (the next full page load corrects the state).
- AppError::Conflict(String) maps to HTTP 409 and is returned when the per-room pin cap is exceeded.
longjacksonle deleted branch feat/pin-message 2026-05-10 23:56:29 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/lets-chat!66
No description provided.