-
Notifications
You must be signed in to change notification settings - Fork 0
Add todolist workflow with freeze/archive and DB migrations #30
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -4,7 +4,7 @@ | |||||
| * 职责:认证守卫 + useRealtimeSync 挂载 + 页面路由 | ||||||
| */ | ||||||
|
|
||||||
| import { useState, useCallback, useEffect } from 'react'; | ||||||
| import { useState, useCallback, useEffect, useMemo } from 'react'; | ||||||
| import { useAuth } from '../hooks/useAuth'; | ||||||
| import { useRealtimeSync } from '../hooks/useRealtimeSync'; | ||||||
| import { useTheme, type ThemePreset } from '../hooks/useTheme'; | ||||||
|
|
@@ -14,11 +14,22 @@ import { | |||||
| fetchCheckinRecordsByDate, | ||||||
| insertCheckinTemplate, | ||||||
| upsertCheckinRecord, | ||||||
| ensureSystemTodoProject, | ||||||
| } from '../lib/api'; | ||||||
| import { ProjectList } from './ProjectList'; | ||||||
| import { ProjectDetail } from './ProjectDetail'; | ||||||
| import { ProjectEditModal } from './ProjectEditModal'; | ||||||
| import type { CheckinTemplate } from '../types'; | ||||||
| import { TaskEditModal } from './TaskEditModal'; | ||||||
| import { TodoList } from './TodoList'; | ||||||
| import type { CheckinTemplate, TodoItem, Project, TaskStatus } from '../types'; | ||||||
| import { useProjectsStore } from '../store/useProjectsStore'; | ||||||
| import { deriveTaskStatus } from '../types'; | ||||||
| import { useTaskActions } from '../hooks/useActions'; | ||||||
|
|
||||||
| function isTempProject(project: Project | null | undefined): boolean { | ||||||
| if (!project) return false; | ||||||
| return project.is_system || project.category === 'system' || project.name === '临时'; | ||||||
| } | ||||||
|
|
||||||
| export default function App() { | ||||||
| const { user, loading: authLoading, signIn, signUp, signOut } = useAuth(); | ||||||
|
|
@@ -28,6 +39,63 @@ export default function App() { | |||||
| // 挂载 Realtime 同步(用户变更时自动 cleanup + 重建) | ||||||
| useRealtimeSync(user?.id); | ||||||
|
|
||||||
| // 从 store 获取最基础的数据 | ||||||
| const { optimisticInsertProject } = useProjectsStore(); | ||||||
|
||||||
| const { optimisticInsertProject } = useProjectsStore(); | |
| const optimisticInsertProject = useProjectsStore((s) => s.optimisticInsertProject); |
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.
isTempProjecthelper is duplicated here and inProjectList.tsxwith slightly different typing. Consider moving it to a shared util (ortypes) to ensure consistent “temp/system project” detection logic across the app and avoid future drift.