Archived
Show Tasks tab badge only for unavailable config
Drop the task-count badge so the Tasks tab no longer draws attention during normal use. Keep the '!' badge for when the tasks config exists but cannot be loaded, which is the only state that warrants attention.
This commit is contained in:
@@ -23,11 +23,9 @@ export function defineTasksPanelElement(): void {
|
||||
if (!customElements.get(tasksPanelTagName)) customElements.define(tasksPanelTagName, PiWebTasksPanel);
|
||||
}
|
||||
|
||||
export function tasksPanelBadge(context: WorkspacePanelContext): string | number | undefined {
|
||||
export function tasksPanelBadge(context: WorkspacePanelContext): string | undefined {
|
||||
const state = getCachedWorkspaceConfig(context);
|
||||
if (state?.kind === "unavailable") return "!";
|
||||
if (state?.kind === "loaded" && state.config.tasks.length > 0) return state.config.tasks.length;
|
||||
return undefined;
|
||||
return state?.kind === "unavailable" ? "!" : undefined;
|
||||
}
|
||||
|
||||
class PiWebTasksPanel extends HTMLElement {
|
||||
|
||||
Reference in New Issue
Block a user