Add local feature flag system and a feature-flags skill#10
Conversation
Introduce a typed feature-flag registry so larger work can ship behind a flag, then graduate into a normal setting or become always-on. Flags carry metadata and defaults in src/featureFlags.ts; only user overrides persist, and the Rust backend prunes unknown or retired ids on load. User-facing preview flags surface under a new Preview Features settings category, and a sample gitAttribution flag reserves the id for that future feature. The new-feature planning skill now requires a flag recommendation per feature. Closes #7 Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: GitButler <gitbutler@gitbutler.com>
Document the add, gate, remove, and promote-to-setting procedures for the feature-flag system as a repo skill, and point AGENTS.md at it. Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: GitButler <gitbutler@gitbutler.com>
There was a problem hiding this comment.
Code Review
This pull request introduces a local feature-flag system allowing larger or riskier features to ship behind a flag before graduating to normal settings or becoming always-on. It adds a typed registry in the frontend, persists overrides in the Rust backend, and provides a 'Preview Features' tab in the Settings UI for user opt-in. A review comment suggests optimizing isFeatureEnabled to perform a direct O(1) lookup instead of a full sanitization and resolution on every check, which avoids unnecessary object allocations on hot paths.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
Pull request overview
This pull request introduces a local, typed feature-flag system (with persisted user overrides) and surfaces user-toggleable preview flags in Settings, alongside documentation and agent-skill guidance for managing the flag lifecycle.
Changes:
- Adds a typed feature flag registry with override sanitization and default/override resolution (
src/featureFlags.ts) plus unit tests. - Persists feature-flag overrides in UI state (frontend + Rust backend) and prunes unknown/retired ids during backend sanitization.
- Adds a Preview Features Settings category for user-visible preview flags and documents the flag lifecycle + adds/updates agent skills.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/tauri.ts |
Extends persisted view settings to include featureFlags override map and seeds defaults. |
src/tauri.test.ts |
Updates hosted Tauri transport test fixtures to include featureFlags. |
src/styles.css |
Adds styling for preview feature flag rows in Settings. |
src/featureFlags.ts |
Introduces the typed registry, sanitization, and resolution helpers for feature flags. |
src/featureFlags.test.ts |
Adds unit coverage for defaults, overrides, sanitization, and preview visibility filtering. |
src/App.tsx |
Adds Preview Features settings tab and wires persisted featureFlags overrides into app state + persistence. |
src/App.test.tsx |
Adds rendered-shell coverage ensuring preview flags render and toggles persist/restore. |
src-tauri/src/lib.rs |
Persists feature flag overrides, prunes unknown ids on load, and adds backend tests for pruning/round-trip. |
docs/development.md |
Documents the local feature-flag system, lifecycle, and promotion/removal guidance. |
AGENTS.md |
Adds guidance to use $feature-flags when operating the feature-flag lifecycle. |
.agents/skills/new-feature/SKILL.md |
Requires a per-feature feature-flag recommendation in new-feature artifacts/issues. |
.agents/skills/feature-flags/SKILL.md |
Adds a repo skill with step-by-step procedures for adding/gating/removing/promoting flags. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Resolve a hot-path check without resolving the whole registry or allocating, per review feedback. A non-boolean override still falls back to the default. Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: GitButler <gitbutler@gitbutler.com>
Summary
src/featureFlags.ts) with default/override resolution; only user overrides persist, and the Rust backend prunes unknown or retired ids on load.gitAttributionsample flag (default off) that reserves the id for that future feature.new-featureplanning skill to require a feature-flag recommendation per feature, documents the flag lifecycle indocs/development.md, and adds afeature-flagsrepo skill covering how to add, gate, remove, and promote flags.Test plan
./run-tests.sh(npm 274 tests, build, bundle budget, smoke, npm audit, cargo fmt/clippy/test/check)ui-state.json, restart, confirm it is prunedCloses #7