Release v1.0.7: General bugfixes

This commit is contained in:
2025-11-23 15:06:12 +01:00
parent 2f861c2fcb
commit 5c5fbc442e
8 changed files with 35 additions and 18 deletions

View File

@@ -1,9 +0,0 @@
{
"permissions": {
"allow": [
"Bash(npm run build:*)"
],
"deny": [],
"ask": []
}
}

6
.gitignore vendored
View File

@@ -17,4 +17,8 @@ package-lock.json
Thumbs.db Thumbs.db
# Obsidian # Obsidian
data.json data.json
# Development/Documentation (not for distribution)
RELEASE-GUIDE.md
.claude/

View File

@@ -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) ![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) ![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 ## 🎯 Overview

10
main.js
View File

@@ -595,6 +595,9 @@ var FocusTaskPlugin = class extends import_obsidian3.Plugin {
const loaded = await this.loadData(); const loaded = await this.loadData();
this.data = Object.assign({}, DEFAULT_DATA, (loaded == null ? void 0 : loaded.data) || {}); this.data = Object.assign({}, DEFAULT_DATA, (loaded == null ? void 0 : loaded.data) || {});
this.settings = Object.assign({}, DEFAULT_SETTINGS, (loaded == null ? void 0 : loaded.settings) || {}); 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; this.focusSecondsToday = (this.data.totalFocusMinutesToday || 0) * 60;
} }
async saveAllData() { async saveAllData() {
@@ -785,7 +788,7 @@ var FocusTaskPlugin = class extends import_obsidian3.Plugin {
this.isBreakMode = false; this.isBreakMode = false;
this.currentTimerSeconds = this.settings.pomodoroWorkMinutes * 60; this.currentTimerSeconds = this.settings.pomodoroWorkMinutes * 60;
this.isTimerRunning = true; this.isTimerRunning = true;
this.secondsWorkedOnCurrentTask = task.actualMinutes * 60; this.secondsWorkedOnCurrentTask = Math.floor(task.actualMinutes * 60);
this.timerStartTimestamp = Date.now(); this.timerStartTimestamp = Date.now();
this.pausedTimeRemaining = this.currentTimerSeconds; this.pausedTimeRemaining = this.currentTimerSeconds;
this.refreshView(); this.refreshView();
@@ -794,7 +797,10 @@ var FocusTaskPlugin = class extends import_obsidian3.Plugin {
this.currentTimerSeconds--; this.currentTimerSeconds--;
if (!this.isBreakMode) { if (!this.isBreakMode) {
this.secondsWorkedOnCurrentTask++; 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.focusSecondsToday++;
} }
this.updateStatusBar(); this.updateStatusBar();

View File

@@ -1,7 +1,7 @@
{ {
"id": "focus-task", "id": "focus-task",
"name": "Focus Task", "name": "Focus Task",
"version": "1.0.6", "version": "1.0.7",
"minAppVersion": "0.15.0", "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.", "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", "author": "Crib",

View File

@@ -1,6 +1,6 @@
{ {
"name": "focus-task", "name": "focus-task",
"version": "1.0.6", "version": "1.0.7",
"description": "A Blitzit-inspired task management and focus timer plugin for Obsidian", "description": "A Blitzit-inspired task management and focus timer plugin for Obsidian",
"main": "main.js", "main": "main.js",
"scripts": { "scripts": {

View File

@@ -116,8 +116,17 @@ export default class FocusTaskPlugin extends Plugin {
async loadAllData() { async loadAllData() {
const loaded = await this.loadData(); 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.data = Object.assign({}, DEFAULT_DATA, loaded?.data || {});
this.settings = Object.assign({}, DEFAULT_SETTINGS, loaded?.settings || {}); 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 // Initialize seconds from stored minutes
this.focusSecondsToday = (this.data.totalFocusMinutesToday || 0) * 60; this.focusSecondsToday = (this.data.totalFocusMinutesToday || 0) * 60;
} }
@@ -369,7 +378,8 @@ export default class FocusTaskPlugin extends Plugin {
this.isTimerRunning = true; this.isTimerRunning = true;
// Initialize from existing actual time to preserve progress across breaks // 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) // Set timestamp for background tracking (pomodoro countdown mode)
this.timerStartTimestamp = Date.now(); this.timerStartTimestamp = Date.now();
@@ -384,7 +394,12 @@ export default class FocusTaskPlugin extends Plugin {
if (!this.isBreakMode) { if (!this.isBreakMode) {
this.secondsWorkedOnCurrentTask++; 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 // Increment focus time by 1 second
this.focusSecondsToday++; this.focusSecondsToday++;
} }

View File

@@ -1,5 +1,6 @@
{ {
"1.0.4": "0.15.0", "1.0.4": "0.15.0",
"1.0.5": "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"
} }