diff --git a/frontend/editor/src/core/components/layout/Workbench.tsx b/frontend/editor/src/core/components/layout/Workbench.tsx
index 7dbc6f75be..8bc0794140 100644
--- a/frontend/editor/src/core/components/layout/Workbench.tsx
+++ b/frontend/editor/src/core/components/layout/Workbench.tsx
@@ -18,6 +18,7 @@ import { useCookieConsent } from "@app/hooks/useCookieConsent";
import styles from "@app/components/layout/Workbench.module.css";
import WorkbenchBar from "@app/components/shared/WorkbenchBar";
+import WorkbenchFloatingSearch from "@app/components/shared/WorkbenchFloatingSearch";
import LandingPage from "@app/components/shared/LandingPage";
import DismissAllErrorsButton from "@app/components/shared/DismissAllErrorsButton";
import { ChatFAB } from "@app/components/chat/ChatFAB";
@@ -77,6 +78,22 @@ export default function Workbench() {
const [viewerToolbarCollapsed, setViewerToolbarCollapsed] = useState(false);
const showReopenTab = currentView === "viewer" && viewerToolbarCollapsed;
+ // The WorkbenchBar carries file-scoped actions, so it only shows once a file
+ // is open or a custom view supplies content; otherwise the search floats.
+ const activeCustomView = customWorkbenchViews.find(
+ (v) => v.workbenchId === currentView,
+ );
+ const topControlsAvailable =
+ currentView !== "myFiles" && !activeCustomView?.hideTopControls;
+ const hasWorkbenchContent =
+ hasFiles ||
+ fileIds.length > 0 ||
+ !isBaseWorkbench(currentView) ||
+ // Shared signing drives the viewer from the sidebar with no file in context.
+ (currentView === "viewer" && !!signingOverlay?.file);
+ const showWorkbenchBar = topControlsAvailable && hasWorkbenchContent;
+ const showFloatingSearch = topControlsAvailable && !hasWorkbenchContent;
+
const handlePreviewClose = () => {
setPreviewFile(null);
const previousMode = sessionStorage.getItem("previousMode");
@@ -231,41 +248,35 @@ export default function Workbench() {
data-tour="workbench"
style={{ backgroundColor: "var(--c-bg)", minWidth: 0 }}
>
- {/* Workbench Bar — always visible outside My Files (it hosts the
- global search), even with no files loaded. */}
- {currentView !== "myFiles" &&
- !customWorkbenchViews.find((v) => v.workbenchId === currentView)
- ?.hideTopControls && (
-
-
- {/* Reopen tab: a little handle hanging off the bar's bottom-right
- while the viewer tool row is retracted. */}
- {showReopenTab && (
-