diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-08-06 18:19:27 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-08-06 18:19:27 +0000 |
| commit | 06450fe69ade2928deb9274bb67b7ba60d394b4f (patch) | |
| tree | 328c3e2f5608663669d75330bfde1e61ab713499 /web/templates | |
| parent | f7d18eae924a221f12293c3063e46b791468623f (diff) | |
Remove the feature toggle system (dead code)
Audited it (couldn't query the live DB directly -- auto-mode classifier
blocks direct production reads without prior approval -- so this is a
code-only audit): GetFeatureToggles/SetFeatureEnabled/IsFeatureEnabled/
CreateFeatureToggle/DeleteFeatureToggle had exactly one caller each, all
inside their own CRUD handlers. Nothing anywhere else in the codebase
read a toggle's Enabled state to gate any actual behavior -- confirmed
by grepping every remaining .Enabled/IsFeatureEnabled reference back to
either this dead code or its own tests. It was pure UI-managed CRUD with
no consumer, unlike Trusted Agents (wired into agent.go/websocket.go)
or Data Sources (wired into the sync pipeline) which stayed.
Removes the Settings page section, the three /settings/features* routes
and handlers, the five Store methods, the FeatureToggle model, and adds
028_drop_feature_toggles.sql (next free migration number, per this
repo's convention of never renumbering -- see 021_drop_tasks.sql for
the same drop-table-forward pattern) to drop the now-unused table.
Also removed the now-dead tests for all of the above.
go build ./... and go test ./... both clean.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EZ7ikw2ukGJFTHE3bJS7zL
Diffstat (limited to 'web/templates')
| -rw-r--r-- | web/templates/settings.html | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/web/templates/settings.html b/web/templates/settings.html index 9c1869f..f07700d 100644 --- a/web/templates/settings.html +++ b/web/templates/settings.html @@ -19,50 +19,6 @@ <h1 class="text-4xl font-light text-white mb-2 tracking-tight">Settings</h1> <p class="text-slate-400 mb-10">Configure feature toggles and data sources.</p> - <!-- Feature Toggles Section --> - <section class="mb-12"> - <h2 class="text-xl font-medium text-white mb-6 pb-2 border-b border-white/10">Feature Toggles</h2> - <div class="grid gap-4" id="toggles-list"> - {{if .Toggles}} - {{range .Toggles}} - <div class="card flex items-center gap-4" id="toggle-{{.Name}}"> - <div class="flex-1"> - <strong class="text-white">{{.Name}}</strong> - {{if .Description}}<div class="text-sm text-slate-400">{{.Description}}</div>{{end}} - </div> - <div class="flex items-center gap-6"> - <label class="relative inline-flex items-center cursor-pointer"> - <input type="checkbox" value="" class="sr-only peer" - {{if .Enabled}}checked{{end}} - hx-post="/settings/features/toggle" - hx-vals='{"name": "{{.Name}}", "enabled": "{{if .Enabled}}false{{else}}true{{end}}"}' - hx-swap="none" - hx-on::after-request="this.checked = !this.checked; if(event.detail.successful) this.checked = !this.checked;"> - <div class="w-11 h-6 bg-slate-700 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-blue-600"></div> - </label> - <button class="text-xs text-red-400 hover:text-red-300 transition-colors" - hx-delete="/settings/features/{{.Name}}" - hx-target="#toggle-{{.Name}}" - hx-swap="outerHTML" - hx-confirm="Delete feature toggle '{{.Name}}'?"> - Delete - </button> - </div> - </div> - {{end}} - {{else}} - <div class="card text-center text-slate-500 py-10">No feature toggles configured.</div> - {{end}} - </div> - <form class="mt-4 flex flex-wrap gap-3 p-4 bg-slate-900/40 rounded-xl border border-white/5" hx-post="/settings/features" hx-target="#toggles-list" hx-swap="beforeend"> - <input type="text" name="name" placeholder="Feature name (snake_case)" required pattern="[a-z_]+" - class="flex-1 bg-slate-950 border border-white/10 rounded-lg px-4 py-2 text-sm focus:ring-1 focus:ring-blue-500 outline-none"> - <input type="text" name="description" placeholder="Description (optional)" - class="flex-[2] bg-slate-950 border border-white/10 rounded-lg px-4 py-2 text-sm focus:ring-1 focus:ring-blue-500 outline-none"> - <button type="submit" class="bg-blue-600 hover:bg-blue-500 text-white px-6 py-2 rounded-lg text-sm font-medium transition-colors">Add Toggle</button> - </form> - </section> - <!-- Passkeys Section --> {{if .WebAuthnEnabled}} <section class="mb-12" id="passkeys-card-section"> |
