mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-15 17:12:59 -04:00
community goal? never jnew her
This commit is contained in:
+3
-3
@@ -33,7 +33,7 @@ import SettingsPanel from './components/SettingsPanel/index.jsx';
|
||||
import Tabs, { Tab, TabList, TabPanel, TabPanels } from './components/Tabs/index.jsx';
|
||||
import useDefaultNickname from './hooks/useDefaultNickname.js';
|
||||
import useUserIdentitySync from './hooks/useUserIdentitySync.js';
|
||||
import CommunityGoalBanner from './components/CommunityGoalBanner/index.jsx';
|
||||
import GlobalObjectiveBanner from './components/GlobalObjectiveBanner/index.jsx';
|
||||
import RoverQueuesPanel from './components/RoverQueuesPanel/index.jsx';
|
||||
import VipPanel from './components/VipPanel/index.jsx';
|
||||
import { useSessionSelector } from './context/SessionContext.jsx';
|
||||
@@ -79,7 +79,7 @@ function DesktopLayout({ layout, onOpenHelpOverlay }) {
|
||||
<LogPanel />
|
||||
</div>
|
||||
<div className="flex min-w-0 flex-1 flex-col gap-0.5 overflow-y-auto">
|
||||
<CommunityGoalBanner layout={layout} />
|
||||
<GlobalObjectiveBanner layout={layout} />
|
||||
<RightPaneTabs layout={layout} onOpenHelpOverlay={onOpenHelpOverlay} />
|
||||
{/* <SessionSnapshot /> */}
|
||||
</div>
|
||||
@@ -301,7 +301,7 @@ function AppWithProviders({ layout, isDesktop, fullscreen }) {
|
||||
<KeyboardInputManager />
|
||||
<GamepadInputManager />
|
||||
<main className={`flex w-full flex-col gap-0.5 text-base ${isDesktop ? 'h-full overflow-hidden' : ''}`}>
|
||||
{!isDesktop ? <CommunityGoalBanner layout={layout} /> : null}
|
||||
{!isDesktop ? <GlobalObjectiveBanner layout={layout} /> : null}
|
||||
{renderedLayout}
|
||||
</main>
|
||||
<AlertFeed />
|
||||
|
||||
@@ -21,7 +21,7 @@ export default function AdminPanelContent() {
|
||||
lockRover,
|
||||
setMode,
|
||||
requestControl,
|
||||
setCommunityGoal,
|
||||
setGlobalObjective,
|
||||
setAdminReason,
|
||||
rebootRover,
|
||||
rebootServer,
|
||||
@@ -37,8 +37,8 @@ export default function AdminPanelContent() {
|
||||
const [serverRebooting, setServerRebooting] = useState(false);
|
||||
const [clearingLlmHistory, setClearingLlmHistory] = useState(false);
|
||||
const health = session?.health || null;
|
||||
const currentGoal = session?.communityGoal?.text || '';
|
||||
const goalUpdatedAt = session?.communityGoal?.updatedAt || null;
|
||||
const currentGoal = session?.globalObjective?.text || '';
|
||||
const goalUpdatedAt = session?.globalObjective?.updatedAt || null;
|
||||
const [goalDraft, setGoalDraft] = useState(currentGoal);
|
||||
const currentReason = session?.adminReason?.text || '';
|
||||
const reasonUpdatedAt = session?.adminReason?.updatedAt || null;
|
||||
@@ -128,7 +128,7 @@ export default function AdminPanelContent() {
|
||||
|
||||
const handleGoalSave = async () => {
|
||||
try {
|
||||
await setCommunityGoal(goalDraft);
|
||||
await setGlobalObjective(goalDraft);
|
||||
} catch (err) {
|
||||
alert(err.message);
|
||||
}
|
||||
@@ -136,7 +136,7 @@ export default function AdminPanelContent() {
|
||||
|
||||
const handleGoalClear = async () => {
|
||||
try {
|
||||
await setCommunityGoal(null);
|
||||
await setGlobalObjective(null);
|
||||
} catch (err) {
|
||||
alert(err.message);
|
||||
}
|
||||
@@ -351,7 +351,7 @@ export default function AdminPanelContent() {
|
||||
</div>
|
||||
<div className="space-y-0.5">
|
||||
<div className="flex items-center justify-between text-xs text-slate-400">
|
||||
<span>Community goal</span>
|
||||
<span>Global objective</span>
|
||||
{goalUpdatedAt ? (
|
||||
<span>Updated {new Date(goalUpdatedAt).toLocaleString()}</span>
|
||||
) : null}
|
||||
@@ -360,12 +360,12 @@ export default function AdminPanelContent() {
|
||||
type="text"
|
||||
value={goalDraft}
|
||||
onChange={(event) => setGoalDraft(event.target.value)}
|
||||
placeholder="Set a community goal"
|
||||
placeholder="Set a global objective"
|
||||
className="field-input text-sm"
|
||||
/>
|
||||
<div className="flex gap-0.5 text-xs">
|
||||
<button type="button" onClick={handleGoalSave} className="button-dark">
|
||||
Set goal
|
||||
Set objective
|
||||
</button>
|
||||
<button type="button" onClick={handleGoalClear} className="button-danger">
|
||||
Clear
|
||||
@@ -495,4 +495,3 @@ export default function AdminPanelContent() {
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -1,5 +1,5 @@
|
||||
// Community Goal Banner
|
||||
// Purpose: Defines the Community Goal Banner module and the local helpers/components used in this file.
|
||||
// Global Objective Banner
|
||||
// Purpose: Defines the Global Objective Banner module and the local helpers/components used in this file.
|
||||
// Scope: Keeps behavior unchanged while isolating this concern into a clear, single-responsibility unit.
|
||||
import { useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { useSession } from '../../context/SessionContext.jsx';
|
||||
@@ -8,9 +8,9 @@ const MOBILE_DISMISS_MS = 10000;
|
||||
const MAX_FONT_PX = 28;
|
||||
const MIN_FONT_PX = 14;
|
||||
|
||||
export default function CommunityGoalBanner({ layout = 'desktop', className = '', dismissable = true }) {
|
||||
export default function GlobalObjectiveBanner({ layout = 'desktop', className = '', dismissable = true }) {
|
||||
const { session } = useSession();
|
||||
const goalText = session?.communityGoal?.text ? String(session.communityGoal.text).trim() : '';
|
||||
const goalText = session?.globalObjective?.text ? String(session.globalObjective.text).trim() : '';
|
||||
const isMobile = layout === 'mobile-portrait' || layout === 'mobile-landscape' || layout === 'mobile';
|
||||
const [visible, setVisible] = useState(false);
|
||||
const [fontSize, setFontSize] = useState(MAX_FONT_PX);
|
||||
@@ -97,8 +97,8 @@ export default function CommunityGoalBanner({ layout = 'desktop', className = ''
|
||||
>
|
||||
<span className="flex w-full items-stretch gap-0.5 whitespace-nowrap rounded-md">
|
||||
<span className="flex flex-col justify-center border-r border-slate-700/60 px-0.5 text-[0.55em] font-semibold leading-tight text-slate-400">
|
||||
<span>Community</span>
|
||||
<span>Goal</span>
|
||||
<span>Global</span>
|
||||
<span>Objective</span>
|
||||
</span>
|
||||
<span ref={textContainerRef} className="flex-1 overflow-hidden text-slate-100">
|
||||
<span ref={textRef} className="block">
|
||||
@@ -181,7 +181,7 @@ export function SessionProvider({ children }) {
|
||||
}
|
||||
return emitWithAck('replay:trigger', { sources: sourcesOrPayload, title });
|
||||
},
|
||||
setCommunityGoal: (text) => emitWithAck('communityGoal:set', { text }),
|
||||
setGlobalObjective: (text) => emitWithAck('globalObjective:set', { text }),
|
||||
setAdminReason: (text) => emitWithAck('adminReason:set', { text }),
|
||||
rebootRover: (roverId) =>
|
||||
emitWithAck('command', { roverId, type: 'reboot', data: { reboot: {} } }),
|
||||
|
||||
@@ -9,7 +9,7 @@ import { useSpectatorMode } from '../../hooks/useSpectatorMode.js';
|
||||
import useDefaultNickname from '../../hooks/useDefaultNickname.js';
|
||||
import ChatPanel from '../../components/ChatPanel/index.jsx';
|
||||
import AlertFeed from '../../components/AlertFeed/index.jsx';
|
||||
import CommunityGoalBanner from '../../components/CommunityGoalBanner/index.jsx';
|
||||
import GlobalObjectiveBanner from '../../components/GlobalObjectiveBanner/index.jsx';
|
||||
import RoverQueuesPanel from '../../components/RoverQueuesPanel/index.jsx';
|
||||
import RawUserPilePanel from '../../components/RawUserPilePanel/index.jsx';
|
||||
import ButtonBoxPanel from '../../components/ButtonBoxPanel/index.jsx';
|
||||
@@ -75,7 +75,7 @@ export default function SpectatorContent() {
|
||||
<section className={sidebarClass}>
|
||||
{isPortraitLayout ? (
|
||||
<div className={`${topBarItemClass} ${portraitItemHeight} flex flex-col gap-0.5`}>
|
||||
<CommunityGoalBanner layout="desktop" dismissable={false} className="text-sm" />
|
||||
<GlobalObjectiveBanner layout="desktop" dismissable={false} className="text-sm" />
|
||||
<ButtonBoxPanel />
|
||||
<div className="min-h-0 flex-1">
|
||||
<RawUserPilePanel hideNicknameForm hideHeader compact fillHeight className="h-full" />
|
||||
@@ -83,7 +83,7 @@ export default function SpectatorContent() {
|
||||
</div>
|
||||
) : (
|
||||
<div className={topBarItemClass}>
|
||||
<CommunityGoalBanner layout="desktop" dismissable={false} className="text-sm" />
|
||||
<GlobalObjectiveBanner layout="desktop" dismissable={false} className="text-sm" />
|
||||
<ButtonBoxPanel />
|
||||
</div>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user