Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
add build/edit button to apps
  • Loading branch information
sawka committed Mar 4, 2026
commit f1f6a2093386a881e5dfe9837b4198fb42414617
101 changes: 52 additions & 49 deletions frontend/app/workspace/widgets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,61 +152,64 @@ 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 ? (
<div className="flex items-center justify-center p-8">
<i className="fa fa-solid fa-spinner fa-spin text-2xl text-muted"></i>
</div>
) : apps.length === 0 ? (
<div className="text-muted text-sm p-4 text-center">No local apps found</div>
) : (
<div
className="grid gap-3"
style={{
gridTemplateColumns: `repeat(${gridSize}, minmax(0, 1fr))`,
maxWidth: `${gridSize * 80}px`,
}}
>
{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 (
<div
key={app.appid}
className="flex flex-col items-center justify-center p-2 rounded hover:bg-hoverbg cursor-pointer transition-colors"
onClick={() => {
const blockDef: BlockDef = {
meta: {
view: "tsunami",
controller: "tsunami",
"tsunami:appid": app.appid,
},
};
createBlock(blockDef);
onClose();
}}
>
<div style={{ color: iconColor }} className="text-3xl mb-1">
<i className={makeIconClass(icon, false)}></i>
</div>
<div className="text-xxs text-center text-secondary break-words w-full px-1">
{displayName}
<div className="p-4">
{loading ? (
<div className="flex items-center justify-center p-8">
<i className="fa fa-solid fa-spinner fa-spin text-2xl text-muted"></i>
</div>
) : apps.length === 0 ? (
<div className="text-muted text-sm p-4 text-center">No local apps found</div>
) : (
<div
className="grid gap-3"
style={{
gridTemplateColumns: `repeat(${gridSize}, minmax(0, 1fr))`,
maxWidth: `${gridSize * 80}px`,
}}
>
{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 (
<div
key={app.appid}
className="flex flex-col items-center justify-center p-2 rounded hover:bg-hoverbg cursor-pointer transition-colors"
onClick={() => {
const blockDef: BlockDef = {
meta: {
view: "tsunami",
controller: "tsunami",
"tsunami:appid": app.appid,
},
};
createBlock(blockDef);
onClose();
}}
>
<div style={{ color: iconColor }} className="text-3xl mb-1">
<i className={makeIconClass(icon, false)}></i>
</div>
<div className="text-xxs text-center text-secondary break-words w-full px-1">
{displayName}
</div>
</div>
</div>
);
})}
</div>
)}
);
})}
</div>
)}
</div>
<button
type="button"
className="mt-3 -mx-4 -mb-4 px-4 py-2 border-t border-border rounded-b-lg text-xs text-secondary text-left hover:bg-hoverbg hover:text-white transition-colors cursor-pointer"
className="w-full px-4 py-2 border-t border-border text-xs text-secondary text-center hover:bg-hoverbg hover:text-white transition-colors cursor-pointer flex items-center justify-center gap-2"
onClick={handleOpenBuilder}
>
+ Build/Edit Apps
<i className="fa fa-solid fa-hammer"></i>
Build/Edit Apps
</button>
</div>
</FloatingPortal>
Expand Down
Loading