Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

Match chat activity switch rows to the header pill

Locksley Lennoxe6d2dab20fc2
diff --git a/src/components/ChatView.tsx b/src/components/ChatView.tsx
index cdbf7c3a38..673bd8cff9 100644
--- a/src/components/ChatView.tsx
+++ b/src/components/ChatView.tsx
@@ -1034,13 +1034,13 @@ export const ChatView = memo(function ChatView({ bot: profile, inForkPanel = fal
><List size={14} aria-hidden="true" />{t("chat.automation.activity")}</button>
{automationLogsOpen && (
<section className="chat-run-log-actions flex min-w-0 flex-wrap items-center gap-1.5">
- <label className="flex items-center gap-2 rounded-full px-2 py-1 text-xs text-ink-secondary">
+ <label className="ui-pill shrink-0">
{t("chat.automation.showInChat")}
- <Switch aria-label={t("chat.automation.showInChat")} checked={showAutomationInChat} onClick={toggleAutomationInChat} />
+ <Switch compact aria-label={t("chat.automation.showInChat")} checked={showAutomationInChat} onClick={toggleAutomationInChat} />
</label>
- <label className="flex items-center gap-2 rounded-full px-2 py-1 text-xs text-ink-secondary">
+ <label className="ui-pill shrink-0">
{t("chat.automation.showTools")}
- <Switch aria-label={t("chat.automation.showTools")} checked={showToolsInChat} onClick={toggleToolsInChat} />
+ <Switch compact aria-label={t("chat.automation.showTools")} checked={showToolsInChat} onClick={toggleToolsInChat} />
</label>
<button type="button" className="ui-pill" onClick={() => dispatch({ type: "showRoutines", section: "logs", botId: bot.id })}>
{t("chat.automation.openLogs")}
diff --git a/src/components/SettingsPrimitives.tsx b/src/components/SettingsPrimitives.tsx
index 8a09ccd8af..345f3829fb 100644
--- a/src/components/SettingsPrimitives.tsx
+++ b/src/components/SettingsPrimitives.tsx
@@ -15,9 +15,10 @@ export const SIMPLE_CARD = "settings-card relative rounded-[12px] bg-menu after:
export function Switch({
checked,
+ compact = false,
className,
...props
-}: Omit<ComponentProps<"button">, "children" | "role" | "aria-checked"> & { checked: boolean }) {
+}: Omit<ComponentProps<"button">, "children" | "role" | "aria-checked"> & { checked: boolean; compact?: boolean }) {
return (
<button
{...props}
@@ -26,15 +27,17 @@ export function Switch({
aria-checked={checked}
data-switch="" data-look="switch"
className={cn(
- "relative cursor-pointer h-6 w-11 shrink-0 rounded-full transition-colors enabled:hover:brightness-110 disabled:cursor-not-allowed disabled:opacity-40 motion-reduce:transition-none",
+ "relative cursor-pointer shrink-0 rounded-full transition-colors enabled:hover:brightness-110 disabled:cursor-not-allowed disabled:opacity-40 motion-reduce:transition-none",
+ compact ? "h-4 w-7" : "h-6 w-11",
checked ? "bg-accent" : "bg-control",
className,
)}
>
<span
className={cn(
- "absolute top-[3px] h-[18px] w-[18px] rounded-full bg-white transition-[left] motion-reduce:transition-none",
- checked ? "left-[21px]" : "left-[3px]",
+ "absolute rounded-full bg-white transition-[left] motion-reduce:transition-none",
+ compact ? "top-0.5 size-3" : "top-[3px] size-[18px]",
+ checked ? (compact ? "left-3.5" : "left-[21px]") : (compact ? "left-0.5" : "left-[3px]"),
)}
/>
</button>