callumalpass_tasknotes/styles/status-bar.css
Callum Alpass b3097d5710 feat: status bar to display currently tracked tasks (#114)
Highlights:
• Introduces a new StatusBarService (src/services/StatusBarService.ts)
that:
  – Creates and manages a status bar element displaying active time
tracking sessions.
  – Retrieves current tracked tasks by filtering active time sessions.
  – Debounces update requests to minimize excessive DOM re-renders.
  – Provides a click handler that opens the tasks view (with a note to
potentially filter tasks in the future).
  – Offers methods for initializing, updating, toggling visibility, and
cleanup.

• Updates src/main.ts to:
  – Import and instantiate the new StatusBarService.
  – Initialize the status bar service during plugin startup.
  – Set up new event listeners (e.g., for task updates, data changes,
and Pomodoro events) that trigger status bar updates.
  – Clean up and update visibility of the status bar service during
plugin unload and theme/style refreshes.

• Enhances settings (src/settings/settings.ts) by:
  – Adding a new boolean setting "showTrackedTasksInStatusBar" with a
default value of false.
  – Introducing a new section in the settings tab to allow users to
toggle the status bar display on or off.
  – Updating the setting immediately triggers a status bar visibility
update.

• Adjusts style:
  – Adds the "styles/status-bar.css" file containing styling for the
status bar element, including responsive behavior and theme adjustments.
  – Updates build-css.mjs to include the new CSS file in the plugin's
build pipeline.

Overall, these changes integrate a user-configurable display for active
task tracking directly into the status bar, providing immediate visual
feedback and interactivity with the plugin’s time tracking features.
2025-06-30 21:58:35 +10:00

63 lines
No EOL
1.4 KiB
CSS

/* TaskNotes Status Bar Styles */
.tasknotes-status-bar {
display: flex;
align-items: center;
gap: 4px;
padding: 2px 6px;
border-radius: 4px;
background: transparent;
transition: background-color 0.2s ease;
min-width: 0; /* Allow text truncation */
}
.tasknotes-status-bar:hover {
background: var(--background-modifier-hover);
}
.tasknotes-status-icon {
font-size: 12px;
line-height: 1;
flex-shrink: 0;
}
.tasknotes-status-text {
font-size: 12px;
line-height: 1;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: var(--text-muted);
max-width: 200px; /* Limit width to prevent status bar from being too wide */
}
.tasknotes-status-bar:hover .tasknotes-status-text {
color: var(--text-normal);
}
/* Responsive behavior for smaller screens */
@media (max-width: 768px) {
.tasknotes-status-text {
max-width: 120px;
}
}
/* Dark theme adjustments */
.theme-dark .tasknotes-status-bar {
color: var(--text-muted);
}
.theme-dark .tasknotes-status-bar:hover {
background: var(--background-modifier-hover);
color: var(--text-normal);
}
/* Light theme adjustments */
.theme-light .tasknotes-status-bar {
color: var(--text-muted);
}
.theme-light .tasknotes-status-bar:hover {
background: var(--background-modifier-hover);
color: var(--text-normal);
}