-
-
Notifications
You must be signed in to change notification settings - Fork 12
feat: task aging #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: task aging #35
Conversation
Deploying ephe with
|
| Latest commit: |
3775f70
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://24b89593.ephe.pages.dev |
| Branch Preview URL: | https://task-color.ephe.pages.dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Introduces a "task aging" feature that visually fades incomplete tasks over time and lets users toggle it via UI and commands.
- Added a persistent atom and hook to manage task-aging state in localStorage.
- Integrated new menu items and command-palette entries to enable/disable aging.
- Implemented a CodeMirror plugin and extended task storage API to track creation times and compute opacity.
Reviewed Changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils/hooks/use-task-aging.ts | New hook and atom for persisting task-aging state |
| src/utils/constants.ts | Added LOCAL_STORAGE_KEYS for aging settings and times |
| src/features/menu/system-menu.tsx | Added a system-menu toggle for task aging |
| src/features/menu/command-menu.tsx | Command-palette entry and toast for toggling aging |
| src/features/history/use-history-data.ts | Switched from getAll to getCompletedTasks |
| src/features/editor/tasks/task-storage.ts | Expanded storage API: addTask, toggleTask, date groups |
| src/features/editor/codemirror/use-toc.ts | Updated inline comments to English |
| src/features/editor/codemirror/use-markdown-editor.ts | Hooked in taskAgingPlugin to the markdown editor |
| src/features/editor/codemirror/url-click.ts | Converted some imports to type-only |
| src/features/editor/codemirror/tasklist/task-aging.ts | New ViewPlugin implementing fading logic |
| src/features/editor/codemirror/tasklist/task-aging.test.ts | Basic smoke tests for the aging plugin |
| src/features/editor/codemirror/tasklist/index.ts | Exported aging plugin & updated default task handler |
| package.json | Bumped @biomejs/biome dev dependency |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (2)
src/features/editor/codemirror/tasklist/task-aging.test.ts:1
- Current tests cover plugin instantiation and basic registration but not opacity calculations or cleanup logic. Add tests for
calculateTaskOpacitythresholds andcleanupOldTasksbehavior to improve coverage.
import { describe, it, expect } from "vitest";
src/utils/hooks/use-task-aging.ts:7
- [nitpick] The hook returns
taskAgingMode, but renaming it totaskAgingEnabledcould improve clarity and align with thetaskAgingEnabledAtomnaming.
export const useTaskAging = () => {
| }; | ||
|
|
||
| const getByDate = (filter?: DateFilter): Record<string, CompletedTask[]> => { | ||
| const getByDate = (filter?: DateFilter): Record<string, Task[]> => { |
Copilot
AI
May 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function casts items with string timestamps back to Task[], but Task.completedAt and Task.createdAt expect numbers. Consider defining a separate return type for date‐grouped items or convert ISO strings back to numbers to keep types accurate.
| }; | ||
|
|
||
| // Calculate task opacity based on age | ||
| const calculateTaskOpacity = (createdAt: number): number => { |
Copilot
AI
May 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Hardcoded durations (10s, 20s, 40s) and opacities are currently used for testing. Extract these thresholds into named constants or configuration to improve clarity and allow customization.
|
@claude review this? |
|
Claude encountered an error after 0s —— View job I'll analyze this and get back to you. |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Closes #27