Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

fix: only apply css when selected & expanded for db & schema (#3891)

Shahmir Varqhaec4c37dd08e9
diff --git a/frontend/src/components/datasources/datasources.tsx b/frontend/src/components/datasources/datasources.tsx
index c17e810dd9..080a475e55 100644
--- a/frontend/src/components/datasources/datasources.tsx
+++ b/frontend/src/components/datasources/datasources.tsx
@@ -269,10 +269,12 @@ const DatabaseItem: React.FC<{
<DatabaseIcon
className={cn(
"h-4 w-4",
- isSelected ? "text-foreground" : "text-muted-foreground",
+ isSelected && isExpanded
+ ? "text-foreground"
+ : "text-muted-foreground",
)}
/>
- <span className={cn(isSelected && "font-semibold")}>
+ <span className={cn(isSelected && isExpanded && "font-semibold")}>
{database.name === "" ? <i>Not connected</i> : database.name}
</span>
</CommandItem>
@@ -353,10 +355,12 @@ const SchemaItem: React.FC<{
<PaintRollerIcon
className={cn(
"h-4 w-4 text-muted-foreground",
- isSelected && "text-foreground",
+ isSelected && isExpanded && "text-foreground",
)}
/>
- <span className={cn(isSelected && "font-semibold")}>{schema.name}</span>
+ <span className={cn(isSelected && isExpanded && "font-semibold")}>
+ {schema.name}
+ </span>
</CommandItem>
{isExpanded && children}
</>