Skip to content

feat: feature flagging moved over to redesign#1140

Merged
carddev81 merged 2 commits into
mainfrom
cpride/feature_flags
May 29, 2026
Merged

feat: feature flagging moved over to redesign#1140
carddev81 merged 2 commits into
mainfrom
cpride/feature_flags

Conversation

@corypride

@corypride corypride commented May 26, 2026

Copy link
Copy Markdown
Contributor

Ports the Feature Control (feature flagging) admin page from the original frontend to the redesign. System admins can now toggle platform-wide features on and off directly from the redesigned UI.

Changes include:

  • New FeatureControl.tsx page under /feature-control, accessible only to SystemAdmin role

  • Toggle support for top-level features (Knowledge Center, Program Hub & Tracking) and Knowledge Center sub-features (Request Content Button, Helpful Links, Videos)

  • Confirmation dialog before applying any toggle, with a statewide impact warning when disabling resident-facing features

  • Sub-features are visually disabled (opacity + Switch disabled) when their parent feature is off

  • "Feature Control" nav link added to Sidebar.tsx admin nav, visible only to system admins, using AdjustmentsHorizontalIcon

  • systemAdminRoutes route group added to app-routes.tsx gating the route to UserRole.SystemAdmin

  • Related issues: https://app.asana.com/1/1201607307149189/project/1209460078641109/task/1214641676425184

Screenshot(s)

image image image image image

Additional context

The API calls (PUT auth/features/:key and PUT auth/page-features/:key) were already in place from the original frontend — this commit only brings the UI into the redesign. No backend changes were made.

RELATED INFO

https://app.asana.com/1/1201607307149189/project/1209460078641109/task/1214641676425184

@corypride corypride requested a review from a team as a code owner May 26, 2026 22:47
@corypride corypride requested review from carddev81 and removed request for a team May 26, 2026 22:47
@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d0f3c13f-ea2f-48cd-9785-2ba71118317a

📥 Commits

Reviewing files that changed from the base of the PR and between edf64e4 and 47754cc.

📒 Files selected for processing (3)
  • frontend/src/components/navigation/Sidebar.tsx
  • frontend/src/pages/admin/FeatureControl.tsx
  • frontend/src/routes/app-routes.tsx

📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Added a new Feature Control page for system administrators to manage platform features
    • System administrators can enable/disable features (Knowledge Center, Program Hub & Tracking) with confirmation dialogs and clear feedback
    • Warning alerts display when changes affect resident-facing functionality
    • Knowledge Center includes dependent sub-features that can be individually toggled
    • Navigation menu updated with Feature Control link for system admins

Walkthrough

This PR adds a new system-admin-only feature control interface that allows toggling top-level features (Knowledge Center and Program Hub) and dependent sub-features. The change introduces a new admin page accessible via /feature-control, adds a conditional navigation link in the admin sidebar, and wires the route through the app's authenticated route composition.

Changes

System Admin Feature Control Page

Layer / File(s) Summary
Route structure for feature control
frontend/src/routes/app-routes.tsx
New systemAdminRoutes route group defines the feature-control path and is integrated into AdminRoutes.children alongside existing admin route groups.
Navigation link for system admins
frontend/src/components/navigation/Sidebar.tsx
Admin sidebar conditionally renders a "Feature Control" link when isSysAdmin(user) is true, pointing to /feature-control with active state detection based on the current path.
Feature Control page implementation
frontend/src/pages/admin/FeatureControl.tsx
Page component reads user feature access, renders two top-level feature toggles with dependent sub-features, manages pending toggle state, and sends API requests to auth/features/{key} or auth/page-features/{key} on confirmation. Dialog UI varies message and warnings based on enable/disable action and resident impact; sub-features are disabled when their parent feature is off.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: feature flagging moved over to redesign' directly describes the main change: porting the Feature Control (feature flagging) admin page from the original frontend to the redesign.
Description check ✅ Passed The description is comprehensive and directly related to the changeset, explaining what was ported, which new components were added, and implementation details like the confirmation dialog and role-based access control.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@CK-7vn CK-7vn self-requested a review May 28, 2026 17:40

@CK-7vn CK-7vn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple things, not big at all, nice work man.

Comment thread frontend/src/pages/admin/FeatureControl.tsx Outdated
Comment thread frontend/src/pages/admin/FeatureControl.tsx Outdated
Comment thread frontend/src/pages/admin/FeatureControl.tsx Outdated
@carddev81 carddev81 requested a review from CK-7vn May 29, 2026 22:50

@carddev81 carddev81 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work @corypride !! Thanks for getting this done

@carddev81 carddev81 merged commit f8ea581 into main May 29, 2026
10 checks passed
@carddev81 carddev81 deleted the cpride/feature_flags branch May 29, 2026 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants