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">
|
||||
|
||||
@@ -161,12 +161,17 @@ html[data-mobile-composer-route-transition="true"]::view-transition-old(t3-mobil
|
||||
@theme inline {
|
||||
/* Two steps below Tailwind's text-xs (12px) for dense UI: metadata rows,
|
||||
badges, counters, keyboard hints and diagnostics tables. 2xs is 11px,
|
||||
3xs is 10px and the floor of the scale. Registered with tailwind-merge in
|
||||
3xs is 10px. Provider icon overlays use 4xs (8px) and 5xs (7px) to fit
|
||||
their smaller badges. Registered with tailwind-merge in
|
||||
lib/utils.ts so cn() treats them as font sizes, not colours. */
|
||||
--text-2xs: 0.6875rem;
|
||||
--text-2xs--line-height: calc(1 / 0.6875);
|
||||
--text-3xs: 0.625rem;
|
||||
--text-3xs--line-height: calc(0.875 / 0.625);
|
||||
--text-4xs: 0.5rem;
|
||||
--text-4xs--line-height: 1;
|
||||
--text-5xs: 0.4375rem;
|
||||
--text-5xs--line-height: 1;
|
||||
/* Motion. drawer is the decelerating curve for surfaces that slide or pop in
|
||||
(composer context, pills). */
|
||||
--ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
|
||||
|
||||
@@ -6,7 +6,7 @@ import { DraftId } from "../composerDraftStore";
|
||||
|
||||
// The theme's extra font sizes (index.css). Unregistered, tailwind-merge reads
|
||||
// text-2xs as a colour and drops it next to text-muted-foreground.
|
||||
const twMerge = extendTailwindMerge({ extend: { theme: { text: ["2xs", "3xs"] } } });
|
||||
const twMerge = extendTailwindMerge({ extend: { theme: { text: ["2xs", "3xs", "4xs", "5xs"] } } });
|
||||
|
||||
export function cn(...inputs: CxOptions) {
|
||||
return twMerge(cx(inputs));
|
||||
|
||||
Reference in new issue
Block a user