-
Notifications
You must be signed in to change notification settings - Fork 145
Description
π― Bounty: Feature Flag Folders for Organization
Bounty: $15
Priority: Design & UX First β
Before starting, please β star the repository - it helps us grow and shows you're committed to contributing! π
Overview
Add a folder system to organize feature flags in the dashboard UI. This is purely for UI organization and should NOT affect any business logic - flag evaluation, dependencies, API responses, and SDK behavior must remain unchanged. The focus is on creating an intuitive, beautiful folder management experience.
Success Criteria
Most Important: The design must be excellent. We're looking for:
- Clean, intuitive folder UI that matches Databuddy's design system
- Smooth interactions (expand/collapse, drag-to-reorder if possible)
- Mobile-responsive folder management
- Visual hierarchy that makes large flag lists manageable
- Screenshots required - show your design work!
Requirements
1. Database Schema (Required)
Add folder support to the database schema.
Option A - Simple String Field (Recommended):
- Add optional
foldertext field toflagstable - Store folder path as string (e.g.,
"auth/login","checkout/payment") - Allows nested folders via path separator
Option B - Folder Table:
- Create
flag_folderstable withid,name,parentId,websiteId,createdAt - Add
folderIdforeign key toflagstable
Acceptance Criteria:
- Schema change in
packages/db/src/drizzle/schema.ts - Migration runs successfully
- Existing flags work without folders (backward compatible)
- Indexes added for performance (
folder,websiteId)
2. API Endpoints (Required)
Extend ORPC endpoints to support folder operations.
Endpoints:
flags.list- Add optionalfolderfilter parameterflags.update- Allow updatingfolderfieldflags.create- Allow settingfolderon creation
Optional (if using Folder Table):
folders.list- List all folders for a websitefolders.create- Create new folderfolders.update- Rename/move folderfolders.delete- Delete folder (move flags to root)
Acceptance Criteria:
- Folder field included in flag responses
- Folder filtering works in
flags.list - Folder updates don't affect flag evaluation logic
- Proper validation (folder name length, allowed characters)
- Authorization checks (user can only access their website's folders)
3. Dashboard UI - Folder Management (Required)
Create folder management UI in the flags page.
UI Components Needed:
- Folder tree/sidebar (collapsible)
- Create folder button/modal
- Rename folder (inline or modal)
- Delete folder (with confirmation - move flags to root or delete)
- Drag flags into folders (nice-to-have)
- Folder breadcrumbs when viewing folder contents
Acceptance Criteria:
- Folder sidebar/tree view matches Databuddy design patterns
- Uses existing UI components (
Button,Dialog,Input, etc.) - Mobile responsive (folders accessible on mobile)
- Smooth animations for expand/collapse
- Uses Phosphor icons (not Lucide)
- Loading states and optimistic updates
- Error handling with Sonner toasts
4. Dashboard UI - Flag List Integration (Required)
Integrate folders into the flags list view.
UI Requirements:
- Show folders as collapsible sections in the list
- Flags grouped under their folder
- "Uncategorized" or "Root" section for flags without folders
- Folder header shows flag count
- Expand/collapse all folders button (nice-to-have)
- Visual indicator when dragging flag to folder (nice-to-have)
Acceptance Criteria:
- Flags list shows folders with nested flags
- Folder sections are visually distinct but match design system
- Clicking folder header expands/collapses
- Empty folders show appropriate empty state
- Folder assignment visible in flag row (badge or icon)
- Works with existing flag actions (edit, delete, toggle)
5. Flag Sheet Integration (Required)
Add folder selection to flag create/edit sheet.
UI Requirements:
- Folder selector dropdown/combobox in flag form
- Shows folder tree/hierarchy
- Option to create new folder from form
- "No folder" option to move flag to root
Acceptance Criteria:
- Folder field in flag creation form
- Folder field in flag edit form
- Folder selector matches existing form patterns
- Can create folder without leaving form (nice-to-have)
- Validation and error handling
6. Testing (Required)
Acceptance Criteria:
- API endpoint tests for folder operations
- Test folder filtering in
flags.list - Test folder updates don't break flag evaluation
- Test authorization (user can only access their folders)
- Test backward compatibility (flags without folders work)
Technical Requirements
- Follow existing codebase patterns and conventions
- Use
bunfor all package management (never npm/pnpm) - TypeScript with strict types (no
any,unknown, ornever) - Use
dayjsfor dates (neverdate-fns) - Use Tanstack Query for data fetching hooks
- Use Jotai for local state if needed
- Proper error boundaries
- Use
roundedclass (notrounded-xlorrounded-md) - Mobile responsive design
- Use Phosphor icons (not Lucide)
- Follow accessibility guidelines from
.cursor/rules/guidelines.mdc
Design Reference
The UI should match the existing dashboard design. Reference these for patterns:
apps/dashboard/app/(main)/websites/[id]/flags/- Current flags pageapps/dashboard/components/- Existing component patterns.cursor/rules/guidelines.mdc- Design and accessibility guidelines.cursor/rules/01-MUST-DO.mdc- Code style requirements
Files to Reference
packages/db/src/drizzle/schema.ts- Database schema (flags table around line 694)packages/rpc/src/routers/flags.ts- API router for flagsapps/dashboard/app/(main)/websites/[id]/flags/_components/- Flag UI componentsapps/dashboard/app/(main)/websites/[id]/flags/page.tsx- Flags pageapps/dashboard/app/(main)/websites/[id]/flags/_components/flag-sheet.tsx- Flag create/edit form
Important Notes
- Flag evaluation logic must remain unchanged
- API responses for SDKs must remain unchanged (folder is UI-only metadata)
- Dependencies between flags must work regardless of folders
- Flag keys, values, and behavior must be unaffected
β Focus Areas:
- Beautiful, intuitive folder UI
- Smooth user experience
- Mobile-friendly
- Performance (don't slow down flag list loading)
Submission Requirements
- All code follows linting rules (run
bun run lint) - Type checks pass (run
bun run check-types) - Tests pass
- PR includes screenshots of folder UI (desktop and mobile)
- PR includes screenshots of folder management (create, rename, delete)
- PR includes screenshots of flags organized in folders
- PR description explains design choices and implementation approach
- Design matches Databuddy's existing UI patterns
Questions?
Comment on this issue for any clarification needed before starting. We're happy to discuss design approaches and implementation details!
Remember to β star the repo before starting! π