Show which goal a session worked on, and how many - #44
Conversation
The calendar's Sessions tab listed times, focus and points but never the goal behind the session, and the Performance tab reported only derived ratios, so a day's raw session count was nowhere on it. - Move StudyPlannerPanel's private session-link label into TaskStyleUtils so the calendar renders the same "Goal: ..." line, with a tooltip carrying the full text the 40-char truncation drops - Show "Sessions logged: N" at the top of the Performance breakdown, independent of whether the day scored any points - Add StudySession.countByGoalId() and put the count on the goal's attempt line: sessions across every attempt, achieved or not
There was a problem hiding this comment.
🟡 Changes recommended
The current UI wording/count display can be misleading for goal attempts, and the new link-label truncation can break emoji/surrogate pairs.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR enhances StudySync’s UI and persistence layer to better surface what study sessions were linked to (goal/task) and to show session counts associated with goals and day performance.
Changes:
- Adds a shared
TaskStyleUtils.sessionLinkLabel(...)and uses it in planner and calendar session cards. - Introduces
StudySession.countByGoalId(...)and uses it to display session counts on calendar goal cards. - Adds a persistence test covering
countByGoalId.
File summaries
| File | Description |
|---|---|
| src/test/java/com/studysync/domain/service/StudyServicePersistenceTest.java | Adds a new persistence test for StudySession.countByGoalId. |
| src/main/java/com/studysync/presentation/ui/components/TaskStyleUtils.java | Introduces shared UI helper to render a muted goal/task link label with tooltip. |
| src/main/java/com/studysync/presentation/ui/components/StudyPlannerPanel.java | Replaces local session-link label builder with the shared TaskStyleUtils helper. |
| src/main/java/com/studysync/presentation/ui/components/CalendarViewPanel.java | Adds session link labels to session cards and shows goal-linked session counts in goal attempt summaries. |
| src/main/java/com/studysync/domain/entity/StudySession.java | Adds countByGoalId query helper for counting sessions linked to a goal. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 5
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
geokoko
left a comment
There was a problem hiding this comment.
Overall review: no remaining blocking defects found in the complete PR diff after ebd0254.
All five Copilot findings are fixed and covered by focused checks. Additional review removed the redundant Performance count and checked goal/task fallback, incomplete sessions, retry history, and release packaging.
Validation: 72 unit/UI tests and 9 integration tests passed; build/check and release packaging passed. Checkstyle completed with warnings. JavaFX tests ran under Xvfb; no manual desktop walkthrough was performed. No dependency or database changes.
Summary
Session cards in the planner and calendar show their linked goal, falling back to the task when the goal is missing. Long labels preserve Unicode code points and expose their full text in a tooltip only when truncated.
Calendar goal cards show nonzero lifetime session counts, explicitly scoped across all attempts and including incomplete sessions. Counts use
long. The duplicate Performance-tab count was removed.Prepares StudySync 0.1.7 by updating the build version and README. Adds JavaFX regression checks and runs CI tests under Xvfb.
Validation
xvfb-run -a ./gradlew compileJava test --tests StudyServicePersistenceTest --tests SessionVisibilityTest: 24 tests passed.xvfb-run -a ./gradlew build check integrationTest: 72 tests and 9 integration tests passed; no failures or skips. Checkstyle completed with warnings../scripts/build-release.sh: passed; both archive checksums verified and package contents inspected.git diff --check: passed. No dependencies or schema changes.Local JavaFX tests used
JAVA_TOOL_OPTIONS=-Djavafx.cachedir=/tmp/studysync-javafx-cachebecause the sandbox restricts the default native-library cache.Review
All five Copilot threads addressed. Reviewed the complete PR diff, shared-helper callers, missing-link fallback, attempt lifecycle, persistence semantics, and release configuration. No remaining blocking defects introduced by this PR were found. JavaFX controls were exercised under Xvfb; a manual desktop walkthrough was not performed.
Rollback: use the previous release, v0.1.6; this change requires no database migration.