Skip to content

Conversation

@talissoncosta
Copy link

@talissoncosta talissoncosta commented Dec 19, 2025

Summary

UI/UX improvements and architectural refactoring for the Flagsmith Backstage Plugin.

Closes Issue #6422 | Reference: #5641

Changes

UI/UX Improvements

  • Flagsmith branding: Teal primary, purple secondary colors
  • Visual status indicators: Enabled/disabled dots across all components
  • Search functionality: Debounced search with clear button
  • Deep links: Direct links to Flagsmith dashboard for flags and projects
  • Jira-style tables: Per-environment status in expandable rows
  • Lazy loading: Feature details load on accordion expand

Component Refactoring

Split large components into smaller, focused modules:

Component Before After
FlagsTab 636 lines 5 files
FlagsmithOverviewCard 269 lines 4 files
FlagsmithUsageCard 202 lines 3 files

Testability Improvements

Custom Hooks:

  • useFlagsmithProject - Fetches project, environments, features
  • useFlagsmithUsage - Fetches usage data with totals

Utility Functions:

  • getFeatureEnvStatus - Get feature status per environment
  • buildEnvStatusTooltip - Build tooltip for environment statuses
  • calculateFeatureStats - Calculate enabled/disabled counts
  • paginate - Generic pagination helper

New File Structure

src/
├── components/
│   ├── FlagsTab/
│   │   ├── index.tsx
│   │   ├── ExpandableRow.tsx
│   │   ├── EnvironmentTable.tsx
│   │   ├── FeatureDetailsGrid.tsx
│   │   └── SegmentOverridesSection.tsx
│   ├── FlagsmithOverviewCard/
│   │   ├── index.tsx
│   │   ├── FlagStatsRow.tsx
│   │   ├── FeatureFlagRow.tsx
│   │   └── MiniPagination.tsx
│   ├── FlagsmithUsageCard/
│   │   ├── index.tsx
│   │   ├── UsageChart.tsx
│   │   └── UsageTooltip.tsx
│   └── shared/
├── hooks/
│   ├── useFlagsmithProject.ts
│   └── useFlagsmithUsage.ts
├── utils/
│   └── flagHelpers.ts
└── theme/
    └── flagsmithTheme.ts

Test Plan

  • yarn lint passes
  • yarn build passes
  • Dev preview works with mock data (yarn start)
  • Search filters flags correctly
  • Accordion expansion loads details lazily
  • Deep links open Flagsmith dashboard
  • Unit tests for hooks and utilities (follow-up)

Screenshots

Run yarn start to preview with mock data


🤖 Generated with Claude Code

talissoncosta and others added 8 commits December 22, 2025 22:43
Add centralized theme configuration with:
- Brand colors (primary teal, secondary purple)
- Status colors (enabled green, disabled gray, warning orange)
- Dashboard URL builder functions for deep linking

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add reusable components:
- FlagStatusIndicator: colored dot for enabled/disabled states
- SearchInput: debounced search input with clear button
- FlagsmithLink: external link to Flagsmith dashboard

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add TypeScript interfaces to support lazy loading of feature details:
- FlagsmithFeatureStateValue: string/integer/boolean values
- FlagsmithFeatureSegment: segment ID and priority
- FlagsmithFeatureState: environment state with values and segments

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Refactor FlagsTab with improved UX:
- Simplified main table with Flag Name, Type, and Created columns
- Jira-style per-environment table in expanded row (inspired by #5641)
- Lazy loading for detailed feature states on accordion expand
- "Show additional details" collapsible for segment overrides
- Search functionality with debounced filtering
- Deep links to Flagsmith dashboard

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Improve OverviewCard with:
- Summary stats header (enabled/disabled counts)
- Deep link to Flagsmith dashboard
- Better visual hierarchy with Flagsmith theme colors

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update usage chart with Flagsmith teal color for better brand consistency.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add comprehensive mock data to support the new UI:
- Per-environment feature states with values
- Segment override data with priorities
- Feature versions with publish info
- Multi-environment status for each feature

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove the summary stats (X Enabled, Y Disabled) from the header as they
were based on default_enabled which doesn't reflect actual per-environment
status. A flag could be enabled in Production but disabled in Development,
making this count confusing. Following LaunchDarkly plugin pattern of
showing only project name and total flag count.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@talissoncosta talissoncosta changed the base branch from main to feat/6421-alpha-export December 23, 2025 01:52
@talissoncosta talissoncosta force-pushed the feat/6422-ui-improvements branch from eda8b84 to 14787ef Compare December 23, 2025 01:55
talissoncosta and others added 4 commits December 22, 2025 23:21
Extract FlagsTab.tsx (636 lines) into modular components:
- index.tsx: Main component with data fetching and table layout
- ExpandableRow.tsx: Row expansion with lazy loading
- EnvironmentTable.tsx: Per-environment status display
- FeatureDetailsGrid.tsx: Version, targeting, and details cards
- SegmentOverridesSection.tsx: Collapsible segment overrides

This improves maintainability and prepares for test coverage.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add reusable hooks for data fetching:
- useFlagsmithProject: Fetches project, environments, and features
- useFlagsmithUsage: Fetches usage data with total calculation

Add utility functions in src/utils/flagHelpers.ts:
- getFeatureEnvStatus: Get feature status per environment
- buildEnvStatusTooltip: Build tooltip for environment statuses
- calculateFeatureStats: Calculate enabled/disabled counts
- paginate: Generic pagination helper

These abstractions prepare for comprehensive test coverage.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Extract FlagsmithOverviewCard.tsx (269 lines) into modular components:
- index.tsx: Main component using custom hook
- FlagStatsRow.tsx: Enabled/disabled stats display
- FeatureFlagRow.tsx: Individual feature row with environment dots
- MiniPagination.tsx: Reusable pagination component

Uses useFlagsmithProject hook and utility functions for cleaner code.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Extract FlagsmithUsageCard.tsx (202 lines) into modular components:
- index.tsx: Main component using custom hook
- UsageChart.tsx: Bar chart with recharts
- UsageTooltip.tsx: Custom tooltip for chart data points

Uses useFlagsmithUsage hook for cleaner separation of concerns.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@talissoncosta talissoncosta changed the title feat(ui): UI/UX improvements for Flagsmith Backstage Plugin feat(ui): UI/UX improvements and component refactoring Dec 23, 2025
talissoncosta and others added 2 commits December 22, 2025 23:52
- Replace inline data fetching with useFlagsmithProject hook
- Add client to hook return for lazy loading in ExpandableRow
- Simplifies FlagsTab from 175 to 138 lines
- All three main components now use their respective hooks

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add shared components with accessibility improvements:

**New shared components:**
- LoadingState: Consistent loading spinner with message and ARIA support
- MiniPagination: Moved from OverviewCard to shared (reusable)

**Accessibility improvements:**
- Add aria-label and aria-expanded to ExpandableRow toggle button
- Add role="searchbox" and aria-label to SearchInput
- Add aria-label to clear search button
- Add aria-label to FlagsmithLink (both icon and text variants)
- Add aria-hidden to decorative icons
- Add role="navigation" to MiniPagination
- Add role="status" to LoadingState

**Refactored to use shared components:**
- FlagsTab, FlagsmithOverviewCard, FlagsmithUsageCard now use LoadingState
- FlagsmithOverviewCard now imports MiniPagination from shared

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI/UX improvements and component refactoring for Backstage Plugin

2 participants