diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-01-22 10:09:07 -1000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-01-22 10:09:07 -1000 |
| commit | 7fd381a242f68b7c6f10db4e3ae0bb3d06e36a16 (patch) | |
| tree | abff0af0a0f3b057d7b1ad6d95dbefdf30c553c3 /issues/001-hide-future-tasks-behind-fold.md | |
| parent | 583f90c5dedf0235fa45557359b0e6e7dd62b0f0 (diff) | |
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 <noreply@anthropic.com>
Diffstat (limited to 'issues/001-hide-future-tasks-behind-fold.md')
| -rw-r--r-- | issues/001-hide-future-tasks-behind-fold.md | 51 |
1 files changed, 51 insertions, 0 deletions
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 `<details>` 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 |
