Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/components/convert-chip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ export function ConvertChip() {
const { run, cancel } = useConvert();
const t = useT();

// Only show in split mode — when only one pane is visible there's no
// divider to hang off, and the toolbar button is already obvious.
if (layoutMode !== "split") return null;

const agentInfo = agents.find((a) => a.id === agent);
const model = agent ? agentModels[agent] ?? "default" : "default";
const canConvert =
Expand Down Expand Up @@ -55,6 +51,7 @@ export function ConvertChip() {
// Lives here (not in Toolbar) because the chip is the single source of
// Convert truth after the toolbar button was removed.
useEffect(() => {
if (layoutMode !== "split") return;
const onKey = (e: KeyboardEvent) => {
if ((e.metaKey || e.ctrlKey) && e.key === "Enter") {
if (isRunning || !canConvert) return;
Expand All @@ -64,7 +61,11 @@ export function ConvertChip() {
};
window.addEventListener("keydown", onKey);
return () => window.removeEventListener("keydown", onKey);
}, [onClick, isRunning, canConvert]);
}, [layoutMode, onClick, isRunning, canConvert]);

// Only show in split mode — when only one pane is visible there's no
// divider to hang off, and the toolbar button is already obvious.
if (layoutMode !== "split") return null;

return (
<div
Expand Down