From 2cc89d2e3c47a063de33dffab8ac86285206f26d Mon Sep 17 00:00:00 2001 From: Aditya Gupta Date: Wed, 15 Jul 2026 20:17:37 +0530 Subject: [PATCH] chore: formatting --- .../components/builder/AttributeEditor.tsx | 31 ++-- .../src/components/builder/EntitiesTab.tsx | 136 ++++++++++-------- apps/gui/src/components/builder/JsonTab.tsx | 2 +- .../src/components/builder/LocationsTab.tsx | 36 +++-- .../src/components/builder/MetadataTab.tsx | 2 +- 5 files changed, 126 insertions(+), 81 deletions(-) diff --git a/apps/gui/src/components/builder/AttributeEditor.tsx b/apps/gui/src/components/builder/AttributeEditor.tsx index 42ba20c..cca2050 100644 --- a/apps/gui/src/components/builder/AttributeEditor.tsx +++ b/apps/gui/src/components/builder/AttributeEditor.tsx @@ -25,7 +25,7 @@ export function AttributeEditor({ const handleAttrChange = ( index: number, key: K, - val: AttributeData[K] + val: AttributeData[K], ) => { const copy = [...attributes]; copy[index] = { ...copy[index], [key]: val }; @@ -46,7 +46,9 @@ export function AttributeEditor({ return (
-

{title}

+

+ {title} +

{attributes.length === 0 ? ( -

No attributes defined yet.

+

+ No attributes defined yet. +

) : (
{attributes.map((attr, index) => ( @@ -71,13 +75,17 @@ export function AttributeEditor({ handleAttrChange(index, "name", e.target.value)} + onChange={(e) => + handleAttrChange(index, "name", e.target.value) + } className="h-8 font-mono text-xs" /> handleAttrChange(index, "value", e.target.value)} + onChange={(e) => + handleAttrChange(index, "value", e.target.value) + } className="h-8 text-xs" />
@@ -86,7 +94,9 @@ export function AttributeEditor({ variant="destructive" size="icon" className="size-8 shrink-0 cursor-pointer" - onClick={() => onChange(attributes.filter((_, i) => i !== index))} + onClick={() => + onChange(attributes.filter((_, i) => i !== index)) + } > @@ -100,7 +110,7 @@ export function AttributeEditor({ handleAttrChange( index, "visibility", - checked ? "PUBLIC" : "PRIVATE" + checked ? "PUBLIC" : "PRIVATE", ) } /> @@ -119,12 +129,15 @@ export function AttributeEditor({ ) : (
{entityIds.map((entId) => { - const isAllowed = attr.allowedEntities?.includes(entId); + const isAllowed = + attr.allowedEntities?.includes(entId); return ( -
- ))} + + {targetId} + + + { + const copy = [...entities]; + copy[selectedEntIndex].aliases = { + ...selectedEnt.aliases, + [targetId]: e.target.value, + }; + setEntities(copy); + }} + className="h-7 text-xs flex-1" + /> + +
+ ), + )} )} @@ -275,7 +284,8 @@ export function EntitiesTab({ - {!selectedEnt.initialMemories || selectedEnt.initialMemories.length === 0 ? ( + {!selectedEnt.initialMemories || + selectedEnt.initialMemories.length === 0 ? (

No initial memories loaded. Entities will start blank.

@@ -291,7 +301,9 @@ export function EntitiesTab({ onClick={() => { const copy = [...entities]; copy[selectedEntIndex].initialMemories = - selectedEnt.initialMemories.filter((_, i) => i !== memIdx); + selectedEnt.initialMemories.filter( + (_, i) => i !== memIdx, + ); setEntities(copy); }} className="absolute top-2 right-2 text-muted-foreground hover:text-destructive cursor-pointer" @@ -309,8 +321,10 @@ export function EntitiesTab({ value={mem.intent.type} onChange={(e) => { const copy = [...entities]; - copy[selectedEntIndex].initialMemories[memIdx].intent.type = - e.target.value as "dialogue" | "action" | "monologue"; + copy[selectedEntIndex].initialMemories[ + memIdx + ].intent.type = e.target.value as + "dialogue" | "action" | "monologue"; setEntities(copy); }} > @@ -329,8 +343,9 @@ export function EntitiesTab({ value={mem.locationId || ""} onChange={(e) => { const copy = [...entities]; - copy[selectedEntIndex].initialMemories[memIdx].locationId = - e.target.value || null; + copy[selectedEntIndex].initialMemories[ + memIdx + ].locationId = e.target.value || null; setEntities(copy); }} > @@ -389,7 +404,8 @@ export function EntitiesTab({ {entityIds .filter((id) => id !== selectedEnt.id) .map((entId) => { - const isSelected = mem.intent.targetIds?.includes(entId); + const isSelected = + mem.intent.targetIds?.includes(entId); return ( - {!selectedLoc.connections || selectedLoc.connections.length === 0 ? ( + {!selectedLoc.connections || + selectedLoc.connections.length === 0 ? (

No connections leading from this location.

@@ -220,7 +227,9 @@ export function LocationsTab({ >