chat on spectator page

This commit is contained in:
legop3
2026-01-26 14:10:13 -05:00
parent 2062b4888c
commit b275d5a08c
5 changed files with 19 additions and 14 deletions
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -11,7 +11,7 @@
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="apple-mobile-web-app-title" content="Multi Roomba Rover" />
<title>Multi Roomba Rover</title>
<script type="module" crossorigin src="/assets/index-CiK78C9b.js"></script>
<script type="module" crossorigin src="/assets/index-D0OyPG8n.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-CVqWOsms.css">
</head>
<body>
@@ -7,7 +7,7 @@ const { roomCameraStreamEvents, getRoomCameraState } = require('./roomCameraSnap
const SUBSCRIBE_LIMIT = 50;
const SUBSCRIBE_WINDOW_MS = 10000;
const STREAM_INTERVAL_MS = 800;
const STREAM_INTERVAL_MS = 1000;
function passesMode(socket) {
const mode = getMode();
+7 -2
View File
@@ -8,7 +8,12 @@ import ChatTypingRow from './ChatTypingRow.jsx';
const FLITE_VOICES = ['kal', 'rms', 'slt', 'ksp', 'bdl'];
const ESPEAK_PITCHES = Array.from({ length: 10 }, (_, idx) => idx * 10);
export default function ChatPanel({ hideInput = false, hideSpectatorNotice = false, fillHeight = false }) {
export default function ChatPanel({
hideInput = false,
hideSpectatorNotice = false,
fillHeight = false,
allowSpectatorInput = false,
}) {
const { session } = useSession();
const {
messages,
@@ -30,7 +35,7 @@ export default function ChatPanel({ hideInput = false, hideSpectatorNotice = fal
const [engine, setEngine] = useState(() => ttsSettings?.engine || 'flite');
const [voice, setVoice] = useState(() => ttsSettings?.voice || 'rms');
const [pitch, setPitch] = useState(() => (Number.isFinite(ttsSettings?.pitch) ? ttsSettings.pitch : 50));
const canChat = session?.role !== 'spectator';
const canChat = session?.role !== 'spectator' || allowSpectatorInput;
const listRef = useRef(null);
const currentRoverId = session?.assignment?.roverId || null;
+1 -1
View File
@@ -190,7 +190,7 @@ function SpectatorContent() {
</div>
) : null}
<div className={`${topBarItemClass} ${isPortraitLayout ? portraitItemHeight : 'flex-[1.1] min-h-0'}`}>
<ChatPanel hideInput hideSpectatorNotice fillHeight />
<ChatPanel allowSpectatorInput hideSpectatorNotice fillHeight />
</div>
<div className={`${topBarItemClass} ${isPortraitLayout ? portraitItemHeight : ''}`}>
<LogsRow className={`${isPortraitLayout ? 'h-full' : 'h-40'} overflow-hidden`} />