-
Notifications
You must be signed in to change notification settings - Fork 135
feat: implement feature flag folders (schema, rpc, ui) #289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| "use client"; | ||
|
|
||
| import { DeleteDialog } from "@/components/ui/delete-dialog"; | ||
|
|
||
| interface DeleteFolderDialogProps { | ||
| isOpen: boolean; | ||
| onClose: () => void; | ||
| onConfirm: () => void; | ||
| folderName: string; | ||
| isDeleting?: boolean; | ||
| } | ||
|
|
||
| export function DeleteFolderDialog({ | ||
| isOpen, | ||
| onClose, | ||
| onConfirm, | ||
| folderName, | ||
| isDeleting = false, | ||
| }: DeleteFolderDialogProps) { | ||
| return ( | ||
| <DeleteDialog | ||
| isOpen={isOpen} | ||
| onClose={onClose} | ||
| onConfirm={onConfirm} | ||
| title="Delete Folder" | ||
| description={`Are you sure you want to delete the folder "${folderName}"?`} | ||
| confirmLabel="Delete Folder" | ||
| isDeleting={isDeleting} | ||
| itemName={folderName} | ||
| > | ||
| <div className="rounded-md bg-muted p-3 text-sm text-muted-foreground"> | ||
| <p> | ||
| Flags in this folder will <strong>not</strong> be deleted. They will be moved to | ||
| "Uncategorized". | ||
| </p> | ||
| </div> | ||
| </DeleteDialog> | ||
|
Comment on lines
+21
to
+37
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use AlertDialog for destructive actions. Guidelines require an AlertDialog for destructive/irreversible actions. 🤖 Prompt for AI Agents |
||
| ); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| "use client"; | ||
|
|
||
| import { CaretDown } from "@phosphor-icons/react/dist/ssr/CaretDown"; | ||
| import { CaretRight } from "@phosphor-icons/react/dist/ssr/CaretRight"; | ||
| import { Folder } from "@phosphor-icons/react/dist/ssr/Folder"; | ||
| import { useState } from "react"; | ||
| import { cn } from "@/lib/utils"; | ||
|
|
||
| interface FolderListItemProps { | ||
| name: string; | ||
| count: number; | ||
| children: React.ReactNode; | ||
| defaultOpen?: boolean; | ||
| } | ||
|
|
||
| export function FolderListItem({ | ||
| name, | ||
| count, | ||
| children, | ||
| defaultOpen = true, | ||
| }: FolderListItemProps) { | ||
| const [isOpen, setIsOpen] = useState(defaultOpen); | ||
|
|
||
| return ( | ||
| <div className="border border-border rounded-lg overflow-hidden mb-4"> | ||
| <button | ||
| type="button" | ||
| onClick={() => setIsOpen(!isOpen)} | ||
| className="w-full flex items-center justify-between px-4 py-3 bg-card hover:bg-muted/50 transition-colors" | ||
| > | ||
| <div className="flex items-center gap-2"> | ||
| {isOpen ? ( | ||
| <CaretDown size={14} className="text-muted-foreground" /> | ||
| ) : ( | ||
| <CaretRight size={14} className="text-muted-foreground" /> | ||
| )} | ||
| <Folder size={18} className="text-muted-foreground" /> | ||
| <span className="font-medium text-sm">{name}</span> | ||
|
Comment on lines
+3
to
+38
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # Check the phosphor icons package to understand SSR import patterns
fd -e "json" -e "ts" -e "tsx" | head -20 | xargs grep -l "phosphor-icons" | head -5Repository: databuddy-analytics/Databuddy Length of output: 85 🏁 Script executed: # Search for phosphor icon usage patterns in the codebase
rg "@phosphor-icons/react" -A 2 -B 1 | head -50Repository: databuddy-analytics/Databuddy Length of output: 2719 🏁 Script executed: # Look at the full file to see the complete context
cat -n apps/dashboard/app/\(main\)/websites/\[id\]/flags/_components/folder-list-item.tsx 2>/dev/null || find . -name "folder-list-item.tsx" -type f -exec cat -n {} \;Repository: databuddy-analytics/Databuddy Length of output: 2393 🏁 Script executed: # Search for phosphor icon imports to see the actual patterns used
rg "import.*Icon.*from.*@phosphor-icons" -A 1 | head -60Repository: databuddy-analytics/Databuddy Length of output: 3961 🏁 Script executed: # Check the phosphor icons package structure in node_modules or lock file
rg "@phosphor-icons/react" package.json -A 5Repository: databuddy-analytics/Databuddy Length of output: 326 🏁 Script executed: # Look for SSR-specific phosphor imports in the codebase
rg "from.*@phosphor-icons/react/dist/ssr" | head -20Repository: databuddy-analytics/Databuddy Length of output: 2735 🏁 Script executed: # Check how SSR icons are being used elsewhere in the codebase
rg "from.*@phosphor-icons/react/dist/ssr" -A 3 | head -40Repository: databuddy-analytics/Databuddy Length of output: 3495 🏁 Script executed: # Look for weight prop usage on phosphor icons
rg "weight=" | grep -i phosphor | head -10Repository: databuddy-analytics/Databuddy Length of output: 55 🏁 Script executed: # Verify the actual import pattern in the codebase more thoroughly
rg "import.*Icon.*from.*@phosphor-icons/react" | head -30Repository: databuddy-analytics/Databuddy Length of output: 3314 🏁 Script executed: # Check if weight prop is even supported for SSR imports
rg "weight=|weight:" | grep -i "caret\|folder" | head -5Repository: databuddy-analytics/Databuddy Length of output: 620 Use named Phosphor imports with The file should import icons as named imports with the Icon suffix for consistency with the codebase pattern, and add the duotone weight for styling. ✅ Suggested import/usage updates-import { CaretDown } from "@phosphor-icons/react/dist/ssr/CaretDown";
-import { CaretRight } from "@phosphor-icons/react/dist/ssr/CaretRight";
-import { Folder } from "@phosphor-icons/react/dist/ssr/Folder";
+import { CaretDownIcon } from "@phosphor-icons/react/dist/ssr/CaretDown";
+import { CaretRightIcon } from "@phosphor-icons/react/dist/ssr/CaretRight";
+import { FolderIcon } from "@phosphor-icons/react/dist/ssr/Folder";- <CaretDown size={14} className="text-muted-foreground" />
+ <CaretDownIcon size={14} weight="duotone" className="text-muted-foreground" />
...
- <CaretRight size={14} className="text-muted-foreground" />
+ <CaretRightIcon size={14} weight="duotone" className="text-muted-foreground" />
...
- <Folder size={18} className="text-muted-foreground" />
+ <FolderIcon size={18} weight="duotone" className="text-muted-foreground" />🤖 Prompt for AI Agents |
||
| <span className="px-2 py-0.5 rounded-full bg-muted text-muted-foreground text-xs"> | ||
| {count} | ||
| </span> | ||
|
Comment on lines
+25
to
+41
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use Guidelines require 🎨 Suggested class updates- <div className="border border-border rounded-lg overflow-hidden mb-4">
+ <div className="border border-border rounded overflow-hidden mb-4">
...
- <span className="px-2 py-0.5 rounded-full bg-muted text-muted-foreground text-xs">
+ <span className="px-2 py-0.5 rounded bg-muted text-muted-foreground text-xs tabular-nums">🤖 Prompt for AI Agents |
||
| </div> | ||
| </button> | ||
|
|
||
| <div | ||
| className={cn( | ||
| "border-t border-border transition-all duration-200", | ||
| isOpen ? "block" : "hidden" | ||
| )} | ||
|
Comment on lines
+45
to
+49
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove transition-all (animation not requested). Guidelines forbid adding animations unless explicitly requested and disallow 🚫 Remove transition-all- className={cn(
- "border-t border-border transition-all duration-200",
- isOpen ? "block" : "hidden"
- )}
+ className={cn("border-t border-border", isOpen ? "block" : "hidden")}🤖 Prompt for AI Agents |
||
| > | ||
| <div className="p-0"> | ||
| {children} | ||
| </div> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Align styling with UI conventions.
Use
rounded(notrounded-md) and addtext-prettyfor paragraph text.🎨 Style tweak
🤖 Prompt for AI Agents