From 2800a7507ec951a73fe4f5c210a667e3234396d5 Mon Sep 17 00:00:00 2001 From: Sayuop Date: Sun, 23 Nov 2025 15:06:12 +0100 Subject: [PATCH] Release v1.0.7: General bugfixes --- .claude/settings.local.json | 9 --------- .gitignore | 6 +++++- README.md | 2 +- main.js | 10 ++++++++-- manifest.json | 2 +- package.json | 2 +- src/main.ts | 19 +++++++++++++++++-- versions.json | 3 ++- 8 files changed, 35 insertions(+), 18 deletions(-) delete mode 100644 .claude/settings.local.json diff --git a/.claude/settings.local.json b/.claude/settings.local.json deleted file mode 100644 index 2206350..0000000 --- a/.claude/settings.local.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "permissions": { - "allow": [ - "Bash(npm run build:*)" - ], - "deny": [], - "ask": [] - } -} diff --git a/.gitignore b/.gitignore index 66ca05e..12afdff 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,8 @@ package-lock.json Thumbs.db # Obsidian -data.json \ No newline at end of file +data.json + +# Development/Documentation (not for distribution) +RELEASE-GUIDE.md +.claude/ \ No newline at end of file diff --git a/README.md b/README.md index 3d8f41a..dc76ff2 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ A powerful task management and focus timer plugin for [Obsidian](https://obsidia ![Focus Task Banner](https://img.shields.io/badge/Obsidian-Plugin-7c3aed?style=for-the-badge&logo=obsidian&logoColor=white) ![License](https://img.shields.io/badge/License-MIT-green?style=for-the-badge) -![Version](https://img.shields.io/badge/Version-1.0.6-blue?style=for-the-badge) +![Version](https://img.shields.io/badge/Version-1.0.7-blue?style=for-the-badge) ## 🎯 Overview diff --git a/main.js b/main.js index caa4691..b491147 100644 --- a/main.js +++ b/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(); diff --git a/manifest.json b/manifest.json index cc2e6ba..4eb6f3f 100644 --- a/manifest.json +++ b/manifest.json @@ -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", diff --git a/package.json b/package.json index 87b77c0..7788223 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/src/main.ts b/src/main.ts index 9795333..9770864 100644 --- a/src/main.ts +++ b/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++; } diff --git a/versions.json b/versions.json index baedea4..87c169d 100644 --- a/versions.json +++ b/versions.json @@ -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" }