From 4836bda9f9af93da3c7fbf7450c52ee2e9ae8c50 Mon Sep 17 00:00:00 2001 From: Bendt Date: Fri, 19 Dec 2025 16:25:42 -0500 Subject: [PATCH] Add cursor hour header highlighting in calendar week view --- PROJECT_PLAN.md | 2 +- src/calendar/widgets/WeekGrid.py | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/PROJECT_PLAN.md b/PROJECT_PLAN.md index b7e3266..8640c23 100644 --- a/PROJECT_PLAN.md +++ b/PROJECT_PLAN.md @@ -447,7 +447,7 @@ Implement `/` keybinding for search across all apps with similar UX: ### Phase 2: Medium Priority 1. ~~Sync: Default to TUI mode~~ (DONE - already implemented) -2. Calendar: Cursor hour header highlighting +2. ~~Calendar: Cursor hour header highlighting~~ (DONE) 3. Calendar: Responsive detail panel 4. Calendar: Sidebar mini-calendar 5. Calendar: Calendar invites sidebar diff --git a/src/calendar/widgets/WeekGrid.py b/src/calendar/widgets/WeekGrid.py index 8d8b128..f502512 100644 --- a/src/calendar/widgets/WeekGrid.py +++ b/src/calendar/widgets/WeekGrid.py @@ -364,6 +364,9 @@ class WeekGridBody(ScrollView): current_row = (now.hour * rows_per_hour) + (now.minute // minutes_per_row) is_current_time_row = row_index == current_row + # Check if cursor is on this row + is_cursor_row = row_index == self.cursor_row + # Time label (only show on the hour) if row_index % rows_per_hour == 0: hour = row_index // rows_per_hour @@ -371,8 +374,12 @@ class WeekGridBody(ScrollView): else: time_str = " " # Blank for half-hour - # Style time label - highlight current time, dim outside work hours - if is_current_time_row: + # Style time label - highlight current time or cursor, dim outside work hours + if is_cursor_row: + # Highlight the hour label when cursor is on this row + primary_color = self._get_theme_color("primary") + time_style = Style(color=primary_color, bold=True, reverse=True) + elif is_current_time_row: error_color = self._get_theme_color("error") # Add subtle background to current time row for better visibility surface_color = self._get_theme_color("surface")