diff --git a/offlineu_core.py b/offlineu_core.py index 842a1ee..9bf3fda 100644 --- a/offlineu_core.py +++ b/offlineu_core.py @@ -1790,23 +1790,6 @@ def build_study_guide_markdown(course: Course) -> str: current_course = None -def _split_continue_watching(all_views: List[Dict[str, Any]]) -> Tuple[List[Dict[str, Any]], List[Dict[str, Any]]]: - """ - Split the recent-views list (already carrying percent_watched/completed, - see get_recent_views_for_display) into 'Continue Watching' - genuinely - in-progress lessons - and the remaining 'Recently Viewed' entries, each - capped at 5 for the dashboard. Reuses the same underlying history rather - than a separate library-wide progress index (see plan notes). - """ - continue_watching = [v for v in all_views if 0 < v['percent_watched'] < 100][:5] - continue_ids = {(v.get('course_path'), v.get('lesson_path')) for v in continue_watching} - recent_views = [ - v for v in all_views - if (v.get('course_path'), v.get('lesson_path')) not in continue_ids - ][:5] - return continue_watching, recent_views - - def format_duration(seconds: int) -> str: """Render a duration in seconds as e.g. '3h 24m' or '45m' (under an hour).""" total_minutes = max(0, int(seconds)) // 60 @@ -1819,7 +1802,7 @@ def index(): """Main dashboard""" global current_course - continue_watching, recent_views = _split_continue_watching(get_recent_views_for_display()) + recent_views = get_recent_views_for_display()[:8] if current_course is None: # One scan covers stats/stale-courses/heatmap - see _scan_library_activity. @@ -1827,7 +1810,6 @@ def index(): return render_template('course_dashboard.html', course=None, stats={'total_lessons': 0, 'completed_lessons': 0, 'completion_percentage': 0}, - continue_watching=continue_watching, recent_views=recent_views, recently_added=get_recently_added_courses(), library_stats=format_library_stats(scan), @@ -1851,7 +1833,6 @@ def index(): return render_template('course_dashboard.html', course=current_course, stats=stats, - continue_watching=continue_watching, recent_views=recent_views, has_note=bool(course_has_any_notes(current_course)), is_queued=os.path.abspath(current_course.path) in get_next_up_paths(), diff --git a/templates/course_dashboard.html b/templates/course_dashboard.html index 3aa8e2e..a5d4459 100644 --- a/templates/course_dashboard.html +++ b/templates/course_dashboard.html @@ -206,6 +206,12 @@ border-radius: var(--radius); padding: 20px; margin-bottom: 20px; + } + + #library-card { + /* the one card that's a primary action (browse/search/load a + course) rather than a passive info/list card - every other + card getting the same accent stripe made nothing stand out */ border-left: 4px solid var(--accent); } @@ -380,6 +386,16 @@ transform: rotate(-90deg); } + .card-header-label { + display: flex; + align-items: center; + gap: 8px; + } + .card-icon { + flex-shrink: 0; + color: var(--text-primary); + } + .card-body { overflow: hidden; max-height: 3000px; @@ -1088,7 +1104,7 @@