feat(focus-mode): show coffee cup icon during breaks

Display the free_breakfast icon in the header focus button when a break
is active, along with the remaining break time and progress circle.
Closes #5957
This commit is contained in:
Johannes Millan 2026-01-11 11:44:22 +01:00
parent cc5063a0d3
commit b2be64ef7b
2 changed files with 13 additions and 4 deletions

View file

@ -14,7 +14,11 @@
(contextmenu)="openFocusSessionDialog(); $event.preventDefault()"
(longPress)="openFocusSessionDialog()"
>
<mat-icon>center_focus_strong</mat-icon>
@if (isBreakActive()) {
<mat-icon>free_breakfast</mat-icon>
} @else {
<mat-icon>center_focus_strong</mat-icon>
}
</button>
@if (runningTimeMs(); as runningMs) {

View file

@ -49,6 +49,7 @@ export class FocusButtonComponent {
});
readonly isSessionRunning = this.focusModeService.isSessionRunning;
readonly isBreakActive = this.focusModeService.isBreakActive;
readonly progress = this.focusModeService.progress;
readonly mode = this.focusModeService.mode;
readonly FocusModeMode = FocusModeMode;
@ -62,7 +63,9 @@ export class FocusButtonComponent {
return shortcut ? ` [${shortcut}]` : '';
});
readonly circleVisible = computed(() => this.isSessionRunning());
readonly circleVisible = computed(
() => this.isSessionRunning() || this.isBreakActive(),
);
readonly isCountdownMode = computed(() => {
const mode = this.mode();
@ -73,7 +76,8 @@ export class FocusButtonComponent {
if (!this.circleVisible()) {
return null;
}
if (this.isCountdownMode()) {
// Show progress for both work sessions and breaks in countdown modes
if (this.isCountdownMode() || this.isBreakActive()) {
const progress = this.progress();
return typeof progress === 'number' ? Math.min(100, Math.max(0, progress)) : 0;
}
@ -90,7 +94,8 @@ export class FocusButtonComponent {
if (!this.circleVisible()) {
return null;
}
if (this.isCountdownMode()) {
// Breaks always use countdown
if (this.isBreakActive() || this.isCountdownMode()) {
const remaining = this.focusModeService.timeRemaining();
return typeof remaining === 'number' ? Math.max(0, remaining) : 0;
}