Skip to content

Conversation

@unvalley
Copy link
Owner

@unvalley unvalley commented May 31, 2025

Closes #27

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented May 31, 2025

Deploying ephe with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3775f70
Status: ✅  Deploy successful!
Preview URL: https://24b89593.ephe.pages.dev
Branch Preview URL: https://task-color.ephe.pages.dev

View logs

@unvalley unvalley requested a review from Copilot May 31, 2025 08:21
Copy link
Contributor

Copilot AI left a 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 calculateTaskOpacity thresholds and cleanupOldTasks behavior 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 to taskAgingEnabled could improve clarity and align with the taskAgingEnabledAtom naming.
export const useTaskAging = () => {

};

const getByDate = (filter?: DateFilter): Record<string, CompletedTask[]> => {
const getByDate = (filter?: DateFilter): Record<string, Task[]> => {
Copy link

Copilot AI May 31, 2025

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.

Copilot uses AI. Check for mistakes.
};

// Calculate task opacity based on age
const calculateTaskOpacity = (createdAt: number): number => {
Copy link

Copilot AI May 31, 2025

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.

Copilot uses AI. Check for mistakes.
@unvalley
Copy link
Owner Author

unvalley commented Jun 3, 2025

@claude review this?

@claude
Copy link

claude bot commented Jun 3, 2025

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Task aging

2 participants