* Render the status bar with tracked tasks information
(trackedTasks: TaskInfo[])
| 171 | * Render the status bar with tracked tasks information |
| 172 | */ |
| 173 | private renderStatusBar(trackedTasks: TaskInfo[]): void { |
| 174 | if (!this.statusBarElement) return; |
| 175 | |
| 176 | this.currentTrackedTasks = [...trackedTasks]; |
| 177 | const count = trackedTasks.length; |
| 178 | |
| 179 | if (count === 0) { |
| 180 | this.stopElapsedTicker(); |
| 181 | // Hide status bar when no tasks are being tracked |
| 182 | this.statusBarElement.classList.remove( |
| 183 | "tn-static-display-block-2a1b75c9", |
| 184 | "tn-static-display-flex-4d51fc62", |
| 185 | "tn-static-display-flex-75816cae", |
| 186 | "tn-static-display-flex-8bb39979", |
| 187 | "tn-static-display-inline-block-60e32dcb", |
| 188 | "tn-static-display-inline-cccfa456", |
| 189 | "tn-static-display-inline-flex-f984c520", |
| 190 | "tn-static-min-height-800px-997b4c8c" |
| 191 | ); |
| 192 | this.statusBarElement.classList.add("tn-static-display-none-6b99de8b"); |
| 193 | return; |
| 194 | } |
| 195 | |
| 196 | // Show status bar |
| 197 | this.startElapsedTicker(); |
| 198 | this.statusBarElement.classList.remove( |
| 199 | "tn-static-display-block-2a1b75c9", |
| 200 | "tn-static-display-flex-4d51fc62", |
| 201 | "tn-static-display-flex-75816cae", |
| 202 | "tn-static-display-flex-8bb39979", |
| 203 | "tn-static-display-inline-block-60e32dcb", |
| 204 | "tn-static-display-inline-cccfa456", |
| 205 | "tn-static-display-inline-flex-f984c520", |
| 206 | "tn-static-display-none-6b99de8b", |
| 207 | "tn-static-min-height-800px-997b4c8c" |
| 208 | ); |
| 209 | this.statusBarElement.style.removeProperty("display"); |
| 210 | |
| 211 | // Clear previous content |
| 212 | this.statusBarElement.empty(); |
| 213 | |
| 214 | // Create icon |
| 215 | const iconEl = this.statusBarElement.createEl("span", { |
| 216 | cls: "tasknotes-status-icon", |
| 217 | }); |
| 218 | setIcon(iconEl, "timer"); |
| 219 | |
| 220 | // Create text content |
| 221 | const textEl = this.statusBarElement.createEl("span", { |
| 222 | cls: "tasknotes-status-text", |
| 223 | }); |
| 224 | |
| 225 | if (count === 1) { |
| 226 | const task = trackedTasks[0]; |
| 227 | const truncatedTitle = |
| 228 | task.title.length > 30 ? task.title.substring(0, 30) + "..." : task.title; |
| 229 | const elapsed = this.formatElapsedDuration(this.getActiveElapsedMs(task)); |
| 230 | textEl.setText(`Tracking: ${truncatedTitle} (${elapsed})`); |
no test coverage detected