Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
Studio: rounded browser tabs and hovers, Recents above Suggested once visited (#15649)
Michael Hanc4d2ae26449b
diff --git a/studio/frontend/src/features/browser/browser-panel.tsx b/studio/frontend/src/features/browser/browser-panel.tsxindex c13f3c7d1dd..6c02b9534cd 100644--- a/studio/frontend/src/features/browser/browser-panel.tsx+++ b/studio/frontend/src/features/browser/browser-panel.tsx@@ -234,11 +234,11 @@ const TOOLBAR_BUTTON =/** IconButton's own look, for toolbar buttons rendered elsewhere (DownloadsButton). */const TOOLBAR_ICON_BUTTON =- "flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-[color-mix(in_oklab,var(--foreground)_calc(6%*var(--contrast-wash-gain,1)),transparent)] hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-default disabled:opacity-35 disabled:hover:bg-transparent disabled:hover:text-muted-foreground";+ "flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-[10px] text-muted-foreground transition-colors hover:bg-[color-mix(in_oklab,var(--foreground)_calc(6%*var(--contrast-wash-gain,1)),transparent)] hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-default disabled:opacity-35 disabled:hover:bg-transparent disabled:hover:text-muted-foreground";const NAV_BUTTON =- "size-8 rounded-full text-foreground disabled:hover:text-foreground disabled:opacity-30";+ "size-8 rounded-[10px] text-foreground disabled:hover:text-foreground disabled:opacity-30";const NAV_ICON = "size-4.5";-const ANNOTATE_BUTTON = "size-8 shrink-0 rounded-full p-0 text-foreground";+const ANNOTATE_BUTTON = "size-8 shrink-0 rounded-[10px] p-0 text-foreground";// Half a pixel right and down: the frame's whole top-left corner and the pointer aimed back at it// read as up and left of centre, though the strokes are centred.const ANNOTATE_GLYPH = "size-4.5 translate-x-[0.5px] translate-y-[0.5px]";@@ -363,7 +363,7 @@ function TabIcon({ tab }: { tab: BrowserTab }) {<HugeiconsIconicon={icon}strokeWidth={1.75}- className="size-4 shrink-0"+ className="mx-px size-3.5 shrink-0"/>);}@@ -684,7 +684,7 @@ function TabStrip({activateTab(tab.id);}}className={cn(- "group/tab relative flex h-[calc(34px*var(--ui-space-scale,1))] min-w-[calc(88px*var(--ui-space-scale,1))] max-w-60 flex-1 basis-0 cursor-pointer touch-none select-none items-center gap-1.5 rounded-full pl-2 pr-1.5 text-ui-13 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",+ "group/tab relative flex h-[calc(34px*var(--ui-space-scale,1))] min-w-[calc(88px*var(--ui-space-scale,1))] max-w-60 flex-1 basis-0 cursor-pointer touch-none select-none items-center gap-1 rounded-[10px] pl-2 pr-1.5 text-ui-13 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",active? "bg-card text-foreground dark:bg-accent": "text-muted-foreground hover:bg-[color-mix(in_oklab,var(--foreground)_calc(6%*var(--contrast-wash-gain,1)),transparent)] hover:text-foreground",@@ -712,7 +712,7 @@ function TabStrip({event.stopPropagation();setTabMuted(tab, false);}}- className="flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground hover:bg-[color-mix(in_oklab,var(--foreground)_calc(10%*var(--contrast-wash-gain,1)),transparent)] hover:text-foreground"+ className="flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-[6px] text-muted-foreground hover:bg-[color-mix(in_oklab,var(--foreground)_calc(10%*var(--contrast-wash-gain,1)),transparent)] hover:text-foreground"><HugeiconsIcon icon={VolumeMute02Icon} strokeWidth={1.75} className="size-3.5" /></button>@@ -725,7 +725,7 @@ function TabStrip({closeTab(tab.id);}}className={cn(- "flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground hover:bg-[color-mix(in_oklab,var(--foreground)_calc(10%*var(--contrast-wash-gain,1)),transparent)] hover:text-foreground",+ "flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-[6px] text-muted-foreground hover:bg-[color-mix(in_oklab,var(--foreground)_calc(10%*var(--contrast-wash-gain,1)),transparent)] hover:text-foreground",!active &&"hidden group-hover/tab:flex group-focus-visible/tab:flex focus-visible:flex",)}@@ -1243,7 +1243,7 @@ function PanelMenu({ tab, children }: { tab: BrowserTab | undefined; children?:ref={triggerRef}type="button"aria-label={t("browser.more")}- className="flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-full text-foreground transition-colors hover:bg-[color-mix(in_oklab,var(--foreground)_calc(6%*var(--contrast-wash-gain,1)),transparent)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring aria-expanded:bg-[color-mix(in_oklab,var(--foreground)_calc(8%*var(--contrast-wash-gain,1)),transparent)]"+ className="flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-[10px] text-foreground transition-colors hover:bg-[color-mix(in_oklab,var(--foreground)_calc(6%*var(--contrast-wash-gain,1)),transparent)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring aria-expanded:bg-[color-mix(in_oklab,var(--foreground)_calc(8%*var(--contrast-wash-gain,1)),transparent)]"><HugeiconsIcon icon={MoreHorizontalIcon} strokeWidth={1.75} className="size-5" /></button>@@ -1673,7 +1673,7 @@ function BrowserFileToolbar({aria-pressed={htmlPreview && view.consoleOpen}onClick={toggleConsole}className={cn(- "flex h-8 min-w-8 shrink-0 cursor-pointer items-center justify-center gap-1 rounded-full px-1.5 text-foreground transition-colors hover:bg-[color-mix(in_oklab,var(--foreground)_calc(6%*var(--contrast-wash-gain,1)),transparent)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",+ "flex h-8 min-w-8 shrink-0 cursor-pointer items-center justify-center gap-1 rounded-[10px] px-1.5 text-foreground transition-colors hover:bg-[color-mix(in_oklab,var(--foreground)_calc(6%*var(--contrast-wash-gain,1)),transparent)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",htmlPreview &&view.consoleOpen &&"bg-[color-mix(in_oklab,var(--foreground)_calc(8%*var(--contrast-wash-gain,1)),transparent)]",diff --git a/studio/frontend/src/features/browser/new-tab-page.tsx b/studio/frontend/src/features/browser/new-tab-page.tsxindex d807f7a7bd1..f1fb8710731 100644--- a/studio/frontend/src/features/browser/new-tab-page.tsx+++ b/studio/frontend/src/features/browser/new-tab-page.tsx@@ -142,7 +142,7 @@ function SuggestedSite({ site, tabId }: { site: Site; tabId: string }) {type="button"title={`${site.title}\n${site.url}`}onClick={() => navigate(tabId, { url: site.url })}- className="flex w-full min-w-0 cursor-pointer flex-col items-center gap-4 rounded-2xl px-2 pb-4 pt-5 transition-colors hover:bg-[color-mix(in_oklab,var(--foreground)_calc(4%*var(--contrast-wash-gain,1)),transparent)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring group-data-[state=open]/site:bg-[color-mix(in_oklab,var(--foreground)_calc(4%*var(--contrast-wash-gain,1)),transparent)]"+ className="flex w-full min-w-0 cursor-pointer flex-col items-center gap-4 rounded-xl px-2 pb-4 pt-5 transition-colors hover:bg-[color-mix(in_oklab,var(--foreground)_calc(4%*var(--contrast-wash-gain,1)),transparent)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring group-data-[state=open]/site:bg-[color-mix(in_oklab,var(--foreground)_calc(4%*var(--contrast-wash-gain,1)),transparent)]"><SiteIcon site={site} /><span className="w-full truncate text-center text-ui-15 text-foreground">@@ -193,7 +193,7 @@ function ToolButton({<HugeiconsIconicon={icon}strokeWidth={1.75}- className="size-5 shrink-0 text-muted-foreground"+ className="size-4.5 shrink-0 text-muted-foreground"/><span className="min-w-0 flex-1 truncate">{label}</span></button>@@ -310,6 +310,89 @@ export function NewTabPage({ tabId }: { tabId: string }) {? timeFormat.format(time): dateFormat.format(time);+ const suggestedSection =+ showSuggested && sites.length > 0 ? (+ <section className="flex flex-col gap-3">+ <SectionTitle>{t("browser.suggested")}</SectionTitle>+ <div className="grid grid-cols-2 gap-2 sm:grid-cols-4">+ {sites.map((site) => (+ <SuggestedSite key={site.url} site={site} tabId={tabId} />+ ))}+ </div>+ </section>+ ) : null;+ const recentsSection =+ showRecents && recents.length > 0 ? (+ <section className="flex flex-col gap-3">+ <SectionTitle+ actions={+ <div className="flex items-center gap-1">+ <PageButton+ label={t("browser.recentNewer")}+ icon={ChevronUpStandardIcon}+ disabled={shownPage === 0}+ onClick={() => setPage(shownPage - 1)}+ />+ <PageButton+ label={t("browser.recentOlder")}+ icon={ChevronDownStandardIcon}+ disabled={shownPage >= pages - 1}+ onClick={() => setPage(shownPage + 1)}+ />+ </div>+ }+ >+ {t("browser.recents")}+ </SectionTitle>+ <div className="flex flex-col gap-1">+ {shown.map((item) => (+ <LinkContextMenu+ key={item.id}+ url={item.url}+ tabId={tabId}+ extra={+ <MenuRow+ icon={Delete02Icon}+ onSelect={() => removeFromHistory(item.url)}+ >+ {t("browser.pages.removeFromHistory")}+ </MenuRow>+ }+ >+ <button+ type="button"+ title={item.url}+ onClick={() => navigate(tabId, { url: item.url })}+ className={cn(+ "flex min-w-0 cursor-pointer items-center gap-4 rounded-md px-3 py-3 text-start transition-colors hover:bg-[color-mix(in_oklab,var(--foreground)_calc(4%*var(--contrast-wash-gain,1)),transparent)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring data-[state=open]:bg-[color-mix(in_oklab,var(--foreground)_calc(4%*var(--contrast-wash-gain,1)),transparent)]",+ )}+ >+ <span className="flex size-10 shrink-0 items-center justify-center rounded-md bg-[color-mix(in_oklab,var(--foreground)_calc(6%*var(--contrast-wash-gain,1)),transparent)]">+ <SiteFavicon+ url={item.url}+ className="size-5 rounded-[4px]"+ fallbackClassName="size-5 text-muted-foreground"+ />+ </span>+ <span className="min-w-0 flex-1">+ <span className="block truncate text-ui-15 text-foreground">+ {item.title || hostOf(item.url)}+ </span>+ <span className="block truncate text-ui-13 text-muted-foreground">+ {t("browser.website")}+ </span>+ </span>+ <span className="shrink-0 text-ui-13 tabular-nums text-muted-foreground">+ {when(item.visitedAt)}+ </span>+ </button>+ </LinkContextMenu>+ ))}+ </div>+ </section>+ ) : null;+ const visited = recentsSection !== null;+return (<div className="size-full overflow-auto"><div className="mx-auto flex w-full max-w-4xl flex-col gap-9 px-6 pb-10 pt-8">@@ -333,86 +416,9 @@ export function NewTabPage({ tabId }: { tabId: string }) {/></div></section>- {showSuggested && sites.length > 0 ? (- <section className="flex flex-col gap-3">- <SectionTitle>{t("browser.suggested")}</SectionTitle>- <div className="grid grid-cols-2 gap-2 sm:grid-cols-4">- {sites.map((site) => (- <SuggestedSite key={site.url} site={site} tabId={tabId} />- ))}- </div>- </section>- ) : null}+ {visited ? recentsSection : suggestedSection}<BrowserUseToggle />- {showRecents && recents.length > 0 ? (- <section className="flex flex-col gap-3">- <SectionTitle- actions={- <div className="flex items-center gap-1">- <PageButton- label={t("browser.recentNewer")}- icon={ChevronUpStandardIcon}- disabled={shownPage === 0}- onClick={() => setPage(shownPage - 1)}- />- <PageButton- label={t("browser.recentOlder")}- icon={ChevronDownStandardIcon}- disabled={shownPage >= pages - 1}- onClick={() => setPage(shownPage + 1)}- />- </div>- }- >- {t("browser.recents")}- </SectionTitle>- <div className="flex flex-col gap-1">- {shown.map((item) => (- <LinkContextMenu- key={item.id}- url={item.url}- tabId={tabId}- extra={- <MenuRow- icon={Delete02Icon}- onSelect={() => removeFromHistory(item.url)}- >- {t("browser.pages.removeFromHistory")}- </MenuRow>- }- >- <button- type="button"- title={item.url}- onClick={() => navigate(tabId, { url: item.url })}- className={cn(- "flex min-w-0 cursor-pointer items-center gap-4 rounded-md px-3 py-3 text-start transition-colors hover:bg-[color-mix(in_oklab,var(--foreground)_calc(4%*var(--contrast-wash-gain,1)),transparent)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring data-[state=open]:bg-[color-mix(in_oklab,var(--foreground)_calc(4%*var(--contrast-wash-gain,1)),transparent)]",- )}- >- <span className="flex size-10 shrink-0 items-center justify-center rounded-md bg-[color-mix(in_oklab,var(--foreground)_calc(6%*var(--contrast-wash-gain,1)),transparent)]">- <SiteFavicon- url={item.url}- className="size-5 rounded-[4px]"- fallbackClassName="size-5 text-muted-foreground"- />- </span>- <span className="min-w-0 flex-1">- <span className="block truncate text-ui-15 text-foreground">- {item.title || hostOf(item.url)}- </span>- <span className="block truncate text-ui-13 text-muted-foreground">- {t("browser.website")}- </span>- </span>- <span className="shrink-0 text-ui-13 tabular-nums text-muted-foreground">- {when(item.visitedAt)}- </span>- </button>- </LinkContextMenu>- ))}- </div>- </section>- ) : null}+ {visited ? suggestedSection : null}</div></div>);diff --git a/studio/frontend/tests/browser-new-tab-browser-use.test.ts b/studio/frontend/tests/browser-new-tab-browser-use.test.tsindex f29e3a270a0..bbeceabbca3 100644--- a/studio/frontend/tests/browser-new-tab-browser-use.test.ts+++ b/studio/frontend/tests/browser-new-tab-browser-use.test.ts@@ -19,11 +19,12 @@ test("the new tab page's Browser use switch drives the composer's store", () =>);});-test("the switch sits just under Suggested, outside its show setting", () => {+test("the switch sits under the leading section, outside both show settings", () => {assert.match(PAGE,- /<SuggestedSite key=\{site\.url\} site=\{site\} tabId=\{tabId\} \/>\s*\)\)\}\s*<\/div>\s*<\/section>\s*\) : null\}\s*<BrowserUseToggle \/>\s*\{showRecents/,+ /\{visited \? recentsSection : suggestedSection\}\s*<BrowserUseToggle \/>\s*\{visited \? suggestedSection : null\}/,);+ assert.match(PAGE, /const visited = recentsSection !== null;/);});test("every locale has the switch's strings", () => {