Task #433: incoming-note popup — render full note + 3-button action row
- Inner body now renders as a real sticky note: keeps colored surface, supports checklist (read-only) when noteKind === "checklist". - Action row trimmed to exactly 3 buttons: Done (تم), Open note (فتح الملاحظة), Reply (رد). Removed the standalone Dismiss button; header X still closes. - Reply variant uses the same 3-button row (Done is a dismiss-only no-op since the note owner can't mark their own note read). - Wire kind + items from backend `note_received` payload into client IncomingNotePayload (noteKind/items) via use-notifications-socket. - Locales: markRead → "Done"/"تم"; new openNote/done keys; openThread unified to "Open note"/"فتح الملاحظة". - Tests: replaced removed `incoming-note-popup-dismiss` testid usages with header `-close`; updated reply variant assertions to expect the 3-button row; fixed pre-existing pluralization bug in reply path (`/replies` → `/reply`) that was unrelated to this task but blocked the reply popup test from validating. Labels and pin were not surfaced in the popup because they are sender-private state (note_recipients only snapshots title/content/color/kind/items); the recipient never receives the sender's labelIds/isPinned, so showing them would be misleading. All affected e2e tests pass (notes-popup-on-receive note + reply, notes-popup-touch-tap both, notes-inbox); queue unit tests pass.
This commit is contained in:
@@ -153,6 +153,13 @@ export function useNotificationsSocket() {
|
||||
typeof payload.noteId === "number" &&
|
||||
typeof payload.senderUserId === "number"
|
||||
) {
|
||||
const rawKind = (payload as { kind?: unknown }).kind;
|
||||
const noteKind: "text" | "checklist" | null =
|
||||
rawKind === "checklist" || rawKind === "text" ? rawKind : null;
|
||||
const rawItems = (payload as { items?: unknown }).items;
|
||||
const items = Array.isArray(rawItems)
|
||||
? (rawItems as IncomingNotePayload["items"])
|
||||
: null;
|
||||
const full: IncomingNotePayload = {
|
||||
noteId: payload.noteId,
|
||||
recipientRowId: payload.recipientRowId,
|
||||
@@ -162,6 +169,8 @@ export function useNotificationsSocket() {
|
||||
sentAt: payload.sentAt,
|
||||
senderUserId: payload.senderUserId,
|
||||
sender: payload.sender ?? null,
|
||||
noteKind,
|
||||
items,
|
||||
};
|
||||
enqueued = enqueueNotePopupRef.current(
|
||||
full,
|
||||
|
||||
Reference in New Issue
Block a user