Polish dashboard: consistent icon set, flatter cards, merged activity card
Replace card-header emoji with a matching stroke-style SVG icon set that inherits theme color via currentColor. Drop the accent-stripe border from every card and keep it only on the Your Courses card, the one primary action. Merge Continue Watching and Recently Viewed into a single true-recency list so an old completed item can no longer outrank a newer in-progress one across two separately-capped lists. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
+1
-20
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user