feat(dashboard): retrospective links for done tasks + time-based filter#95
feat(dashboard): retrospective links for done tasks + time-based filter#95
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 316f2fced2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
templates/dashboard/tasks.html
Outdated
| }; | ||
| let openNodeKeys = new Set(); | ||
| let hasRendered = false; | ||
| let currentFilter = localStorage.getItem('tasks-filter') || 'all'; |
There was a problem hiding this comment.
Guard localStorage access for task filter state
Accessing localStorage at module load can throw a SecurityError in privacy-restricted contexts (for example, browsers with storage disabled), which aborts the script before DOMContentLoaded and prevents the task tree from rendering at all. This change introduces unconditional reads/writes (getItem/setItem) without a fallback path, so the Tasks page can become unusable for those users; wrapping storage access in try/catch with an in-memory default avoids the hard failure.
Useful? React with 👍 / 👎.
- Add `mtime` and `hasRetrospective` to DashboardTask, propagate through TasksTreeNode - Emit `retroLink` pointing to retrospective.html?task=ID for done tasks with a retro JSON - Add filter bar (All / Last 30d / 7d / 24h) above tasks forest; state persists in localStorage - Recursive filterTree() prunes project/task nodes by file mtime; shows placeholder when empty Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Accessing localStorage at module load can throw SecurityError in privacy-restricted contexts, breaking the entire Tasks page. Wrap getItem at init and setItem on filter change in try/catch so the page degrades gracefully with an in-memory default when storage is unavailable. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
e96edf7 to
7392e81
Compare
Refactor Notes — task-322291a6 (coder perspective)What I'd do differently next time1. Batch the
|
Summary
retroLinkfield viaTasksTreeNode)localStoragefilterTree()keeps project nodes only when descendants pass; shows "No tasks match" placeholder when emptyBackend (
src/dashboard.ts)DashboardTask: addedmtime: string | null,hasRetrospective: booleanTasksTreeNode: addedretroLink: string | null,mtime: string | nullreadDashboardTasks(): readsstatSyncmtime andexistsSyncretro JSON per taskbuildTaskNode(): propagatesmtime/retroLink; fallback + project nodes getnullFrontend (
templates/dashboard/tasks.html).filter-bar,.filter-btn,.active)filterCutoff()+filterTree()for recursive mtime-based pruningrenderNode()rendersretroLinkanchor after proposal linktasks-tree.jsonTest plan
bun run typecheck— confirmed clean)retrospectives/<id>.jsonshow a "retrospective" link in the task row🤖 Generated with Claude Code