My Day: reset "Updated N min ago" when Retry brings fresh data

Merged
BI
1mo ago
+76-28

User description

Requested by Josh · project thread

Summary

Before: after #3508, tapping Retry on My Day could leave the line reading "Updated 6 min ago" even though the sources had just answered again, whenever the new answer had the same shape (same statuses, same number of items) as the old one.

After: when a retry answers, the line resets to "Updated just now". While the retry is still in flight it keeps the old age, so the line never claims fresher data than it shows.

This is the follow-up the owner approved on 13 Oct 2026 ("go ahead with all recommendations including any fixes"), and it answers the Qodo finding on #3508.

How: each My Day source (On Call entries, Roster, CPD, Teaching) now reports refreshing while a retry is reading over data it already had. The page treats the end of a refresh as a new answer and restamps the moment. Nothing changes for the first load.

This PR also carries one test-only fix. ui-chrome-scroll.spec.ts:419 ("desktop: tall documents home centres its action cluster") is red on main's browser matrix on the tablet (WebKit) project, where it read the home card, canvas and main scroller once and got a null. It now waits for all three to mount before measuring. No product code changes for it.

Areas touched: Personal practice; browser tests

Verification

  • npm run test:focused on the changed My Day files: Test Files 57 passed (57), Tests 742 passed (742), including a new test that restamps the age when a retry answers with identical data.
  • npm run typecheck, eslint and prettier on the changed files ran clean.
  • The tablet test fix could not be run locally (no WebKit in this container); CI's browser matrix is its proof.

Risk and rollout

  • Risk: low. One text line's timing, plus one test.
  • Rollback: revert the PR.
  • Provider or production effects: None.

Notes

  • Draft until the full browser suite is green.

🤖 Generated with Claude Code

https://claude.ai/code/session_0113Rr2NnmLuLKLWdKTwHHqd


Generated by Claude Code


Summary by cubic

Fixes the My Day "Updated N min ago" line so it resets to "Updated just now" when Retry brings back fresh data, even when nothing visible changed.

  • Previously, a retry that answered with the same statuses and item count kept the old age, since the timestamp only changed when the visible data changed.
  • Each My Day source now reports refreshing while a retry is reading over the answer still on screen; the page keeps the earlier time until that read answers, then restamps it.
  • Also fixes a flaky WebKit (tablet) browser test that could read the documents home card before it mounted.

CodeAnt-AI Description

Reset My Day’s update age when a retry finishes

What Changed

  • My Day keeps the current update age while a retry is in progress, then resets it when the retry finishes—even if the returned data is unchanged.

Impact

✅ Accurate My Day update age after retries
✅ No premature “Updated just now” message

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.