Skip to content

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.

Studio: trim file toolbar comments (#14980)

Michael Han4c810fb68f5a
diff --git a/studio/frontend/src/features/browser/browser-panel.tsx b/studio/frontend/src/features/browser/browser-panel.tsx
index 8f32f413f4d..567eb21198e 100644
--- a/studio/frontend/src/features/browser/browser-panel.tsx
+++ b/studio/frontend/src/features/browser/browser-panel.tsx
@@ -1717,7 +1717,7 @@ function BrowserFileToolbar({
<span className="min-w-0 break-words">{entry.name}</span>
</div>
<DropdownMenuSeparator />
- {/* A blob URL can't be handed to another app from the desktop app, so there New chat stands alone. */}
+ {/* A blob URL can't be handed to another app from the desktop app. */}
{isTauri || !tabType ? (
<DropdownMenuItem disabled={!blob} onSelect={openInNewChat}>
<HugeiconsIcon icon={BubbleChatAddIcon} strokeWidth={1.75} className="size-4" />
@@ -1777,7 +1777,7 @@ function FloatingFileToolbar({
const [copied, setCopied] = useState(false);
const download = tabDownload(tab);
const blob = download?.blob;
- // HTML and code take BrowserFileToolbar (usesBrowserChrome), so only markdown and text reach here.
+ // HTML and code take BrowserFileToolbar.
const kind = fileBarKind(entry.name, entry.contentType, entry.plainText);
const hasSource = kind === "markdown";
const media = entry.plainText ? null : mediaKind(entry.name, entry.contentType);
@@ -1810,7 +1810,6 @@ function FloatingFileToolbar({
);
return (
<>
- {/* Open and Download sit beside it, so only Copy (hidden on narrow bars) and Wrap need a menu. */}
{kind ? (
<DropdownMenu>
<DropdownMenuTrigger asChild={true}>
@@ -2137,7 +2136,7 @@ function OpenSplit({ entry, blob }: { entry: FileEntry; blob: Blob | undefined }
: tabType
? { label: t("browser.video.open"), run: openInBrowser }
: { label: t("browser.file.newChat"), run: openInNewChat };
- // On the web a file no tab can show has only New chat, which the button already is.
+ // Else the menu would only repeat New chat.
const hasMenu = isTauri || tabType !== null;
return (
<div className={SPLIT_PILL} onPointerEnter={listApps} onFocus={listApps}>
diff --git a/studio/frontend/tests/file-viewer-polish.test.ts b/studio/frontend/tests/file-viewer-polish.test.ts
index ea1ff841a72..de370de77af 100644
--- a/studio/frontend/tests/file-viewer-polish.test.ts
+++ b/studio/frontend/tests/file-viewer-polish.test.ts
@@ -80,18 +80,14 @@ test("file bars show no menu or button that only repeats one beside it", () => {
const panel = read("features/browser/browser-panel.tsx");
const between = (start: string, end: string) =>
panel.slice(panel.indexOf(start), panel.indexOf(end, panel.indexOf(start)));
- // On the web a file no tab can show has only New chat, which the Open split's button already is.
assert.match(panel, /const hasMenu = isTauri \|\| tabType !== null;/);
assert.match(panel, /\{hasMenu \? \(\s*<DropdownMenu onOpenChange/);
- // Open and Download always sit beside the floating name menu; without Copy or Wrap it is a plain label.
const floating = between("function FloatingFileToolbar(", "const SPLIT_PILL");
const nameMenu = between("function FloatingFileToolbar(", "</DropdownMenuContent>");
assert.doesNotMatch(nameMenu, /browser\.file\.openIn|saveBrowserDownload/);
assert.match(floating, /\{kind \? \(\s*<DropdownMenu>/);
assert.match(floating, /title=\{entry\.name\}/);
- // HTML takes the chrome bar (usesBrowserChrome), so the floating bar has no Run again or Console.
assert.doesNotMatch(floating, /kind === "html"|runAgain|toggleConsole/);
- // The chrome bar shows Run again and Console itself, and Open in with one item is just that item.
const chromeMenu = between("function BrowserFileToolbar(", "function FloatingFileToolbar(");
const menu = chromeMenu.slice(chromeMenu.indexOf("<PanelMenu"));
assert.doesNotMatch(menu, /onSelect=\{runAgain\}|onSelect=\{toggleConsole\}/);