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 @@
-

Your Courses

+

Your Courses

@@ -1124,7 +1140,7 @@ {% if library_stats and library_stats.total_courses %}
-

๐Ÿ“Š Library Stats

+

Library Stats

@@ -1166,7 +1182,7 @@ {% if next_up %}
-

๐Ÿ“Œ Next Up

+

Next Up

{% for item in next_up %}
@@ -1193,7 +1209,7 @@ {% if stale_courses %}
-

โฐ Pick Back Up

+

Pick Back Up

{% for item in stale_courses %} {{ render_course_row(item, 'Last touched ' + item.last_touched_display) }} @@ -1205,7 +1221,7 @@ {% if recently_added %}
-

๐Ÿ†• Recently Added

+

Recently Added

{% for item in recently_added %} {{ render_course_row(item, item.added_display) }} @@ -1214,22 +1230,10 @@
{% endif %} - {% if continue_watching %} -
-
-

โ–ถ Continue Watching

-
- {% for view in continue_watching %} - {{ render_view_row(view) }} - {% endfor %} -
-
-
- {% endif %} {% if recent_views %}
-

๐Ÿ• Recently Viewed

+

Recently Viewed

{% for view in recent_views %} {{ render_view_row(view) }}