From 7fd381a242f68b7c6f10db4e3ae0bb3d06e36a16 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Thu, 22 Jan 2026 10:09:07 -1000 Subject: Fix background image CORS issue Switch from Unsplash Source API to Lorem Picsum which has proper CORS headers for cross-origin image loading. Co-Authored-By: Claude Opus 4.5 --- issues/001-hide-future-tasks-behind-fold.md | 51 +++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 issues/001-hide-future-tasks-behind-fold.md (limited to 'issues/001-hide-future-tasks-behind-fold.md') diff --git a/issues/001-hide-future-tasks-behind-fold.md b/issues/001-hide-future-tasks-behind-fold.md new file mode 100644 index 0000000..f6012fe --- /dev/null +++ b/issues/001-hide-future-tasks-behind-fold.md @@ -0,0 +1,51 @@ +# [FEATURE] Hide future tasks behind a fold + +## Description +Hide tasks more than 3-7 days out behind a fold. + +## User Story +As a user, I want tasks more than N days out hidden by default so that I can focus on immediate priorities. + +## Technical Context +- Affects: `internal/handlers/handlers.go` (task filtering), `web/templates/partials/todoist-tasks.html` or `tasks-tab.html` +- Data already has `due_date`; filtering is a presentation concern + +## Test Strategy + +### Unit Test (Red) +**File:** `internal/handlers/handlers_test.go` + +Test a new filter function `FilterTasksByHorizon(tasks []Task, days int)` returns only tasks within range. + +```go +func TestFilterTasksByHorizon(t *testing.T) { + // Given tasks with varying due dates + // When filtered with horizon of 7 days + // Then only tasks within 7 days are in "visible" slice + // And remaining tasks are in "deferred" slice +} +``` + +### E2E Test (Red) +Verify collapsed section renders with count badge; click expands to show deferred tasks. + +## Proposed Approach + +1. Add config param `task_horizon_days` (default 7) +2. Partition tasks in handler into "visible" vs "deferred" +3. Render deferred in a collapsible `
` element with HTMX swap +4. Show count badge on collapsed header (e.g., "+12 later") + +## Affected Components +- `internal/handlers/handlers.go` +- `internal/config/config.go` +- `web/templates/partials/todoist-tasks.html` +- `web/templates/partials/tasks-tab.html` + +## Definition of Done +- [ ] Tasks beyond horizon hidden by default +- [ ] Collapsible UI shows count of hidden tasks +- [ ] Click to expand shows all deferred tasks +- [ ] Horizon days configurable +- [ ] Unit tests pass +- [ ] E2E test confirms behavior -- cgit v1.2.3