Feat/pacing tooltip projection and limit hit eta#87
Conversation
Add pacing tooltip projection and limit-hit ETA to provider progress rows and update
|
|
Relates to #86 - taking a look. Thanks Marc! |
- Changed pace status text from "Ahead of pace" to "You're good" for better user understanding. - Updated tooltip content to reflect new status and limit reached conditions. - Refactored related functions to enhance readability and maintainability, including the introduction of a LIMIT_REACHED constant. - Adjusted tests to align with the updated status messages and tooltip behavior.
- Removed the LIMIT_REACHED constant and updated related tooltip logic for clarity. - Simplified the pace status calculation by directly handling edge cases for zero usage and over-limit conditions. - Improved the PaceIndicator component to accept an isLimitReached prop for better status representation. - Updated tests to reflect changes in pace status handling and tooltip behavior.
|
@codex review this. Cursor review this. |
|
I've refactored this a little bit, cleaned up some code from the overall tooltip logic, changed the copy, and made it respect the left and used toggle in the settings so that it either shows how much you will have left or how much you will have used by the end. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c435fd16f1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| nowMs: number | ||
| displayMode: DisplayMode | ||
| }): string | null { | ||
| if (!paceResult || !Number.isFinite(limit) || limit <= 0 || paceResult.projectedUsage === 0) return null |
There was a problem hiding this comment.
Show projection for zero usage when data available
In buildPaceDetailText, projectedUsage === 0 forces a null return, so any line with zero usage never shows the “projected % at reset” detail even after enough time has elapsed for a projection. calculatePaceStatus now returns {status:"ahead", projectedUsage: 0} for used === 0, so late‑period zero usage will still render only the status text instead of the projection (e.g., “0% used at reset” / “100% left at reset”), which contradicts the new tooltip spec of showing projected usage when pace data is available. Consider only suppressing when the pace result is unavailable, not when the projection is zero.
Useful? React with 👍 / 👎.
Summary by cubic
Adds pacing tooltip details: projected usage by reset, a “Limit in …” ETA when behind pace, and “Limit reached” when already at 100%. Also updates status copy (“You’re good”), extracts tooltip logic to a shared lib, and standardizes reset time formatting.
New Features
Refactors
Written for commit c435fd1. Summary will update on new commits.