This commit is contained in:
legop3
2026-07-12 18:07:26 -04:00
parent fa92726e9c
commit 411313b21b
7 changed files with 17 additions and 8 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -78,7 +78,7 @@
<script defer src="https://analytics.otter.land/script.js" data-website-id="82dd56a5-db44-4279-bd1e-a4d9fee39af7" data-domains="rover.otter.land"></script> <script defer src="https://analytics.otter.land/script.js" data-website-id="82dd56a5-db44-4279-bd1e-a4d9fee39af7" data-domains="rover.otter.land"></script>
<script defer src="https://analytics.otter.land/recorder.js" data-website-id="82dd56a5-db44-4279-bd1e-a4d9fee39af7" data-domains="rover.otter.land" data-sample-rate="0.15" data-mask-level="moderate" data-max-duration="300000"></script> <script defer src="https://analytics.otter.land/recorder.js" data-website-id="82dd56a5-db44-4279-bd1e-a4d9fee39af7" data-domains="rover.otter.land" data-sample-rate="0.15" data-mask-level="moderate" data-max-duration="300000"></script>
<title>Roomba Rover</title> <title>Roomba Rover</title>
<script type="module" crossorigin src="/assets/index-BCATTSly.js"></script> <script type="module" crossorigin src="/assets/index-D5vPzVhj.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-BN3kEVFL.css"> <link rel="stylesheet" crossorigin href="/assets/index-BN3kEVFL.css">
</head> </head>
<body> <body>
+8 -1
View File
@@ -13,6 +13,7 @@ const { getRoomCameras, roomCameraEvents } = require('../roomCameraService');
const { const {
getPublicState: getPtzCameraState, getPublicState: getPtzCameraState,
getChatTargetForSocket: getPtzChatTargetForSocket, getChatTargetForSocket: getPtzChatTargetForSocket,
PTZ_CAMERA_ID,
ptzCameraEvents, ptzCameraEvents,
} = require('../ptzCameraService'); } = require('../ptzCameraService');
const { getState: getHomeAssistantState, homeAssistantEvents } = require('../homeAssistantService'); const { getState: getHomeAssistantState, homeAssistantEvents } = require('../homeAssistantService');
@@ -90,7 +91,13 @@ function buildSession(socket) {
.filter(Boolean) .filter(Boolean)
.map((entry) => ({ .map((entry) => ({
...entry, ...entry,
roverId: filterVisibleRoverId(socket, entry.roverId), /*
PTZ is intentionally not a roverManager record, so the normal physical
rover visibility filter would erase the user's PTZ chat target. Preserve
it here because getPtzChatTargetForSocket already applied the PTZ access
and queue/operator rules before buildUserEntry returned it.
*/
roverId: entry.roverId === PTZ_CAMERA_ID ? entry.roverId : filterVisibleRoverId(socket, entry.roverId),
})); }));
const roster = roverManager.getRosterForSocket(socket); const roster = roverManager.getRosterForSocket(socket);
const assignment = assignmentService.describeAssignment(socket?.id || ''); const assignment = assignmentService.describeAssignment(socket?.id || '');
+2 -1
View File
@@ -63,8 +63,9 @@ function useChatComposerSessionState(allowSpectatorInput) {
assignment state. assignment state.
*/ */
const self = users.find((entry) => entry?.socketId === socketId); const self = users.find((entry) => entry?.socketId === socketId);
if (!self?.roverId && ptz?.id && (ptz?.isOperator || ptz?.queuedPosition)) return ptz.id;
return self?.roverId || currentRoverId || null; return self?.roverId || currentRoverId || null;
}, [currentRoverId, socketId, users]); }, [currentRoverId, ptz?.id, ptz?.isOperator, ptz?.queuedPosition, socketId, users]);
const rover = useMemo( const rover = useMemo(
() => roster.find((entry) => String(entry.id) === String(chatTargetId)) || null, () => roster.find((entry) => String(entry.id) === String(chatTargetId)) || null,
@@ -52,8 +52,9 @@ function HudChatInput({ compact = false }) {
self-target resolution as the full chat panel. self-target resolution as the full chat panel.
*/ */
const self = users.find((entry) => entry?.socketId === socketId); const self = users.find((entry) => entry?.socketId === socketId);
if (!self?.roverId && ptz?.id && (ptz?.isOperator || ptz?.queuedPosition)) return ptz.id;
return self?.roverId || currentRoverId || null; return self?.roverId || currentRoverId || null;
}, [currentRoverId, socketId, users]); }, [currentRoverId, ptz?.id, ptz?.isOperator, ptz?.queuedPosition, socketId, users]);
const rover = useMemo( const rover = useMemo(
() => roverRoster.find((entry) => String(entry.id) === String(chatTargetId)) || null, () => roverRoster.find((entry) => String(entry.id) === String(chatTargetId)) || null,
[chatTargetId, roverRoster], [chatTargetId, roverRoster],