fix(web): restore compact provider instance badges (#13700)
Co-authored-by: Julius Marminge <[email protected]>
This commit is contained in:
1 parent
2598ce7a5a
commit
ed809f7ad2
8 files changed
+12
-10
No files matched your search
@@ -1965,7 +1965,7 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: {
|
||||
showBadge={showInstanceBadge}
|
||||
// Glyph dims, badge stays saturated; offset matches the composer trigger.
|
||||
iconClassName="size-3.5 opacity-60"
|
||||
badgeClassName="right-[-0.1875rem] bottom-[-0.1875rem] h-3 min-w-3 px-0.5 text-3xs"
|
||||
badgeClassName="right-[-0.1875rem] bottom-[-0.1875rem] h-3 min-w-3 px-0.5 text-5xs"
|
||||
/>
|
||||
</span>
|
||||
) : null}
|
||||
|
||||
@@ -210,7 +210,7 @@ export const ModelPickerSidebar = memo(function ModelPickerSidebar(props: {
|
||||
? "var(--background)"
|
||||
: "color-mix(in oklab, var(--muted) 30%, transparent)"
|
||||
}
|
||||
{...(entry.accentColor ? { badgeClassName: "h-3 min-w-3 px-0.5 text-3xs" } : {})}
|
||||
{...(entry.accentColor ? { badgeClassName: "h-3 min-w-3 px-0.5 text-5xs" } : {})}
|
||||
/>
|
||||
{showNewBadge ? (
|
||||
<span className={NEW_BADGE_CLASS} aria-hidden>
|
||||
|
||||
@@ -55,7 +55,7 @@ export const ProviderInstanceIcon = memo(function ProviderInstanceIcon(props: {
|
||||
{props.showBadge ? (
|
||||
<span
|
||||
className={cn(
|
||||
"pointer-events-none absolute right-0 bottom-0 z-10 flex h-3.5 min-w-3.5 items-center justify-center rounded-full border px-0.5 text-3xs font-semibold leading-none shadow-sm",
|
||||
"pointer-events-none absolute right-0 bottom-0 z-10 flex h-3.5 min-w-3.5 items-center justify-center rounded-full border px-0.5 text-4xs font-semibold leading-none shadow-sm",
|
||||
props.accentColor
|
||||
? "bg-(--provider-accent) text-white"
|
||||
: "bg-card text-muted-foreground",
|
||||
|
||||
@@ -172,8 +172,5 @@ describe("ProviderModelPicker", () => {
|
||||
);
|
||||
|
||||
expect(markup).toContain(">CP</span>");
|
||||
expect(markup).toContain("size-4");
|
||||
expect(markup).toContain("h-3");
|
||||
expect(markup).toContain("text-3xs");
|
||||
});
|
||||
});
|
||||
@@ -250,7 +250,7 @@ export const ProviderModelPicker = memo(function ProviderModelPicker(props: {
|
||||
iconClassName={cn("size-4", props.activeProviderIconClassName)}
|
||||
indicatorBackground={props.instanceIndicatorBackground ?? "var(--contrast-input)"}
|
||||
badgeClassName={cn(
|
||||
"right-[-0.125rem] bottom-[-0.125rem] h-3 min-w-3 px-0.5 text-3xs",
|
||||
"right-[-0.125rem] bottom-[-0.125rem] h-3 min-w-3 px-0.5 text-5xs",
|
||||
size === "xs" && "shadow-none",
|
||||
)}
|
||||
/>
|
||||
|
||||
@@ -570,7 +570,7 @@ export function ProviderInstanceCard({
|
||||
showBadge={Boolean(accentColor)}
|
||||
className="size-5"
|
||||
iconClassName="size-4 text-foreground/80"
|
||||
badgeClassName="right-[-0.125rem] bottom-[-0.125rem] h-3 min-w-3 px-0.5 text-3xs"
|
||||
badgeClassName="right-[-0.125rem] bottom-[-0.125rem] h-3 min-w-3 px-0.5 text-5xs"
|
||||
/>
|
||||
) : FallbackIconComponent ? (
|
||||
<span className="inline-flex size-5 shrink-0 items-center justify-center">
|
||||
|
||||
Reference in new issue
Block a user