- {activeTool() === "pan" && !props.disabled ? t("whiteboard.canvasHintPickPen") : t("whiteboard.canvasHint")}
+
+
+
+ {activeTool() === "hand" && !props.disabled ? t("whiteboard.canvasHintPickPen") : t("whiteboard.canvasHint")}
- {/* Mobile: the three corner islands below overlap each other under ~640px
- (they need ~520px combined), so under sm they collapse into one
- wrapping bar instead; desktop keeps the original three corners. */}
-
-
+ {/* Left style island — only while a drawing tool is active. */}
+
+
+
+
+ {(swatch) => (
+
+
+
+
+
+ {(option) => (
+
+ )}
+
+
+
+
+
+ {(option) => (
+
+ )}
+
+
+
+
+
+
+ {(option) => (
+
+ )}
+
+
+
+
+
+
+ {/* Bottom-left: zoom, then paper and (phones) the style toggle. */}
+
+
+
+
+
+
+
+
+
+
+
+
- {/* Bottom-right zoom */}
-
+ {/* Bottom-right: full screen. */}
+
-
-
-
diff --git a/src/components/whiteboard/whiteboard-room-ws.tsx b/src/components/whiteboard/whiteboard-room-ws.tsx
index 7525e28..2dec0bc 100644
--- a/src/components/whiteboard/whiteboard-room-ws.tsx
+++ b/src/components/whiteboard/whiteboard-room-ws.tsx
@@ -1,9 +1,13 @@
-import { Show, createEffect, createSignal, onCleanup, onMount } from "solid-js";
+import { createEffect, createSignal, onCleanup, onMount, type JSX } from "solid-js";
import { getBoardStrokes, type Board } from "@/api/boards";
import { formatApiErrorMessage } from "@/api/client";
-import { IconAlert } from "@/components/ui/icons";
-import { encodeStrokeSegments, decodeSegment, segmentToStroke } from "@/lib/board-stroke-codec";
-import type { Stroke } from "@/lib/draw-stroke";
+import {
+ decodeSegment,
+ encodeEraseMarkers,
+ encodeStrokeSegments,
+ segmentToStroke,
+ type BoardStroke,
+} from "@/lib/board-stroke-codec";
import { parseBoardWsMessage, type BoardWsMessage } from "@/lib/websocket-messages";
import { usePreferences } from "@/stores/preferences-context";
import { WhiteboardCanvas, type WhiteboardCanvasController } from "./whiteboard-canvas";
@@ -21,6 +25,8 @@ export type BoardLiveState = {
};
const MAX_RECONNECT = 6;
+/** A socket error stays on the canvas banner this long. */
+const NOTICE_MS = 6000;
export function WhiteboardRoom(props: {
board: Board;
@@ -28,6 +34,12 @@ export function WhiteboardRoom(props: {
onState?: (patch: BoardLiveState) => void;
onConnectionChange?: (state: WsState) => void;
onDeleted?: () => void;
+ /** Passed through to the canvas corners and banner. */
+ topLeft?: JSX.Element;
+ topRight?: JSX.Element;
+ banner?: string;
+ bannerTone?: "info" | "error";
+ class?: string;
}) {
const { locale } = usePreferences();
@@ -47,6 +59,7 @@ export function WhiteboardRoom(props: {
const seen = new Set