From cbb0b53de1d06918c142171fd084f14f03798bc1 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Sat, 31 Jan 2026 20:16:12 -1000 Subject: Add feature toggles system with settings UI (#74) - Add feature_toggles table (migration 012) - Add source_config table for future source selection (migration 013) - Create settings page at /settings with: - Feature toggle management (enable/disable/create/delete) - Data source configuration (sync and toggle boards/calendars) - Add store methods for feature toggles and source config - Add GetCalendarList and GetTaskLists to Google API clients - Document feature toggle workflow in DESIGN.md Co-Authored-By: Claude Opus 4.5 --- DESIGN.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'DESIGN.md') diff --git a/DESIGN.md b/DESIGN.md index 87c1f3c..75812ee 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -546,6 +546,48 @@ func TestHandler_HandleDashboard(t *testing.T) { 7. **Don't refactor working code** - Only touch what's needed 8. **Don't alter git history** - Never amend, rebase, or force push. Keep a clean, linear history with new commits only. +### Feature Toggles + +Feature toggles allow gradual rollout of new features and easy rollback if issues arise. + +**When to use feature toggles:** +- New features that may need adjustment after deployment +- Experimental features being tested +- Features that depend on external services that may be unreliable +- Any change that could break existing functionality + +**Creating a feature toggle:** + +1. Add a migration or use the Settings UI at `/settings` +2. Check the toggle in your handler: +```go +if h.store.IsFeatureEnabled("my_feature") { + // New behavior +} else { + // Old behavior or disabled state +} +``` + +3. Document the toggle in this file under "Active Feature Toggles" + +**Managing feature toggles:** +- Access the Settings page at `/settings` to view/toggle/create features +- Store methods: `IsFeatureEnabled()`, `SetFeatureEnabled()`, `CreateFeatureToggle()` +- Toggles are stored in the `feature_toggles` table + +**Lifecycle:** +1. **Create** toggle (disabled by default) before deploying feature +2. **Enable** after deployment if tests pass +3. **Monitor** for issues +4. **Remove** toggle and conditional code once feature is stable (usually after 1-2 weeks) + +**Active Feature Toggles:** +| Name | Description | Status | +|------|-------------|--------| +| `source_config` | Configure which boards/lists/calendars to fetch | Disabled | +| `calendar_timeline` | Show timeline as a calendar view with time slots | Disabled | +| `completed_log` | Track and display completed tasks log | Enabled | + ### Git Practices **Clean history principles:** -- cgit v1.2.3