summaryrefslogtreecommitdiff
path: root/DESIGN.md
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-01-31 20:16:12 -1000
committerPeter Stone <thepeterstone@gmail.com>2026-01-31 20:16:12 -1000
commitcbb0b53de1d06918c142171fd084f14f03798bc1 (patch)
treebeb642057178bce8f50e3ad67f5a62671e3e6dda /DESIGN.md
parentd39220eac03fbc5b714bde989665ed1c92dd24a5 (diff)
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 <noreply@anthropic.com>
Diffstat (limited to 'DESIGN.md')
-rw-r--r--DESIGN.md42
1 files changed, 42 insertions, 0 deletions
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:**