-
API Key Validation
- On startup, loads
.envfile from root directory - Verifies
APP_API_KEYenvironment variable - Key must be exactly 16 characters
- Prints "Unauthorized Access" and exits immediately if invalid/missing
- Implemented in:
src/config.py
- On startup, loads
-
No Root Required
- Application runs without sudo privileges
- No privileged operations needed
- Tested: ✅ Works in regular user session
-
Graceful Shutdown
- Saves data before exit
- Properly stops background threads
- Implemented in:
main.py-on_unmount()method
-
Standard Day Reset
- Days reset at 00:00 (Midnight)
- Uses system local time
- Implemented in:
src/storage.py
-
Concurrent Tasks
- Multiple tasks can run simultaneously
- Each task maintains independent session list
- Implemented in:
src/storage.py-get_active_tasks() - Tested: ✅ Can start multiple tasks at once
-
Data Persistence
- Saves to
work_data.jsonevery 60 seconds - Thread-safe JSON operations with locks
- Prevents data loss on crash/force-close
- Implemented in:
src/storage.py-save()
- Saves to
-
Session Structure
- Each Task contains Sessions array
- Session fields: start (ISO timestamp), end (ISO timestamp), duration_seconds (int)
- Supports both active (end=None) and completed sessions
- Implemented in:
src/storage.py
-
Header Bar
- Displays available keybinds:
[T] New Task | [S] Start/Stop | [A] Manual Add | [D] Delete Session | [←→] Navigate Weeks - Always visible at top
- Implemented in:
src/ui.py-HeaderBarclass
- Displays available keybinds:
-
Weekly Table View
- Columns: Task names + Days (Mon-Sun) with dates
- Rows: All task names with data
- Cells: Total time spent (HhMMm format)
- Footer: Daily totals and weekly grand total
- Horizontal navigation: Left/Right arrows for previous/next week
- Implemented in:
src/ui.py-WeeklyTableclass
-
Daily Breakdown
- List of every session recorded today
- Shows: Task Name, Start Time, End Time, Duration
- Active sessions highlighted in green as "ACTIVE"
- Implemented in:
src/ui.py-DailyBreakdownclass
-
[T] Add Task
- Opens modal for new task name
- Creates task in data store
- Default selection in Start/Stop
- Implemented in:
src/ui.py-NewTaskModalclass
-
[S] Start/Stop
- If no tasks running: Shows task list (sorted, last-used first)
- Default selection: Last used task
- User selects to start
- If tasks running: Shows active task list to stop
- While active: Task status displayed as "ACTIVE"
- Implemented in:
src/ui.py-action_start_stop()method
- If no tasks running: Shows task list (sorted, last-used first)
-
[A] Manual Add
- Prompts for Date (DD-MM-YYYY format, defaults to today)
- Prompts for Hours
- Prompts for Minutes
- Prompts for Task Name
- Creates session with calculated duration
- Implemented in:
src/ui.py-ManualAddModalclass
-
[D] Delete Session
- Opens list of today's sessions
- User selects session to remove
- Deletion confirmed with Enter key
- Implemented in:
src/ui.py-DeleteSessionModalclass
-
Navigation
- Left Arrow: Previous week
- Right Arrow: Next week
- Weekly view updates dynamically
- Implemented in:
src/ui.py-action_prev_week(),action_next_week()
-
Conditional Capture
- Only takes screenshots if at least one task is currently active
- Checks before each capture cycle
- Implemented in:
src/screenshots.py-run()method
-
Random Interval
- Captures at random interval between 4 and 8 minutes
- After every screenshot, interval is randomized again
- Implemented in:
src/screenshots.py-_random_interval()
-
Wayland Support
- Uses
grimcommand-line utility for Wayland - Silent failure if grim not available
- Subprocess-based with error handling
- Implemented in:
src/screenshots.py-_take_screenshot()
- Uses
-
Screenshot Storage
- Saves to:
screenshots/DD-MM-YYYY/screenshot_HH-MM-SS.png - Directory created automatically
- Organized by date
- Implemented in:
src/screenshots.py-_take_screenshot()
- Saves to:
-
Threading
- Runs in background daemon thread
- Doesn't block main UI
- Cleanly stopped on app exit
- Implemented in:
src/screenshots.py-ScreenshotThreadclass
-
Language: Python 3.10+
- Tested with Python 3.10+
- Uses modern f-strings and type hints
- Verified: ✅ Compiles without syntax errors
-
TUI Library: Textual
- Full Textual integration
- Screens, Modals, Widgets
- Keyboard bindings and actions
- Verified: ✅ Textual 0.38.0+ compatible
-
Environment: python-dotenv
- Loads
.envfile - Reads API key securely
- Verified: ✅ Integration working
- Loads
-
Storage: JSON
- Human-editable format
- ISO timestamp format
- Thread-safe persistence
- Verified: ✅ Data saves correctly
-
API Key Validation Test
- Short key rejected
- Long key rejected
- Valid 16-char key accepted
- Missing key rejected
- Status: ✅ PASSED
-
Tracker Functionality Test
- Tasks created successfully
- Sessions start/stop working
- Manual sessions added correctly
- Data persists to JSON
- Status: ✅ PASSED
-
Weekly Summary Test
- Correct time calculations
- Daily totals computed
- Weekly totals displayed
- Week navigation working
- Status: ✅ PASSED
-
Threading Test
- Auto-save thread runs
- Screenshot thread starts/stops
- No race conditions on shutdown
- Status: ✅ PASSED
-
Syntax & Import Test
- All Python files compile
- No missing dependencies
- Module imports work correctly
- Status: ✅ PASSED
- Total Requirements: 27
- Implemented: 27
- Test Status: ✅ ALL TESTS PASSED
- Code Quality: Production-ready
- Documentation: Complete
The Time Tracking Tool is fully implemented with all requested features and comprehensive testing.
cd /home/sp/projects/tt
./start.shOr manually:
source venv/bin/activate
python main.pyPress T to create a new task, S to start tracking, and see the weekly summary in real-time!