Skip to content

Commit ce1d816

Browse files
committed
2 parents 511498d + e16f1e6 commit ce1d816

7 files changed

Lines changed: 37 additions & 28 deletions

File tree

.vscode/settings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"simpleCodingTimeTracker.health.eyeRestInterval": 20,
33
"simpleCodingTimeTracker.health.stretchInterval": 100,
4-
"simpleCodingTimeTracker.inactivityTimeout": 15000,
5-
"simpleCodingTimeTracker.focusTimeout": 18000
4+
"simpleCodingTimeTracker.inactivityTimeout": 2.5,
5+
"simpleCodingTimeTracker.focusTimeout": 3
66
}

CONTRIBUTING.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,6 @@ To compile the extension, run:
4747

4848
This will transpile the TypeScript files to JavaScript.
4949

50-
## Testing
51-
52-
To run the tests, use:
53-
`npm test`
54-
55-
Make sure to write tests for any new functionality you add.
56-
5750
## Creating a VSCode Package
5851

5952
To package the extension for distribution:

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ Simple Coding Time Tracker is a powerful extension for Visual Studio Code that h
2525
- Quick Reset: One-click reset for search filters
2626
- **Data Persistence**: Safely stores your time data for long-term analysis.
2727

28-
## Health Notification System
28+
## Time Tracking Details
29+
The extension tracks your coding time by monitoring file changes and user activity within Visual Studio Code. It uses a combination of timers and event listeners to ensure accurate tracking without impacting performance.
30+
31+
**📖 For detailed configuration, advanced features, and complete documentation, see the [Time Tracking Guide](https://github.com/twentyTwo/vsc-ext-coding-time-tracker/wiki/Time-Tracking) in our wiki.**
32+
33+
## Health Notification System Details
2934

3035
The extension includes a comprehensive health notification system to promote healthy coding habits and prevent strain-related issues.
3136

@@ -68,12 +73,12 @@ You can customize the extension's behavior through VS Code settings:
6873
1. Open VS Code Settings (Ctrl+, or Cmd+, on macOS)
6974
2. Search for "Simple Coding Time Tracker"
7075
3. Available settings:
71-
- **Inactivity Timeout**: How long to wait before stopping the timer when no activity is detected but you are focused on VS Code (in seconds)
72-
- Default: 150 seconds (2.5 minutes)
76+
- **Inactivity Timeout**: How long to wait before stopping the timer when no activity is detected but you are focused on VS Code (in minutes)
77+
- Default: 2.5 minutes
7378
- Lower values will stop tracking sooner when you're not actively coding
7479
- Higher values will continue tracking for longer during breaks
75-
- **Focus Timeout**: How long to continue tracking after VS Code loses focus (in seconds)
76-
- Default: 180 seconds (3 minutes)
80+
- **Focus Timeout**: How long to continue tracking after VS Code loses focus (in minutes)
81+
- Default: 3 minutes
7782
- Determines how long to keep tracking when you switch to other applications
7883
- Useful for when you're referencing documentation or testing your application
7984
- **Health Notifications**: Configure health reminder settings

package.json

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,17 @@
2222
"properties": {
2323
"simpleCodingTimeTracker.inactivityTimeout": {
2424
"type": "number",
25-
"default": 150,
26-
"description": "Pause tracking if there is no keyboard or mouse activity in VS Code for this many seconds."
25+
"default": 2.5,
26+
"minimum": 0.5,
27+
"maximum": 60,
28+
"description": "Pause tracking if there is no keyboard or mouse activity in VS Code for this many minutes."
2729
},
2830
"simpleCodingTimeTracker.focusTimeout": {
2931
"type": "number",
30-
"default": 180,
31-
"description": "If you switch away from VS Code, continue counting as coding time for up to this many seconds before pausing."
32+
"default": 3,
33+
"minimum": 0.5,
34+
"maximum": 60,
35+
"description": "If you switch away from VS Code, continue counting as coding time for up to this many minutes before pausing."
3236
},
3337
"simpleCodingTimeTracker.health.enableNotifications": {
3438
"type": "boolean",
@@ -43,16 +47,22 @@
4347
"simpleCodingTimeTracker.health.eyeRestInterval": {
4448
"type": "number",
4549
"default": 20,
50+
"minimum": 5,
51+
"maximum": 120,
4652
"description": "Interval for eye rest reminders (minutes) - Based on 20-20-20 rule"
4753
},
4854
"simpleCodingTimeTracker.health.stretchInterval": {
4955
"type": "number",
5056
"default": 30,
57+
"minimum": 10,
58+
"maximum": 180,
5159
"description": "Interval for stretch reminders (minutes) - Recommended for posture health"
5260
},
5361
"simpleCodingTimeTracker.health.breakThreshold": {
5462
"type": "number",
55-
"default": 120,
63+
"default": 90,
64+
"minimum": 30,
65+
"maximum": 480,
5666
"description": "Coding duration before suggesting a break (minutes) - Based on ultradian rhythms"
5767
}
5868
}

src/healthNotifications.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ export class HealthNotificationManager {
2727
const config = vscode.workspace.getConfiguration('simpleCodingTimeTracker');
2828
this.settings = {
2929
eyeRestInterval: config.get('health.eyeRestInterval', 20),
30-
stretchInterval: config.get('health.stretchInterval', 45),
31-
breakThreshold: config.get('health.breakThreshold', 120),
30+
stretchInterval: config.get('health.stretchInterval', 30),
31+
breakThreshold: config.get('health.breakThreshold', 90),
3232
enableNotifications: config.get('health.enableNotifications', true),
3333
modalNotifications: config.get('health.modalNotifications', true)
3434
};
@@ -204,7 +204,7 @@ export class HealthNotificationManager {
204204
}
205205

206206
const result = await vscode.window.showErrorMessage(
207-
'🚨 HEALTH BREAK REQUIRED: You\'ve been coding for 2+ hours! Take a break now for your health.',
207+
'🚨 HEALTH BREAK REQUIRED: You\'ve been coding intensely! Take a break now for your health.',
208208
{ modal: this.settings.modalNotifications },
209209
doneAction,
210210
remindAction

src/healthNotifications.ts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ All notifications are designed to be **persistent** rather than auto-dismissing:
111111
The system uses three independent timers:
112112

113113
1. **Eye Rest Timer**: Triggers every 20 minutes (configurable)
114-
2. **Stretch Timer**: Triggers every 45 minutes (configurable)
115-
3. **Break Timer**: Triggers every 120 minutes (configurable)
114+
2. **Stretch Timer**: Triggers every 30 minutes (configurable)
115+
3. **Break Timer**: Triggers every 90 minutes (configurable)
116116

117117
Each timer is implemented using `setTimeout` with automatic restart:
118118

src/timeTracker.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ export class TimeTracker implements vscode.Disposable {
2222
private saveIntervalSeconds: number = 5;
2323
private lastCursorActivity: number = Date.now();
2424
private cursorInactivityTimeout: NodeJS.Timeout | null = null;
25-
private inactivityTimeoutSeconds: number = 180;
25+
private inactivityTimeoutSeconds: number = 150; // Default 2.5 minutes * 60 = 150 seconds
2626
private focusTimeoutHandle: NodeJS.Timeout | null = null;
27-
private focusTimeoutSeconds: number = 180;
27+
private focusTimeoutSeconds: number = 180; // Default 3 minutes * 60 = 180 seconds
2828
private gitWatcher: GitWatcher | null = null;
2929
private branchCheckInterval: NodeJS.Timeout | null = null;
3030
private isCheckingBranch: boolean = false;
@@ -124,8 +124,9 @@ export class TimeTracker implements vscode.Disposable {
124124
public updateConfiguration() {
125125
const config = vscode.workspace.getConfiguration('simpleCodingTimeTracker');
126126
// this.saveIntervalSeconds = config.get('saveInterval', 5);
127-
this.inactivityTimeoutSeconds = config.get('inactivityTimeout', 180);
128-
this.focusTimeoutSeconds = config.get('focusTimeout', 180);
127+
// Convert from minutes to seconds for internal use
128+
this.inactivityTimeoutSeconds = config.get('inactivityTimeout', 2.5) * 60;
129+
this.focusTimeoutSeconds = config.get('focusTimeout', 3) * 60;
129130

130131
// Update health notification settings
131132
if (this.healthManager) {

0 commit comments

Comments
 (0)