Sync whiteboard images and add board ownership
CI / server (push) Successful in 33s
CI / frontend (push) Successful in 28s
CI / kiosk (push) Failing after 7m17s
Build and Publish Docker Images / build-and-push (apps/web-client/Dockerfile, pistation-web) (push) Successful in 2m17s
Build and Publish Docker Images / build-and-push (server/Dockerfile, pistation-server) (push) Successful in 2m32s

This commit is contained in:
2026-08-09 21:06:31 -04:00
parent 07508504ac
commit 404a35e1b1
13 changed files with 355 additions and 14 deletions
+1
View File
@@ -3,6 +3,7 @@ import type { RoomMode, RoomState } from "./room.js";
export interface ModeSetEvent {
type: "mode.set";
mode: RoomMode;
ownerId?: string | null;
}
export interface PresenterSetEvent {
+1
View File
@@ -16,6 +16,7 @@ export interface RoomState {
roomName: string;
mode: RoomMode;
presenterId: string | null;
whiteboardOwnerId?: string | null;
annotationsLocked: boolean;
updatedAt: number;
}
+24
View File
@@ -6,14 +6,22 @@ export interface WhiteboardElement {
[key: string]: unknown;
}
export interface WhiteboardFile {
id: string;
url: string;
mimeType: string;
}
export interface WhiteboardPatchEvent {
type: "whiteboard.patch";
elements: WhiteboardElement[];
files?: WhiteboardFile[];
}
export interface WhiteboardSnapshotEvent {
type: "whiteboard.snapshot";
elements: WhiteboardElement[];
files?: WhiteboardFile[];
backgroundColor: string;
}
@@ -48,6 +56,22 @@ export function mergeWhiteboardElements(
return [...byId.values()];
}
export function mergeWhiteboardFiles(
current: WhiteboardFile[],
incoming: WhiteboardFile[]
): WhiteboardFile[] {
const byId = new Map<string, WhiteboardFile>();
for (const file of current) {
byId.set(file.id, file);
}
for (const file of incoming) {
if (!byId.has(file.id)) {
byId.set(file.id, file);
}
}
return [...byId.values()];
}
function isNewerElement(candidate: WhiteboardElement, existing: WhiteboardElement): boolean {
if (candidate.version !== existing.version) {
return candidate.version > existing.version;