MCPcopy
hub / github.com/callumalpass/tasknotes / updateSessionMeta

Method updateSessionMeta

src/views/PomodoroView.ts:1162–1203  ·  view source on GitHub ↗
(state: PomodoroState)

Source from the content-addressed store, hash-verified

1160 }
1161
1162 private updateSessionMeta(state: PomodoroState): void {
1163 if (!this.sessionMetaDisplay) {
1164 return;
1165 }
1166
1167 const formattedTime = formatPomodoroTime(state.timeRemaining, { padMinutes: false });
1168 let text: string;
1169
1170 if (state.currentSession) {
1171 const sessionLabel = this.getSessionTypeLabel(state.currentSession.type);
1172 if (state.isRunning) {
1173 const projectedEndTime = formatTime(
1174 new Date(getProjectedPomodoroEndTimeMs(state.timeRemaining)),
1175 this.plugin.settings.calendarViewSettings.timeFormat
1176 );
1177 text = this.t("views.pomodoro.meta.running", {
1178 time: formattedTime,
1179 endTime: projectedEndTime,
1180 });
1181 } else {
1182 text = this.t("views.pomodoro.meta.paused", {
1183 type: sessionLabel,
1184 time: formattedTime,
1185 });
1186 }
1187 } else if (
1188 state.nextSessionType === "short-break" ||
1189 state.nextSessionType === "long-break"
1190 ) {
1191 text = this.t("views.pomodoro.meta.breakReady", {
1192 type: this.getSessionTypeLabel(state.nextSessionType),
1193 time: formattedTime,
1194 });
1195 } else {
1196 text = this.t("views.pomodoro.meta.ready", {
1197 time: formattedTime,
1198 count: this.todaysPomodoros,
1199 });
1200 }
1201
1202 this.sessionMetaDisplay.textContent = text;
1203 }
1204
1205 private getSessionTypeLabel(type: PomodoroSession["type"]): string {
1206 if (type === "work") {

Callers 4

updateDisplayMethod · 0.95
commitTimerEditMethod · 0.95
updateStatsMethod · 0.95
adjustSessionTimeMethod · 0.95

Calls 5

getSessionTypeLabelMethod · 0.95
tMethod · 0.95
formatPomodoroTimeFunction · 0.90
formatTimeFunction · 0.90

Tested by

no test coverage detected