refactor: dedup cleanup (DUP-* issues) #285
No reviewers
Labels
No labels
backend
bug
chore
duplication
effort:complex
effort:medium
effort:trivial
enhancement
frontend
fullstack
priority:high
ready-for-agent
refactor
security
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dries/ocman!285
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "chore/dup-cleanup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #40 #45 #49 #50 #51 #52.
Six duplication refactors, one commit each. Each verified against current
mainbefore touching (four other DUP issues — #38 #39 #41 #44 — were already resolved on main and closed separately with notes).refactor(server)— extractrequireMethodfactory;requireGET/requirePOSTbecome one-liners.refactor(db)— extractmodelKey(provider, model)helper; replace 4 inlineprovider + "/" + modelconstructions. Empty-provider now yieldsmodelinstead of/model(more correct; verified safe at both filter/group call sites).refactor(server)— extract genericwriteWithUnsupportedFallbackfor theErrUnsupported→ empty-shape fallback shared byhandleSessionChanges/handleSessionInfo.refactor(frontend)— extractuseSidebarCallbackshook; remove the byte-identicalonRefresh/onLoadingChangeeffects from the 3 sidebar components.refactor(frontend)— migrateactivity/models/hourly/hourlyTokensto the existingqueryStringhelper.refactor(frontend)— reimplementuseWorkingTreeDiffas a thin wrapper overuseDebouncedSessionResource(152→89 lines);notRepo/404 behavior preserved via sentinel-resolve, shared base hook untouched. Tests updated.Behavior-preserving throughout.
go test ./...+ vitest pass (via pre-commit on each commit).Coverage ratchet: ✅ pass
Tolerance: -0.1%. Baseline stored on
gh-pages.