feat: Encore Features system for optional feature gating#396
feat: Encore Features system for optional feature gating#396pedramamini merged 7 commits intomainfrom
Conversation
Introduce a generic feature-gating system where optional features can be toggled on/off from Settings, defaulting to disabled. When off, features are completely invisible — no shortcuts, menus, or command palette entries. Move Director's Notes under Encore Features as the first gated feature. Add EncoreFeatureFlags type, settings persistence, toggle UI in a new Encore Features settings tab, and gate all DN access points (App.tsx, keyboard handler, SessionList hamburger menu, QuickActionsModal). Update SettingsModal tests and document the pattern in CONTRIBUTING.md as a precursor to a plugin marketplace.
SettingsModal had its own useSettings() instance for encoreFeatures, meaning toggles only updated local state. App.tsx never saw the change, so menu items and command palette entries stayed hidden. Move encoreFeatures/setEncoreFeatures to SettingsModal props, sourced from App.tsx's useSettings instance. Also update tab label to "Encore Features", refine description copy, and update tests.
Add section 12 with architecture detail, gating checklist, and Director's Notes as reference implementation. Update CLAUDE.md docs index to mention Encore Features.
Update director-notes.md to note it's an Encore Feature that must be enabled first, add screenshot, and fix Settings path references from "Settings > Director's Notes" to "Settings > Encore Features". Add "(Encore Feature)" annotation to features.md listing.
…tand settingsStore
PR Review — Encore Features SystemOverall this is a solid, well-scoped feature. The architecture is clean, the documentation is thorough, and the pattern is easy to follow for future contributors. A few issues to address before merging. Potential Bug:
|
…gent detection, add toggle-off test
Code Review: feat: Encore Features system for optional feature gatingOverall this is a clean, well-structured implementation of a feature-gating system. The architecture is sound and the documentation is thorough. A few things worth addressing: Issues / Bugs1. In ```typescript 2. Keyboard shortcut fires even with feature disabled (edge case) In The 3. The internal tab state union previously included Design / Architecture Observations4. The toggle in This is a whole-object replacement. As more features are added to 5. Props-drilling approach is documented but creates fragility The stated reason for passing Minor / Nits6. Test coverage gap: toggle-off resets sub-settings visibility The tests verify that DN settings are hidden when 7. ```typescript This list already existed pre-PR and isn't introduced here, but it's duplicated in the refactored code. Not a blocker, just worth tracking as tech debt. 8. Documentation: "Encore Features" naming rationale The CONTRIBUTING.md describes when to use it and how, but not why the system is called "Encore Features" (vs. "Labs", "Experimental", "Advanced"). For a feature-gating system that serves as a "precursor to a full plugin marketplace", the naming may evolve. A one-liner in the docs acknowledging this would help orient future contributors. Positive Notes
The main actionable item before merge is issue #4 (whole-object replacement in |
Summary
Changes
Core Implementation
EncoreFeatureFlagstype tosrc/renderer/types/index.tsencoreFeaturesstate, persistence, and defaults touseSettings.tsSettingsModal.tsxwith a new Encore Features tab (FlaskConical icon) containing a generic panel with per-feature toggle sectionsencoreFeaturesflows from App.tsx → SettingsModal as props (not local useSettings) so toggles propagate immediatelyFeature Gating (Director's Notes)
encoreFeatures.directorNotesctx.encoreFeatures?.directorNotesguard to shortcut handlersetDirectorNotesOpenoptional, conditionally renders menu buttonundefinedis sufficientDocumentation
CONTRIBUTING.mdwith when-to-use guide, architecture, step-by-step how-to, and existing features tableCLAUDE-PATTERNS.mdwith gating checklist and Director's Notes as reference implementationCLAUDE.mddocs index and Key Files tableTests
SettingsModal.test.tsx: tab button, wrap-around navigation, Encore Features panel tests, DN toggle tests, nested DN-enabled describe block with prop-based overridesTest plan