Skip to content

Refresh date when day changes while page is not visible - #180

Merged
rob93c merged 2 commits into
mainfrom
refresh-date-when-day-changes
Aug 8, 2026
Merged

Refresh date when day changes while page is not visible#180
rob93c merged 2 commits into
mainfrom
refresh-date-when-day-changes

Conversation

@rob93c

@rob93c rob93c commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Bug Fixes
    • Daily questions now update correctly when the date changes while the app is open.
    • Returning to the app after midnight refreshes content when appropriate.
    • The “Today” button now consistently uses the current date.

@rob93c rob93c self-assigned this Aug 8, 2026
@rob93c rob93c added the bug Something isn't working label Aug 8, 2026
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@rob93c, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 47 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e35949ef-b765-4dc7-b9de-ca1180a6331e

📥 Commits

Reviewing files that changed from the base of the PR and between b94d524 and 41a1570.

📒 Files selected for processing (1)
  • src/components/DailyQuestion.vue

Walkthrough

The component now computes the current date at runtime. It initializes date state with getToday(), updates the Today action, and refreshes displayed content after the document becomes visible on a new day.

Changes

Daily question date handling

Layer / File(s) Summary
Dynamic date initialization and Today action
src/components/DailyQuestion.vue
Current-date state and the Today action now use getToday(). Date changes still recalculate the total days in the year.
Visibility-based date refresh
src/components/DailyQuestion.vue
A document visibility listener refreshes the question when the date changes while the component is hidden. The listener is removed before unmount.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Poem

I’m a rabbit with a calendar bright,
I hop past midnight into light.
The question turns, the date is new,
The Today button knows it too.
Visibility keeps the answers right!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: refreshing the displayed date after it changes while the page is not visible.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refresh-date-when-day-changes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/DailyQuestion.vue`:
- Around line 60-68: Update onVisible so it calls getToday() before checking
document.visibilityState, executes the refresh condition only when the state is
visible, and assigns lastKnownToday.value after that branch regardless of
visibility. Preserve the existing refreshContent condition and selectedDate
behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 27387bf7-b512-4057-8990-a24f8a66eb36

📥 Commits

Reviewing files that changed from the base of the PR and between 8976e8d and b94d524.

📒 Files selected for processing (1)
  • src/components/DailyQuestion.vue

Comment thread src/components/DailyQuestion.vue
@rob93c
rob93c merged commit 1d97441 into main Aug 8, 2026
2 checks passed
@rob93c
rob93c deleted the refresh-date-when-day-changes branch August 8, 2026 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant