mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 01:21:20 -04:00
overseer vote panel improvements
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -11,8 +11,8 @@
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
||||
<meta name="apple-mobile-web-app-title" content="Roomba Rover" />
|
||||
<title>Roomba Rover</title>
|
||||
<script type="module" crossorigin src="/assets/index-jP8aZ7aV.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-Dd7xX8GI.css">
|
||||
<script type="module" crossorigin src="/assets/index-NtRpxuXC.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-v8lmO81Z.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
@@ -6,7 +6,7 @@ export default function OverseerPreferencePanel() {
|
||||
const vote = useSessionSelector((state) => state.session?.overseerVote || null);
|
||||
const { value: profile } = useSettingsNamespace('profile', { nickname: '' });
|
||||
const { value: identity } = useSettingsNamespace('identity', { cookieUserId: '' });
|
||||
const { value, save } = useSettingsNamespace('overseerPreference', { enabled: true });
|
||||
const { value, save } = useSettingsNamespace('overseerPreference', { enabled: false });
|
||||
const enabled = Boolean(value?.enabled);
|
||||
const running = Boolean(vote?.running);
|
||||
|
||||
@@ -22,22 +22,27 @@ export default function OverseerPreferencePanel() {
|
||||
|
||||
return (
|
||||
<section className="surface p-1 text-xs text-slate-200 text-center">
|
||||
<label className="flex items-center justify-center gap-1.5 bg-gray-700 surface">
|
||||
<div className="text-[0.65rem] text-slate-400">Overseer vote</div>
|
||||
<label
|
||||
className={`flex items-center justify-center gap-1.5 rounded px-1 py-0.5 ${
|
||||
enabled ? 'bg-emerald-600/80 text-emerald-50' : 'bg-slate-600/70 text-slate-100'
|
||||
}`}
|
||||
>
|
||||
<input type="checkbox" checked={enabled} onChange={onToggle} />
|
||||
<span>Enable Overseer LLM</span>
|
||||
<span>Your vote: {enabled ? 'yes' : 'no'}</span>
|
||||
</label>
|
||||
<span className='text-xs'>Cast your vote to enable Overseer in chat.</span>
|
||||
<span className="text-xs">(A local LLM in chat)</span>
|
||||
|
||||
<div className="mt-0.5 text-slate-400">
|
||||
{/* <div className="mt-0.5 text-slate-400">
|
||||
Yes!: {Number(vote?.yesCount || 0)}, No...: {Number(vote?.noCount || 0)}
|
||||
</div>
|
||||
</div> */}
|
||||
<div className="mt-0.5 flex justify-center">
|
||||
<span
|
||||
className={`inline-flex items-center rounded px-1.5 py-0.5 text-[0.7rem] font-medium ${
|
||||
running ? 'bg-emerald-600/80 text-emerald-50' : 'bg-slate-600/70 text-slate-100'
|
||||
}`}
|
||||
>
|
||||
{running ? 'Running!' : 'Stopped...'}
|
||||
{running ? 'Running!' : 'Stopped by vote.'}
|
||||
</span>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -15,7 +15,7 @@ export default function useUserIdentitySync() {
|
||||
const { value: profile, status: profileStatus } = useSettingsNamespace('profile', { nickname: '' });
|
||||
const { value: overseerPreference, status: overseerPreferenceStatus } = useSettingsNamespace(
|
||||
'overseerPreference',
|
||||
{ enabled: true },
|
||||
{ enabled: false },
|
||||
);
|
||||
|
||||
const inFlightRef = useRef(false);
|
||||
|
||||
Reference in New Issue
Block a user