Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2800a7507e |
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"permissions": {
|
||||
"allow": [
|
||||
"Bash(npm run build:*)"
|
||||
],
|
||||
"deny": [],
|
||||
"ask": []
|
||||
}
|
||||
}
|
||||
6
.gitignore
vendored
6
.gitignore
vendored
@@ -17,4 +17,8 @@ package-lock.json
|
||||
Thumbs.db
|
||||
|
||||
# Obsidian
|
||||
data.json
|
||||
data.json
|
||||
|
||||
# Development/Documentation (not for distribution)
|
||||
RELEASE-GUIDE.md
|
||||
.claude/
|
||||
@@ -4,7 +4,7 @@ A powerful task management and focus timer plugin for [Obsidian](https://obsidia
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
## 🎯 Overview
|
||||
|
||||
|
||||
10
main.js
10
main.js
@@ -595,6 +595,9 @@ var FocusTaskPlugin = class extends import_obsidian3.Plugin {
|
||||
const loaded = await this.loadData();
|
||||
this.data = Object.assign({}, DEFAULT_DATA, (loaded == null ? void 0 : loaded.data) || {});
|
||||
this.settings = Object.assign({}, DEFAULT_SETTINGS, (loaded == null ? void 0 : loaded.settings) || {});
|
||||
if (!this.settings.lists || this.settings.lists.length === 0) {
|
||||
this.settings.lists = DEFAULT_SETTINGS.lists;
|
||||
}
|
||||
this.focusSecondsToday = (this.data.totalFocusMinutesToday || 0) * 60;
|
||||
}
|
||||
async saveAllData() {
|
||||
@@ -785,7 +788,7 @@ var FocusTaskPlugin = class extends import_obsidian3.Plugin {
|
||||
this.isBreakMode = false;
|
||||
this.currentTimerSeconds = this.settings.pomodoroWorkMinutes * 60;
|
||||
this.isTimerRunning = true;
|
||||
this.secondsWorkedOnCurrentTask = task.actualMinutes * 60;
|
||||
this.secondsWorkedOnCurrentTask = Math.floor(task.actualMinutes * 60);
|
||||
this.timerStartTimestamp = Date.now();
|
||||
this.pausedTimeRemaining = this.currentTimerSeconds;
|
||||
this.refreshView();
|
||||
@@ -794,7 +797,10 @@ var FocusTaskPlugin = class extends import_obsidian3.Plugin {
|
||||
this.currentTimerSeconds--;
|
||||
if (!this.isBreakMode) {
|
||||
this.secondsWorkedOnCurrentTask++;
|
||||
task.actualMinutes = Math.floor(this.secondsWorkedOnCurrentTask / 60);
|
||||
const actualMinutes = Math.floor(this.secondsWorkedOnCurrentTask / 60);
|
||||
if (task.actualMinutes !== actualMinutes) {
|
||||
task.actualMinutes = actualMinutes;
|
||||
}
|
||||
this.focusSecondsToday++;
|
||||
}
|
||||
this.updateStatusBar();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "focus-task",
|
||||
"name": "Focus Task",
|
||||
"version": "1.0.6",
|
||||
"version": "1.0.7",
|
||||
"minAppVersion": "0.15.0",
|
||||
"description": "A Blitzit-inspired task management and focus timer plugin. Plan your day, track time with Pomodoro technique, and crush your tasks with satisfying checkoffs.",
|
||||
"author": "Crib",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "focus-task",
|
||||
"version": "1.0.6",
|
||||
"version": "1.0.7",
|
||||
"description": "A Blitzit-inspired task management and focus timer plugin for Obsidian",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
||||
19
src/main.ts
19
src/main.ts
@@ -116,8 +116,17 @@ export default class FocusTaskPlugin extends Plugin {
|
||||
|
||||
async loadAllData() {
|
||||
const loaded = await this.loadData();
|
||||
|
||||
// Merge loaded data with defaults (defaults first, then override with loaded)
|
||||
// This ensures new fields get default values even for existing installs
|
||||
this.data = Object.assign({}, DEFAULT_DATA, loaded?.data || {});
|
||||
this.settings = Object.assign({}, DEFAULT_SETTINGS, loaded?.settings || {});
|
||||
|
||||
// Ensure lists array exists and has at least the default lists
|
||||
if (!this.settings.lists || this.settings.lists.length === 0) {
|
||||
this.settings.lists = DEFAULT_SETTINGS.lists;
|
||||
}
|
||||
|
||||
// Initialize seconds from stored minutes
|
||||
this.focusSecondsToday = (this.data.totalFocusMinutesToday || 0) * 60;
|
||||
}
|
||||
@@ -369,7 +378,8 @@ export default class FocusTaskPlugin extends Plugin {
|
||||
this.isTimerRunning = true;
|
||||
|
||||
// Initialize from existing actual time to preserve progress across breaks
|
||||
this.secondsWorkedOnCurrentTask = task.actualMinutes * 60;
|
||||
// Store as seconds for precision
|
||||
this.secondsWorkedOnCurrentTask = Math.floor(task.actualMinutes * 60);
|
||||
|
||||
// Set timestamp for background tracking (pomodoro countdown mode)
|
||||
this.timerStartTimestamp = Date.now();
|
||||
@@ -384,7 +394,12 @@ export default class FocusTaskPlugin extends Plugin {
|
||||
|
||||
if (!this.isBreakMode) {
|
||||
this.secondsWorkedOnCurrentTask++;
|
||||
task.actualMinutes = Math.floor(this.secondsWorkedOnCurrentTask / 60);
|
||||
// Calculate actual minutes from total seconds worked
|
||||
const actualMinutes = Math.floor(this.secondsWorkedOnCurrentTask / 60);
|
||||
// Only update if changed to avoid unnecessary updates
|
||||
if (task.actualMinutes !== actualMinutes) {
|
||||
task.actualMinutes = actualMinutes;
|
||||
}
|
||||
// Increment focus time by 1 second
|
||||
this.focusSecondsToday++;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"1.0.4": "0.15.0",
|
||||
"1.0.5": "0.15.0",
|
||||
"1.0.6": "0.15.0"
|
||||
"1.0.6": "0.15.0",
|
||||
"1.0.7": "0.15.0"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user