feat: add Pomodoro timer functionality with logging and project goals
- Implemented Pomodoro timer in the app, allowing users to start, pause, and stop sessions. - Added context for managing Pomodoro state and actions. - Integrated time logging for completed sessions to track productivity. - Enhanced project settings to include time goals and Pomodoro settings. - Created migration scripts to update the database schema for new project fields and time logs. - Updated UI components to display Pomodoro controls and project time summaries. - Added category filtering for projects in the project list view.
This commit is contained in:
@@ -16,6 +16,11 @@ class Project(Base):
|
||||
description = Column(Text, nullable=True)
|
||||
statuses = Column(JSON, nullable=False, default=DEFAULT_STATUSES)
|
||||
is_archived = Column(Boolean, default=False, nullable=False)
|
||||
category = Column(String(100), nullable=True)
|
||||
weekly_hours_goal = Column(Integer, nullable=True) # stored in minutes
|
||||
total_hours_goal = Column(Integer, nullable=True) # stored in minutes
|
||||
pomodoro_work_minutes = Column(Integer, nullable=True, default=25)
|
||||
pomodoro_break_minutes = Column(Integer, nullable=True, default=5)
|
||||
created_at = Column(DateTime, default=datetime.utcnow)
|
||||
updated_at = Column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow)
|
||||
|
||||
@@ -40,3 +45,17 @@ class Task(Base):
|
||||
|
||||
project = relationship("Project", back_populates="tasks")
|
||||
parent = relationship("Task", remote_side=[id], backref="subtasks")
|
||||
time_logs = relationship("TimeLog", back_populates="task", cascade="all, delete-orphan")
|
||||
|
||||
|
||||
class TimeLog(Base):
|
||||
__tablename__ = "time_logs"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
task_id = Column(Integer, ForeignKey("tasks.id"), nullable=False)
|
||||
minutes = Column(Integer, nullable=False)
|
||||
note = Column(Text, nullable=True)
|
||||
session_type = Column(String(50), default="manual") # 'pomodoro' | 'manual'
|
||||
logged_at = Column(DateTime, default=datetime.utcnow)
|
||||
|
||||
task = relationship("Task", back_populates="time_logs")
|
||||
|
||||
Reference in New Issue
Block a user