Skip to content

Commit 3bd6208

Browse files
committed
Revert "chore: remove hints panel"
This reverts commit beb338b.
1 parent c5d8d90 commit 3bd6208

File tree

3 files changed

+124
-1
lines changed

3 files changed

+124
-1
lines changed
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
"use client";
2+
3+
import { useState } from "react";
4+
import {
5+
LightbulbOffIcon,
6+
LightbulbIcon,
7+
LayersIcon,
8+
GlobeIcon,
9+
Layers2Icon,
10+
FlowerIcon,
11+
} from "lucide-react";
12+
import { useGardenStore } from "lib/hooks/store";
13+
14+
import {
15+
Button,
16+
Collapsible,
17+
CollapsibleContent,
18+
CollapsibleTrigger,
19+
} from "components/ui";
20+
import type { Theme } from "generated/garden.types";
21+
22+
const GardenFlowHints = () => {
23+
const [isOpen, setIsOpen] = useState(false);
24+
const { activeGarden } = useGardenStore();
25+
26+
// Extract theme colors with fallbacks
27+
const theme: Theme | null = activeGarden?.theme || null;
28+
const primaryColor = theme?.primary_color || "hsl(var(--garden))";
29+
const secondaryColor = theme?.secondary_color || "hsl(var(--garden)/30)";
30+
const textColor = theme?.text_color || "hsl(var(--foreground))";
31+
32+
return (
33+
<Collapsible
34+
open={isOpen}
35+
onOpenChange={setIsOpen}
36+
className="flex w-[350px] flex-col gap-2"
37+
>
38+
<div className="flex flex-col items-end gap-2">
39+
<div
40+
className="rounded-md px-3 py-1.5 text-sm font-medium shadow-sm backdrop-blur-sm border flex items-center gap-2"
41+
style={{
42+
backgroundColor: `${primaryColor}10`,
43+
color: primaryColor,
44+
borderColor: secondaryColor,
45+
}}
46+
>
47+
<FlowerIcon className="h-4 w-4" />
48+
{activeGarden?.name || "Garden"}
49+
50+
{activeGarden?.icon && (
51+
<span className="ml-1">{activeGarden.icon}</span>
52+
)}
53+
</div>
54+
55+
<CollapsibleTrigger asChild className="z-10 ml-auto w-fit gap-2 px-4">
56+
<Button
57+
variant="outline"
58+
size="icon"
59+
className="hover:border-opacity-60"
60+
style={{
61+
borderColor: `${primaryColor}30`,
62+
}}
63+
>
64+
{isOpen ? (
65+
<LightbulbOffIcon size={16} style={{ color: primaryColor }} />
66+
) : (
67+
<LightbulbIcon size={16} style={{ color: primaryColor }} />
68+
)}
69+
<span className="sr-only">Toggle</span>
70+
71+
<p>Help</p>
72+
</Button>
73+
</CollapsibleTrigger>
74+
</div>
75+
76+
<CollapsibleContent className="flex flex-col gap-2">
77+
<div
78+
className="z-10 flex flex-col gap-2 rounded-md bg-background/90 p-3 text-xs shadow-md backdrop-blur-sm border"
79+
style={{ borderColor: secondaryColor }}
80+
>
81+
<div className="flex items-center gap-2">
82+
<div
83+
className="h-3 w-3 rounded-full border-2 border-dashed"
84+
style={{ borderColor: primaryColor }}
85+
/>
86+
87+
<p style={{ color: textColor }}>
88+
Click on dashed nodes to navigate into that garden
89+
</p>
90+
</div>
91+
92+
<div className="flex items-center gap-2">
93+
<div className="flex h-3 w-3 items-center justify-center">
94+
<LayersIcon className="h-3 w-3" style={{ color: primaryColor }} />
95+
</div>
96+
97+
<p style={{ color: textColor }}>
98+
Use the{" "}
99+
<LayersIcon
100+
className="mx-1 inline h-3 w-3"
101+
style={{ color: primaryColor }}
102+
/>{" "}
103+
/{" "}
104+
<Layers2Icon
105+
className="mx-1 inline h-3 w-3"
106+
style={{ color: primaryColor }}
107+
/>{" "}
108+
toggle to expand or condense subgardens
109+
</p>
110+
</div>
111+
</div>
112+
</CollapsibleContent>
113+
</Collapsible>
114+
);
115+
};
116+
117+
export default GardenFlowHints;

app/src/components/visualizer/GardenFlowInner/GardenFlowInner.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
import { useCallback, useEffect, useState } from "react";
1515

1616
import { ControlsPanel } from "components/core";
17-
import { ItemDetailDialog } from "components/visualizer";
17+
import { GardenFlowHints, ItemDetailDialog } from "components/visualizer";
1818
import { NodeTypes } from "components/visualizer/customNodes";
1919
import { LOCAL_STORAGE_KEY } from "lib/constants";
2020
import { useGardenStore } from "lib/hooks/store";
@@ -353,6 +353,11 @@ const GardenFlowInner = ({
353353
/>
354354
)}
355355

356+
{/* TODO: update hints */}
357+
<Panel position="top-right">
358+
<GardenFlowHints />
359+
</Panel>
360+
356361
{showControls && (
357362
<ControlsPanel
358363
setInitialized={setInitialized}

app/src/components/visualizer/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export { default as EditorActions } from "./EditorActions/EditorActions";
22
export { default as EditorControls } from "./EditorControls/EditorControls";
33
export { default as GardenFlow } from "./GardenFlow/GardenFlow";
4+
export { default as GardenFlowHints } from "./GardenFlowHints/GardenFlowHints";
45
export { default as GardenFlowInner } from "./GardenFlowInner/GardenFlowInner";
56
export { default as GardenTabs } from "./GardenTabs/GardenTabs";
67
export { ItemDetailDialog } from "./ItemDetailDialog";

0 commit comments

Comments
 (0)