diff --git a/frontend/app/workspace/widgets.tsx b/frontend/app/workspace/widgets.tsx index 11067edcda..940fb4e96c 100644 --- a/frontend/app/workspace/widgets.tsx +++ b/frontend/app/workspace/widgets.tsx @@ -6,7 +6,7 @@ import { ContextMenuModel } from "@/app/store/contextmenu"; import { RpcApi } from "@/app/store/wshclientapi"; import { TabRpcClient } from "@/app/store/wshrpcutil"; import { shouldIncludeWidgetForWorkspace } from "@/app/workspace/widgetfilter"; -import { atoms, createBlock, isDev } from "@/store/global"; +import { atoms, createBlock, getApi, isDev } from "@/store/global"; import { fireAndForget, isBlank, makeIconClass } from "@/util/util"; import { FloatingPortal, @@ -111,6 +111,10 @@ const AppsFloatingWindow = memo( const dismiss = useDismiss(context); const { getFloatingProps } = useInteractions([dismiss]); + const handleOpenBuilder = useCallback(() => { + getApi().openBuilder(null); + onClose(); + }, [onClose]); useEffect(() => { if (!isOpen) return; @@ -148,55 +152,65 @@ const AppsFloatingWindow = memo( ref={refs.setFloating} style={floatingStyles} {...getFloatingProps()} - className="bg-modalbg border border-border rounded-lg shadow-xl p-4 z-50" + className="bg-modalbg border border-border rounded-lg shadow-xl z-50 overflow-hidden" > - {loading ? ( -
- -
- ) : apps.length === 0 ? ( -
No local apps found
- ) : ( -
- {apps.map((app) => { - const appMeta = app.manifest?.appmeta; - const displayName = app.appid.replace(/^local\//, ""); - const icon = appMeta?.icon || "cube"; - const iconColor = appMeta?.iconcolor || "white"; - - return ( -
{ - const blockDef: BlockDef = { - meta: { - view: "tsunami", - controller: "tsunami", - "tsunami:appid": app.appid, - }, - }; - createBlock(blockDef); - onClose(); - }} - > -
- -
-
- {displayName} +
+ {loading ? ( +
+ +
+ ) : apps.length === 0 ? ( +
No local apps found
+ ) : ( +
+ {apps.map((app) => { + const appMeta = app.manifest?.appmeta; + const displayName = app.appid.replace(/^local\//, ""); + const icon = appMeta?.icon || "cube"; + const iconColor = appMeta?.iconcolor || "white"; + + return ( +
{ + const blockDef: BlockDef = { + meta: { + view: "tsunami", + controller: "tsunami", + "tsunami:appid": app.appid, + }, + }; + createBlock(blockDef); + onClose(); + }} + > +
+ +
+
+ {displayName} +
-
- ); - })} -
- )} + ); + })} +
+ )} +
+
);