Skip to content

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

UI polish round 8: one text edge in the bot panel, centred Settings controls

aivsomkar4d89abbe7b7a
diff --git a/src/components/RichTable.tsx b/src/components/RichTable.tsx
index 57e4fa06d0..638fed842f 100644
--- a/src/components/RichTable.tsx
+++ b/src/components/RichTable.tsx
@@ -183,6 +183,7 @@ function TableViewport({ columns, rows, order, name, wrap, large, sort, onSort,
const sortLabel = (column: TableColumn, index: number) => t("table.sort", { column: column.text || index + 1 });
const header = (column: TableColumn, index: number) => column.content ?? (column.text || t("table.column", { number: index + 1 }));
const arrow = (index: number, className?: string) => sort?.column === index && sort.descending ? <ArrowDown size={12} className={className} /> : <ArrowUp size={12} className={cn(className, sort?.column !== index && !card && "opacity-35")} />;
+ const cardArrow = (index: number) => arrow(index, cn("shrink-0 text-ink-tertiary transition-opacity", sort?.column === index ? "opacity-100" : "opacity-0 group-hover/th:opacity-100 group-focus-within/th:opacity-100 touch:opacity-100"));
return <div ref={scroll} tabIndex={0} role="region" aria-label={name}
className={cn("overflow-auto overscroll-x-contain focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent/60", card && !fit && "[mask-image:linear-gradient(90deg,#000_calc(100%-40px),transparent)]")}
style={{ maxHeight: large ? "65dvh" : virtual || !wrap ? 400 : undefined }} data-fit={fit || undefined}>
@@ -193,9 +194,10 @@ function TableViewport({ columns, rows, order, name, wrap, large, sort, onSort,
className={card ? "px-4 py-2.5 align-bottom font-semibold" : "h-10 border-b border-hairline/60 px-3 py-2 font-medium"} style={{ textAlign: alignment(column, index) }}>
<div className="break-words [overflow-wrap:anywhere]" style={fit ? { minWidth: minimums[index] } : undefined}>
{card ? (
- <button type="button" className={cn("group/th inline-flex max-w-full items-center gap-1 text-start font-semibold [text-align:inherit] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/60", alignment(column, index) === "right" && "flex-row-reverse")} aria-label={sortLabel(column, index)} title={sortLabel(column, index)} onClick={() => onSort(index)}>
+ <button type="button" className="group/th inline-flex max-w-full items-center gap-1 align-top text-start font-semibold [text-align:inherit] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/60" aria-label={sortLabel(column, index)} title={sortLabel(column, index)} onClick={() => onSort(index)}>
+ {alignment(column, index) === "right" && cardArrow(index)}
<span dir="auto">{header(column, index)}</span>
- {arrow(index, cn("shrink-0 text-ink-tertiary transition-opacity", sort?.column === index ? "opacity-100" : "opacity-0 group-hover/th:opacity-100 group-focus-within/th:opacity-100 touch:opacity-100"))}
+ {alignment(column, index) !== "right" && cardArrow(index)}
</button>
) : <>
<span dir="auto">{header(column, index)}</span>
diff --git a/src/components/SettingsModal.tsx b/src/components/SettingsModal.tsx
index 2d9245205e..1cb238b157 100644
--- a/src/components/SettingsModal.tsx
+++ b/src/components/SettingsModal.tsx
@@ -1,5 +1,5 @@
import { useEffect, useRef, useState } from "react";
-import { Archive, ChartNoAxesColumn, Cloud, CloudDownload, Coins, Download, FlaskConical, KeyRound, LockKeyhole, Monitor, Palette, ScrollText, Search, Settings, Sparkles, TabletSmartphone, Terminal, User, Users, X, Building2, Zap, BookOpen, ImagePlus } from "lucide-react";
+import { Archive, Cloud, Gauge, CloudDownload, Coins, Download, FlaskConical, KeyRound, LockKeyhole, Monitor, Palette, ScrollText, Search, Settings, Sparkles, TabletSmartphone, Terminal, User, Users, X, Building2, Zap, BookOpen, ImagePlus } from "lucide-react";
import { useStore, type AppSettingsSection } from "@/state/store";
import { skillsLibraryEnabled } from "@/lib/feature-flags";
import { type LocaleKey } from "@/locales";
@@ -125,7 +125,7 @@ export const SIMPLE_PAGES: SimpleSettingsPage[] = [
{ id: "botAccess", labelKey: "settings.section.botAccess", icon: Users, sections: ["botAccess"] },
{ id: "ai", labelKey: "settings.group.ai", icon: Sparkles, sections: ["engines", "connections"] },
{ id: "computer", labelKey: "settings.simple.page.computer", icon: Monitor, sections: ["companion", "desktopWorkspaces", "computer", "logins"] },
- { id: "billing", labelKey: "settings.simple.page.billing", icon: ChartNoAxesColumn, sections: ["usage", "cloudAccount"], keywords: ["billing", "included", "allowance", "cloud hours", "voice"] },
+ { id: "billing", labelKey: "settings.simple.page.billing", icon: Gauge, sections: ["usage", "cloudAccount"], keywords: ["billing", "included", "allowance", "cloud hours", "voice"] },
{ id: "updates", labelKey: "settings.simple.page.updates", icon: CloudDownload, sections: ["updates"],
keywords: ["update", "version", "release", "product updates", "newsletter", "email updates", "welcome", "tour", "diagnostics", "logs", "support"] },
];
diff --git a/src/components/SettingsPrimitives.tsx b/src/components/SettingsPrimitives.tsx
index 43f7f080c9..13aacf5f7c 100644
--- a/src/components/SettingsPrimitives.tsx
+++ b/src/components/SettingsPrimitives.tsx
@@ -79,7 +79,7 @@ export function SettingRow({
<div id={titleId} className="text-[14px] font-medium text-ink in-data-[settings-look=simple]:font-normal in-data-[settings-look=simple]:leading-5">{title}</div>
{subtitle && <div className="mt-1 text-[12px] leading-relaxed text-pretty text-ink-secondary in-data-[settings-look=simple]:mt-0 in-data-[settings-look=simple]:text-[13px] in-data-[settings-look=simple]:leading-[18px]">{subtitle}</div>}
</div>
- <div className="min-w-0 sm:max-w-[240px] in-data-[settings-look=simple]:ml-auto in-data-[settings-look=simple]:shrink-0 in-data-[settings-look=simple]:sm:max-w-none">{children}</div>
+ <div className="min-w-0 sm:max-w-[240px] in-data-[settings-look=simple]:ml-auto in-data-[settings-look=simple]:flex in-data-[settings-look=simple]:shrink-0 in-data-[settings-look=simple]:items-center in-data-[settings-look=simple]:sm:max-w-none">{children}</div>
</div>
{message && <div className="mt-2 text-[12px]">{message}</div>}
</div>
diff --git a/src/components/SettingsSimplePages.tsx b/src/components/SettingsSimplePages.tsx
index 54e192497d..36ce981828 100644
--- a/src/components/SettingsSimplePages.tsx
+++ b/src/components/SettingsSimplePages.tsx
@@ -25,6 +25,8 @@ import { SettingRow, SettingsDisclosureRow, SettingsGroup, SettingsRows } from "
import { UsageSection } from "./UsageSection";
import { PlanUsageSummary } from "./PlanUsage";
import { SkinPicker } from "./SkinPicker";
+import { useSkinChoice } from "./ThemeRow";
+import { resolveSkin, SKINS } from "@/lib/skins";
import { PlaceLookRows } from "./PlaceLookCard";
import { ChromeRailRow } from "./ChromeRailToggle";
import { WindowFrameRow } from "./WindowFrameRow";
@@ -68,9 +70,7 @@ export function SimpleGeneralPage({ has, peopleOpen, onLooks }: { has: Has; peop
<ChromeRailRow />
<WindowFrameRow />
<ColorUserBubblesRow simple />
- <SettingRow title={t("settings.simple.looks.title")}>
- <button type="button" className="ui-button" onClick={onLooks}>{t("settings.simple.looks.change")}</button>
- </SettingRow>
+ <LooksRow onLooks={onLooks} />
</SettingsRows>
</SettingsGroup>
)}
@@ -109,6 +109,16 @@ export function SimpleGeneralPage({ has, peopleOpen, onLooks }: { has: Has; peop
);
}
+function LooksRow({ onLooks }: { onLooks: () => void }) {
+ const current = SKINS.find((skin) => skin.id === resolveSkin(useSkinChoice()))?.name;
+ return (
+ <SettingRow title={t("settings.simple.looks.title")}>
+ {current && <span data-looks-current className="me-3 text-[13px] text-ink-tertiary">{current}</span>}
+ <button type="button" className="ui-button" onClick={onLooks}>{t("settings.simple.looks.change")}</button>
+ </SettingRow>
+ );
+}
+
export function SimpleLooksPage({ onBack }: { onBack: () => void }) {
return (
<>
diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx
index d1824278f8..fe543bda1a 100644
--- a/src/components/Sidebar.tsx
+++ b/src/components/Sidebar.tsx
@@ -1,7 +1,7 @@
import { OrganizationIdentity } from "./OrganizationIdentity";
import { memo, useCallback, useEffect, useMemo, useRef, useState, type CSSProperties, type Dispatch } from "react";
import { createPortal } from "react-dom";
-import { Archive, Bot as BotIcon, Check, ChevronRight, ClipboardCopy, Crown, FolderPlus, Library, Loader2, MessageSquarePlus, MoreHorizontal, Pencil, Phone, Pin, Plus, Search, TextQuote, Trash2, Users, X } from "lucide-react";
+import { Archive, Bot as BotIcon, Check, ChevronRight, ClipboardCopy, Crown, FolderPlus, LayoutTemplate, Loader2, MessageSquarePlus, MoreHorizontal, Pencil, Phone, Pin, Plus, Search, TextQuote, Trash2, Users, X } from "lucide-react";
import { api, useStore, formatTime, visibleMessages, currentTaskBot, botOpensTo, openBot, openThread, type Action, type AppState, type Bot, type BotProject, type Group, type InstanceInfo, type Message } from "@/state/store";
import { approvalModeFor } from "../../shared/approval-mode";
import { liveActivityLabel, sidebarMessage } from "@/lib/live-activity";
@@ -1210,7 +1210,7 @@ export function Sidebar({ open, onClose, collapseToIcons = false }: {
role="menuitem"
className={plusItem}
>
- <Library size={16} className="text-ink-secondary" />
+ <LayoutTemplate size={16} className="text-ink-secondary" />
{t("sidebar.teamLibrary")}
</button>}
{advanced && archivedBots.length > 0 && (
diff --git a/src/components/SidebarThreadRow.tsx b/src/components/SidebarThreadRow.tsx
index a88998c30d..04ad73ef3a 100644
--- a/src/components/SidebarThreadRow.tsx
+++ b/src/components/SidebarThreadRow.tsx
@@ -323,7 +323,7 @@ export const SidebarThreadRow = memo(function SidebarThreadRow({ task, ownerId,
{...(selectMode ? { role: "checkbox", "aria-checked": checked, "aria-disabled": !tickable, "aria-label": t("task.bulk.rowCheck", { title: displayTitle }) } : {})}
onClick={choose} onDoubleClick={selectMode ? undefined : startRename} onContextMenu={contextMenu}
onKeyDown={(event) => { if (opensRowMenuFromKey(event.key, event.shiftKey, selectMode)) { event.preventDefault(); const rect = event.currentTarget.getBoundingClientRect(); openMenu(rect.left, rect.bottom); } }}
- className={cn("flex min-w-0 flex-1 items-center gap-2 rounded-md pl-6 pr-1 text-left text-[13px] font-medium outline-none focus-visible:ring-1 focus-visible:ring-accent/60", "min-h-8 py-1.5", current ? "font-semibold text-ink" : "text-ink-secondary hover:text-ink", panel && "rounded-[8px] py-2 pl-3 text-[14px]", selectMode && "pl-1.5", selectMode && !tickable && "cursor-not-allowed opacity-60")}>
+ className={cn("flex min-w-0 flex-1 items-center gap-2 rounded-md pl-6 pr-1 text-left text-[13px] font-medium outline-none focus-visible:ring-1 focus-visible:ring-accent/60", "min-h-8 py-1.5", current ? "font-semibold text-ink" : "text-ink-secondary hover:text-ink", panel && "rounded-[8px] py-2 pl-3.5 text-[14px]", selectMode && "pl-1.5", selectMode && !tickable && "cursor-not-allowed opacity-60")}>
{selectMode && <span aria-hidden="true" title={tickable ? undefined : t("task.bulk.running")}
className={cn("flex size-3.5 shrink-0 items-center justify-center rounded-[3px] border", checked ? "border-accent bg-accent text-white" : "border-ink-tertiary", !tickable && "opacity-50")}>
{checked && <Check size={10} strokeWidth={3} />}
diff --git a/src/components/bot-panel/DetailsTab.tsx b/src/components/bot-panel/DetailsTab.tsx
index b43ff75099..8cf7d784ef 100644
--- a/src/components/bot-panel/DetailsTab.tsx
+++ b/src/components/bot-panel/DetailsTab.tsx
@@ -29,7 +29,7 @@ export function ItemRow({ item }: { item: SidebarMenuItem }) {
onClick={item.onSelect}
className={cn(rowCls, "w-full text-left enabled:hover:bg-ink/[0.03] disabled:cursor-default disabled:opacity-45")}
>
- <span className="flex size-7 shrink-0 items-center justify-center rounded-lg bg-ink/[0.05] text-ink-secondary [&_svg]:size-[15px]" aria-hidden="true">
+ <span className="flex size-4 shrink-0 items-center justify-center text-ink-secondary [&_svg]:size-4" aria-hidden="true">
{item.icon}
</span>
<span className={cn("min-w-0 truncate text-[14px] font-medium", !wrapsValue && "flex-1", item.active ? "text-accent-text" : "text-ink")}>{item.label}</span>
@@ -67,7 +67,7 @@ export function DetailsTab({ bot, derived, onOpen }: {
{derived.botRoutines.length === 0 ? (
<section data-panel-empty="routines">
<CardLabel>{t("botSettings.simple.routines")}</CardLabel>
- <p className="mx-1 text-[13px] leading-[18px] text-ink-tertiary">
+ <p className="mx-3.5 text-[13px] leading-[18px] text-ink-tertiary">
{t("botPanel.routines.emptyHint")}{" "}
<button type="button" data-panel-automations onClick={() => dispatch({ type: "showRoutines", view: "list" })}
className="rounded-[4px] font-medium text-ink-secondary underline decoration-ink/25 underline-offset-2 hover:text-ink hover:decoration-ink/60">
diff --git a/src/components/bot-panel/rows.tsx b/src/components/bot-panel/rows.tsx
index 158cc1ccb0..9e001ed956 100644
--- a/src/components/bot-panel/rows.tsx
+++ b/src/components/bot-panel/rows.tsx
@@ -14,7 +14,7 @@ const hintCls = "mt-px text-[13px] leading-[1.35] text-ink-secondary";
export const buttonCls =
"inline-flex h-8 shrink-0 items-center justify-center gap-1.5 rounded-[8px] bg-control px-3.5 text-[13px] font-medium text-ink hover:bg-raised-hover disabled:cursor-not-allowed disabled:opacity-50";
/** The panel's one action row: New conversation, Add a routine. */
-export const panelActionCls = "flex h-9 min-w-0 items-center gap-2.5 rounded-full bg-ink/[0.05] px-3.5 text-[14px] font-medium text-ink transition-colors hover:bg-ink/[0.09]";
+export const panelActionCls = "flex h-9 min-w-0 items-center gap-2.5 rounded-full [&>svg]:size-4 bg-ink/[0.05] px-3.5 text-[14px] font-medium text-ink transition-colors hover:bg-ink/[0.09]";
export const chipCls = (on: boolean) =>
cn(
"rounded-full px-2.5 py-1 text-[12px] transition-colors disabled:cursor-not-allowed disabled:opacity-50",
@@ -23,7 +23,7 @@ export const chipCls = (on: boolean) =>
export function CardLabel({ children, action }: { children: ReactNode; action?: ReactNode }) {
return (
- <div className="mx-1 mb-2 mt-5 flex min-h-5 items-center justify-between gap-3 text-[13px] font-semibold text-ink-secondary">
+ <div className="mx-3.5 mb-2 mt-5 flex min-h-5 items-center justify-between gap-3 text-[13px] font-semibold text-ink-secondary">
<span className="min-w-0 truncate">{children}</span>
{action}
</div>
@@ -67,8 +67,8 @@ export function RowText({ title, hint }: { title: ReactNode; hint?: ReactNode })
export function RowIcon({ icon: Icon }: { icon: LucideIcon }) {
return (
- <span className="flex size-7 shrink-0 items-center justify-center rounded-lg bg-ink/[0.05] text-ink-secondary max-md:size-8 max-md:rounded-full" aria-hidden="true">
- <Icon size={15} />
+ <span className="flex size-4 shrink-0 items-center justify-center text-ink-secondary max-md:size-8 max-md:rounded-full max-md:bg-ink/[0.05]" aria-hidden="true">
+ <Icon size={16} />
</span>
);
}
diff --git a/src/components/inbox/InboxPanel.tsx b/src/components/inbox/InboxPanel.tsx
index 39e55188f3..1bad6cd6dd 100644
--- a/src/components/inbox/InboxPanel.tsx
+++ b/src/components/inbox/InboxPanel.tsx
@@ -83,11 +83,11 @@ export function InboxPanel() {
) : (
<>
<div className="min-h-0 flex-1 overflow-y-auto">
- <label className="mx-[13px] my-2.5 flex h-8 items-center gap-2 rounded-lg bg-ink/[0.045] px-2.5 ring-[0.5px] ring-ink/[0.12] focus-within:ring-ink/30">
+ {listedRows(view).length > 0 && <label className="mx-[13px] my-2.5 flex h-8 items-center gap-2 rounded-lg bg-ink/[0.045] px-2.5 ring-[0.5px] ring-ink/[0.12] focus-within:ring-ink/30">
<Search size={14} aria-hidden="true" className="shrink-0 text-ink-tertiary" />
<input type="search" value={query} onChange={(event) => setQuery(event.target.value)} placeholder={t("inbox.search")} aria-label={t("inbox.search")}
className="min-w-0 flex-1 bg-transparent text-[13px] text-ink outline-none placeholder:text-ink-tertiary [&::-webkit-search-cancel-button]:hidden" />
- </label>
+ </label>}
<div role="list" data-inbox-list aria-label={t("inbox.panel.title")} className="space-y-0.5 px-1.5 pb-1.5">
{rows.length === 0
? query.trim() && listedRows(view).length