-
Notifications
You must be signed in to change notification settings - Fork 0
feat(ui): UX improvements for feature flags (#9) #12
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?
Conversation
- Add use_v2_feature_versioning to FlagsmithEnvironment interface - Add group_owners and created_by fields to FlagsmithFeature interface - Add environmentId parameter to getUsageData() method - Add getUsageDataByEnvironments() for parallel fetching per environment Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace Type column with Tags column header - Add dynamic environment status columns (max 6 environments) - Add TablePagination with 50 items/page default - Update colSpan calculation for empty state - Pass orgId prop to ExpandableRow component Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Make entire table row clickable to expand/collapse accordion - Add Tags column with chips (max 3 displayed, +N overflow indicator) - Add environment status Switch icons in row (up to 6 environments) - Add stopPropagation to prevent link/button clicks from toggling row - Add onClick prop to FlagsmithLink component for event handling - Add clickableRow and switchOn styles for better UX Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace text toggles with Material-UI Switch components - Add Overrides column showing segment and identity counts - Add Value column for CONFIG type flags - Limit displayed environments to 10 with overflow indicator - Add styled switch with Flagsmith brand colors Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add Server-side Only badge with VpnKey icon - Add Archived badge with Archive icon - Add Ownership card showing creator, assigned users, and groups - Add value type detection (Boolean/Number/String) for CONFIG flags - Reorganize cards layout for better information hierarchy Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create FeatureAnalyticsSection component with recharts LineChart - Display usage data per environment with color-coded lines - Development/Dev: green (#4caf50) - Staging/Stage: orange (#ff9800) - Production/Prod: red (#f44336) - Show last 30 days of flag evaluation data - Auto-hide section when no usage data available - Add orgId prop to ExpandableRow for analytics fetching Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add multivariate_options field to FlagsmithFeature interface - Detect and display Multivariate flag type in details card - Improve value type detection for multivariate options - Rename Config to Remote Config for clarity Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add conditional Version column based on use_v2_feature_versioning - Display v1/v2 indicator per environment - Only show column when at least one environment uses v2 versioning Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add scheduledVersion to FlagsmithFeatureDetails interface - Detect scheduled changes using live_from field (future date, not yet live) - Display warning-styled card with Schedule icon in feature details - Add tests for scheduled version detection - Add mock data with scheduled change for demo Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add 55 mock features to demonstrate pagination functionality - Add per-environment usage data with distinct values (0-500 range) - Add use_v2_feature_versioning to environments for version column - Add initial_value to CONFIG features for value type detection - Add multivariate_options to demonstrate multivariate flag type - Add created_by and group_owners for ownership display - Include special "zebra_stripe_mode" feature on page 2 for search testing - Mock data now covers: tags, badges, analytics, versioning, and ownership Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
ef89ce4 to
2015923
Compare
33b1367 to
2015923
Compare
- Add useMemo to memoize FlagsmithClient in useFlagsmithUsage hook - Extract constants (pagination, chart config, environment colors) - Add shared styles for switches and chips - Add date formatting utilities - Add flag type helper functions Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- useFlagsmithProject: test error handling and data fetching - useFlagsmithUsage: test error handling and totalFlags calculation - flagTypeHelpers: test flag type detection and text utilities Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add reusable ErrorState component with optional hint prop - Replace inline error handling in FlagsTab, FlagsmithOverviewCard, FlagsmithUsageCard - Improve getUsageDataByEnvironments type using Pick<FlagsmithEnvironment> Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Export FlagsTab, FlagsmithOverviewCard, and FlagsmithUsageCard for use with Backstage's legacy frontend system. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Zaimwa9
left a comment
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.
A couple of comments but looks good overall to me
| }; | ||
|
|
||
| fetchUsageData(); | ||
| }, [client, orgId, projectId, environments]); |
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.
Can we memoize environments maybe to avoid re-rendering by references comparisons ?
| </Typography> | ||
| )} | ||
| </Box> | ||
| <ErrorState |
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.
| return ( | ||
| <> | ||
| <TableRow hover className={classes.clickableRow} onClick={handleToggle}> | ||
| <TableCell padding="checkbox"> |
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.
- Memoize environments in FeatureAnalyticsSection to prevent unnecessary re-renders - Fix scheduled version selection to pick the earliest (next coming) version when multiple are scheduled - Remove unused useCommonStyles hook from sharedStyles.ts - Move CONFIG/FLAG literals to FEATURE_TYPES constants - Add comment explaining spread operator necessity for PAGINATION_OPTIONS - Fix tooltip font colors in FlagsmithLink component - Fix padding and background color inconsistency in ExpandableRow Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Create generic ChartTooltip component with render prop pattern - Remove UsageTooltip.tsx wrapper (logic moved inline to UsageChart) - Add AnalyticsTooltip inline in FeatureAnalyticsSection - Use theme colors (theme.palette.grey[800], theme.palette.common.white) - Single source of truth for tooltip styling across all charts - Fix memoization dependency in FeatureAnalyticsSection Benefits: - Fewer component files (eliminated thin wrapper) - Co-located tooltip logic with chart components - Consistent theme-aware styling - Easier to customize per chart Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Remove useMemo wrapper for environments prop - Use environments directly as useEffect dependency - Let parent component handle memoization if needed - Simpler and more straightforward code Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>


Summary
This PR implements comprehensive UX improvements for the feature flags plugin based on issue #9:
Table View
Accordion View
Environment View
Code Quality
Not Implemented (Blocked)
Test plan
yarn build:all- passesyarn test- passes (37 tests)import { FlagsTab } from '@flagsmith/backstage-plugin'Closes #9