Release v1.1.4: Pomodoro & Stopwatch Mode Streamlining
Streamlined timer modes with bug fixes and code cleanup: Bug Fixes: - Fixed "POMODORO COMPLETE" showing in stopwatch mode - Fixed break timer showing pomodoro notices in stopwatch mode - Fixed pause/resume resetting timer to 0 in stopwatch mode - Fixed "Continue Working" button appearing in stopwatch mode - Fixed "Skip Break" button changing to "Continue" incorrectly Improvements: - Stopwatch mode now completely independent from pomodoro workflow - Removed break functionality from stopwatch mode (only Pause, Complete, Stop buttons) - Stopwatch mode maintains "FOCUSING ON" label throughout session - Cleaned up dead code (wasStopwatchBeforeBreak flag and related logic) - Simplified break resume logic (always returns to pomodoro mode) Technical: - Added isStopwatchMode flag for proper mode tracking - Fixed toggleTimer to handle stopwatch count-up vs pomodoro countdown - Removed unnecessary break integration code from stopwatch workflow
This commit is contained in:
14
src/view.ts
14
src/view.ts
@@ -154,7 +154,13 @@ export class ImmerseView extends ItemView {
|
||||
const breakLabel = this.plugin.currentTimerSeconds > 0 ? '☕ BREAK TIME' : '✨ BREAK COMPLETE';
|
||||
activeCard.createEl('div', { cls: 'immerse-active-label', text: breakLabel });
|
||||
} else {
|
||||
const workLabel = this.plugin.currentTimerSeconds > 0 ? '🎯 FOCUSING ON' : '🍅 POMODORO COMPLETE';
|
||||
// Determine label based on whether timer is active and mode (stopwatch vs pomodoro)
|
||||
let workLabel: string;
|
||||
if (this.plugin.currentTimerSeconds > 0 || this.plugin.isStopwatchMode) {
|
||||
workLabel = '🎯 FOCUSING ON';
|
||||
} else {
|
||||
workLabel = '🍅 POMODORO COMPLETE';
|
||||
}
|
||||
activeCard.createEl('div', { cls: 'immerse-active-label', text: workLabel });
|
||||
}
|
||||
|
||||
@@ -234,8 +240,8 @@ export class ImmerseView extends ItemView {
|
||||
}
|
||||
} else {
|
||||
// Work mode controls
|
||||
if (this.plugin.currentTimerSeconds > 0) {
|
||||
// Work session still running
|
||||
if (this.plugin.currentTimerSeconds > 0 || this.plugin.isStopwatchMode) {
|
||||
// Work session still running (or stopwatch mode active)
|
||||
this.pauseBtnEl = controls.createEl('button', { cls: 'immerse-btn immerse-btn-secondary' });
|
||||
this.pauseBtnEl.innerHTML = this.plugin.isTimerRunning ? '⏸ Pause' : '▶ Resume';
|
||||
this.pauseBtnEl.addEventListener('click', () => this.plugin.toggleTimer());
|
||||
@@ -248,7 +254,7 @@ export class ImmerseView extends ItemView {
|
||||
stopBtn.innerHTML = '✕ Stop';
|
||||
stopBtn.addEventListener('click', () => this.plugin.stopTimer());
|
||||
} else {
|
||||
// Work session finished - show break and completion options
|
||||
// Pomodoro session finished - show break and completion options
|
||||
const startBreakBtn = controls.createEl('button', { cls: 'immerse-btn immerse-btn-secondary' });
|
||||
startBreakBtn.innerHTML = '☕ Start Break';
|
||||
startBreakBtn.addEventListener('click', () => this.plugin.startBreak());
|
||||
|
||||
Reference in New Issue
Block a user