Skip to content

Commit 035e6d1

Browse files
committed
fix(dashboard): show exercises without dates in Recent Courses list
Exercises without releaseDate/startDate/dueDate were filtered out of the dashboard exercise list. Replace the filter with a sort that prioritizes dated exercises (newest first) and falls back to exercise ID for dateless ones.
1 parent 9317e89 commit 035e6d1

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ All notable changes to the Artemis VS Code extension will be documented in this
2020

2121
### Fixed
2222

23-
- **Dashboard "Recent Courses"**: The section now actually shows the 3 most recently accessed courses (previously it listed all active courses). Falls back to newest exercise activity, then course start date, then title when the access map has fewer than 3 entries. Tracked per (server URL, user) in extension global state. Access gets tracked per machine — opening an exercise or course-details updates the list on your next dashboard visit. Resolves #103.
23+
- **Dashboard "Recent Courses"**: Shows the 3 most recently accessed courses with exercises sorted by latest published. Exercises without dates are no longer hidden. Resolves #103.
2424
- **Back-to-Course Navigation**: Fixed "Course data is not available" error when returning from an exercise view to its course. The exercise payload now carries its parent course so back-navigation can restore it.
2525
- **API Endpoint Alignment**: Aligned API endpoints with the Artemis webapp, including correct feedback and exam endpoints.
2626
- **Build Error CodeLens**: Fixed duplicate CodeLens errors, missing testCase field in WebSocket feedback, and wired up build log viewing with go-to-source navigation.

extension/src/extension/services/ui/viewInitDataService.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,14 @@ export class ViewInitDataService {
5858
const course = courseItem.course || courseItem;
5959
const exercises = course.exercises || [];
6060

61-
const recentExercises = exercises
62-
.filter((ex: ExerciseDetail) => ex.releaseDate || ex.startDate || ex.dueDate)
61+
const recentExercises = [...exercises]
6362
.sort((a: ExerciseDetail, b: ExerciseDetail) => {
6463
const aDate = a.releaseDate || a.startDate || a.dueDate || '';
6564
const bDate = b.releaseDate || b.startDate || b.dueDate || '';
66-
return bDate.localeCompare(aDate);
65+
if (aDate && bDate) { return bDate.localeCompare(aDate); }
66+
if (aDate && !bDate) { return -1; }
67+
if (!aDate && bDate) { return 1; }
68+
return (b.id ?? 0) - (a.id ?? 0);
6769
});
6870

6971
return {

0 commit comments

Comments
 (0)