fix(score): show selected period label#845
Conversation
Greptile SummaryThis PR fixes a UX bug where the Score visualization always displayed "today" regardless of the selected activity period. A new
Confidence Score: 5/5Safe to merge — the change is a minimal, focused fix to a display string with a well-tested fallback path. The change adds a single computed property that follows the same store-access pattern already used elsewhere in the component. The optional-chaining fallback handles the null/undefined case correctly, No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Score.vue
participant ActivityStore
participant periodReadable
User->>Score.vue: Selects activity period
Score.vue->>ActivityStore: useActivityStore().query_options?.timeperiod
ActivityStore-->>Score.vue: "TimePeriod | undefined"
alt timeperiod available
Score.vue->>periodReadable: periodReadable(timeperiod)
periodReadable-->>Score.vue: formatted label (e.g. "2024-01-15")
else timeperiod unavailable
Score.vue-->>Score.vue: "selected period" (fallback)
end
Score.vue-->>User: "Your total score for <label> is:"
Reviews (1): Last reviewed commit: "fix(score): show selected period label" | Re-trigger Greptile |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #845 +/- ##
=======================================
Coverage 34.38% 34.38%
=======================================
Files 36 36
Lines 2114 2114
Branches 403 408 +5
=======================================
Hits 727 727
Misses 1308 1308
Partials 79 79 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Works as expected |
|
CI is green on This should be ready for maintainer merge. |
Summary
Fixes #844.
Verification
npx eslint --ext .vue,.js,.ts src/visualizations/Score.vuenpm run build