feat: Feature Flag Folders for Organization#326
feat: Feature Flag Folders for Organization#326dagangtj wants to merge 2 commits intodatabuddy-analytics:mainfrom
Conversation
- Add optional folder text field to flags table - Add index on (folder, websiteId) for performance - Update API schemas to support folder in list/create/update - Add folder filtering in flags.list endpoint - Backward compatible: existing flags work without folder
- Add folder field to flag form schema - Add folder input in flag create/edit sheet - Add FolderSidebar component for folder navigation - Add FolderSelector component for folder selection - Add FolderDialog component for create/rename folders - Update FlagsList to group flags by folder with collapsible sections - Update Flag type to include folder field Implements databuddy-analytics#271
|
@dagangtj is attempting to deploy a commit to the Databuddy OSS Team on Vercel. A member of the Team first needs to authorize it. |
|
|
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryImplements folder organization for feature flags with database schema changes, API support, and UI components. Key Changes:
Issues Found:
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User Creates/Edits Flag] --> B{FlagSheet Component}
B --> C[Folder Input Field]
C --> D{Submit Form}
D --> E[flags.create API]
D --> F[flags.update API]
E --> G[Validate Schema<br/>folder: string optional]
F --> G
G --> H[(Database<br/>flags table<br/>folder: text field)]
H --> I[Index: folder, websiteId]
J[User Views Flags] --> K[flags.list API]
K --> L{Filter by folder?}
L -->|Yes| M[WHERE folder = value]
L -->|No| N[Return all flags]
M --> O[FlagsList Component]
N --> O
O --> P[Group flags by folder]
P --> Q[FolderSection Components]
Q --> R[Collapsible folder UI]
S[FolderSidebar] --> T[Navigate by folder]
T --> K
U[FolderDialog] --> V[Create/Rename folder]
V --> E
style H fill:#e1f5ff
style O fill:#fff4e1
style B fill:#fff4e1
Last reviewed commit: f7e2b4b |
| } from "@phosphor-icons/react"; | ||
| import { useMutation, useQueryClient } from "@tanstack/react-query"; | ||
| import { useMemo } from "react"; | ||
| import { AnimatePresence, motion } from "framer-motion"; |
There was a problem hiding this comment.
Use motion/react instead of framer-motion per UI guidelines
| import { AnimatePresence, motion } from "framer-motion"; | |
| import { AnimatePresence, motion } from "motion/react"; |
Context Used: Context from dashboard - .cursor/rules/ui-guidelines.mdc (source)
| isExpanded && "rotate-180" | ||
| )} | ||
| weight="bold" | ||
| /> | ||
| </button> | ||
| <AnimatePresence initial={false}> |
There was a problem hiding this comment.
Animating height violates UI guidelines. Only animate compositor props (transform, opacity). Consider using max-height with transform/opacity or a collapsible component that doesn't animate height directly.
Context Used: Context from dashboard - .cursor/rules/ui-guidelines.mdc (source)
| <Button | ||
| onClick={onCreateFolder} | ||
| size="sm" | ||
| variant="ghost" | ||
| className="size-8 p-0" | ||
| > | ||
| <PlusIcon className="size-4" /> | ||
| </Button> |
There was a problem hiding this comment.
Icon-only button missing aria-label for accessibility
| <Button | |
| onClick={onCreateFolder} | |
| size="sm" | |
| variant="ghost" | |
| className="size-8 p-0" | |
| > | |
| <PlusIcon className="size-4" /> | |
| </Button> | |
| <Button | |
| onClick={onCreateFolder} | |
| size="sm" | |
| variant="ghost" | |
| className="size-8 p-0" | |
| aria-label="Create folder" | |
| > | |
| <PlusIcon className="size-4" /> | |
| </Button> |
Context Used: Context from dashboard - Ultracite Rules - AI-Ready Formatter and Linter (source)
/claim #271
Summary
Implements folder organization for feature flags as requested in issue #271.
Changes
Database Schema
foldertext field toflagstable(folder, websiteId)for performanceAPI Endpoints
flags.listto support optionalfolderfilter parameterflags.createto allow settingfolderon creationflags.updateto allow updatingfolderfieldDashboard UI
Technical Details
auth/login)Screenshots
Will add screenshots after local testing
Checklist
packages/db/src/drizzle/schema.tsflags.list