Skip to content

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

fix(sidebar): the model's mark sits on the mascot again, clear of the hover actions (#3809)

Azad Jagtap35c261e15059
diff --git a/src/components/BotModelBadge.test.ts b/src/components/BotModelBadge.test.ts
index f1874feba4..b5841cd1e2 100644
--- a/src/components/BotModelBadge.test.ts
+++ b/src/components/BotModelBadge.test.ts
@@ -17,7 +17,7 @@ vi.mock("@/state/store", async (importOriginal) => {
return { ...original, useStore: () => ({ state: { ...original.initialState, ...fixture.state }, dispatch: vi.fn() }) };
});
-import { BotModelBadge, BotModelMark, botModel } from "./BotModelBadge";
+import { BotModelBadge, botModel } from "./BotModelBadge";
import { BotListItem, botRowProps, type BotRowProps } from "./Sidebar";
const claude = {
@@ -61,19 +61,6 @@ describe("BotModelBadge", () => {
});
});
-describe("BotModelMark", () => {
- it("draws the engine mark, names only the model on hover and the engine too for screen readers", () => {
- const markup = renderToStaticMarkup(createElement(BotModelMark, { bot: bot("claude", "opus"), instances: [claude] }));
- expect(markup).toContain('aria-label="Model: Opus 4.1 (Claude)"');
- expect(markup).toContain('title="Opus 4.1"');
- expect(markup).toContain("<svg");
- });
-
- it("draws nothing for an engine that is not installed", () => {
- expect(renderToStaticMarkup(createElement(BotModelMark, { bot: bot("gone", "opus"), instances: [claude] }))).toBe("");
- });
-});
-
describe("sidebar bot row", () => {
const botRow = (BotListItem as MemoExoticComponent<(props: BotRowProps) => ReactNode>).type;
const render = (candidate: Bot, density: SidebarDensity) => renderToStaticMarkup(createElement(botRow,
@@ -89,9 +76,9 @@ describe("sidebar bot row", () => {
});
afterEach(() => { vi.unstubAllGlobals(); });
- // Comfortable and compact put the mark at the end of the row's text, clear of the avatar's status dots;
- // icons-only has no row text, so the badge stays on the avatar.
- it.each<[SidebarDensity, string]>([["comfortable", "ml-auto"], ["compact", "ml-auto"], ["icons", "absolute -bottom-0.5 -left-0.5"]])(
+ // Every density puts the badge on the avatar's bottom-left: the status dots own the bottom-right, and a mark at the
+ // row's end sat under the hover actions (+, new folder, …) without lining up with them.
+ it.each<[SidebarDensity, string]>([["comfortable", "absolute -bottom-0.5 -left-0.5"], ["compact", "absolute -bottom-0.5 -left-0.5"], ["icons", "absolute -bottom-0.5 -left-0.5"]])(
"shows the model once in a %s row", (density, placement) => {
const found = badges(render(bot("claude", "opus"), density));
expect(found).toHaveLength(1);
diff --git a/src/components/BotModelBadge.tsx b/src/components/BotModelBadge.tsx
index 86c50a87ff..5ec21101a8 100644
--- a/src/components/BotModelBadge.tsx
+++ b/src/components/BotModelBadge.tsx
@@ -50,16 +50,3 @@ export function BotEngineMark({ bot, instances, className }: { bot: Pick<Bot, "m
</span>
);
}
-
-/** The engine's mark at the right end of a sidebar row's text; hovering it names the model. */
-export function BotModelMark({ bot, instances }: { bot: Pick<Bot, "modelSelection">; instances: InstanceInfo[] }) {
- const model = botModel(bot, instances);
- if (!model) return null;
- const description = t("sidebar.bot.modelBadge", { model: model.label, engine: model.instance.displayName });
- return (
- <span data-testid="model-badge" role="img" aria-label={description} title={model.label}
- className="ml-auto flex shrink-0 items-center self-center text-ink-secondary">
- <InstanceProviderMark instance={model.instance} size={14} subtle />
- </span>
- );
-}
diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx
index a257eab960..035ad2d131 100644
--- a/src/components/Sidebar.tsx
+++ b/src/components/Sidebar.tsx
@@ -9,7 +9,7 @@ import { SidebarWorkingStep } from "./SidebarWorkingStep";
import { llmThreadTitlesEnabled } from "@/lib/feature-flags";
import { BotAvatar } from "./Avatar";
-import { BotEngineMark, BotModelBadge, BotModelMark, botTooltip } from "./BotModelBadge"; import { SidebarBotRole } from "./BotRole";
+import { BotEngineMark, BotModelBadge, botTooltip } from "./BotModelBadge"; import { SidebarBotRole } from "./BotRole";
import { stateForBot } from "@/lib/mascot";
import { cn } from "@/lib/cn";
import { searchMatchesThreads, useSearchDisclosure } from "@/lib/search-disclosure";
@@ -772,7 +772,8 @@ export const BotListItem = memo(function BotListItem(props: BotRowProps) {
motionKey={mascotMotion?.nonce ?? 0}
animated={working || unread || (mascotMotion?.kind ?? "none") !== "none"}
/>
- {iconOnly && <BotModelBadge bot={bot} instances={instances} avatarSize={avatarSize} />}
+ {/* Bottom-left, clear of the status dots on the right and of the row's hover actions. */}
+ {(iconOnly || !simpleList) && <BotModelBadge bot={bot} instances={instances} avatarSize={avatarSize} />}
{simpleRow && <AvatarActivityDot activity={working ? "working" : teammateWait ? "teammate" : queued && !waiting ? "queued" : null} />}
{!simpleRow && working && (
<span
@@ -847,7 +848,6 @@ export const BotListItem = memo(function BotListItem(props: BotRowProps) {
{formatTime(last.at)}
</span>
)}
- {!simpleList && density === "compact" && <BotModelMark bot={bot} instances={instances} />}
{simpleList && density === "compact" && <BotEngineMark bot={bot} instances={instances} className="self-center" />}
{(expanded || (quiet && !statusLine)) && unread && <span className="size-1.5 shrink-0 rounded-full bg-accent" aria-label={t("task.unreadMany")} />}
{!renaming && <span className="flex shrink-0 self-center"><OwnerFace bot={bot} /></span>}
@@ -868,7 +868,6 @@ export const BotListItem = memo(function BotListItem(props: BotRowProps) {
)}
</span>
)}
- {!simpleList && density === "comfortable" && <span className="contents max-md:hidden"><BotModelMark bot={bot} instances={instances} /></span>}
{simpleRow && <BotEngineMark bot={bot} instances={instances} className="ms-auto" />}
{!simpleRow && unread && <span className="size-2 shrink-0 rounded-full bg-accent" aria-label={t("task.unreadMany")} />}
</div>}