Skip to content

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

Merged
BigSimmo merged 2 commits into
mainfrom
claude/project-thread-8ygx0b
Oct 13, 2026
Merged

BigSimmo merged 2 commits into
mainfrom
claude/project-thread-8ygx0b

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

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.

Written for commit 347d894. Summary will update on new commits.

View guided diff Turn on auto-fix


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.

A retry reads again over the answer still on screen, so when it brought back
the same statuses and item count the "Updated N min ago" line kept the earlier
time. Each source now says when it is reading again (refreshing), and the page
keeps the earlier time until that read answers, then restamps it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0113Rr2NnmLuLKLWdKTwHHqd
…tring

The tablet (WebKit) project read the home card, canvas and main scroller once
after two animation frames and failed on a transient null; main's browser
matrix is red on this test. Poll until all three mount, then measure.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0113Rr2NnmLuLKLWdKTwHHqd
@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 142c9d00-82c9-4ff0-b2b5-8c66ac66b8eb
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@codeant-ai

codeant-ai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

🏁 CodeAnt Quality Gate Results

Commit: 347d8942
Scan Time: 2026-10-13 06:21:45 UTC

✅ Overall Status: PASSED

Quality Gate Details

Quality Gate Status Details
Secrets ✅ PASSED 0 secrets found
Duplicate Code ✅ PASSED 0.0% duplicated
SAST ✅ PASSED No security issues
Bugs ✅ PASSED Rating S: No bugs
IAC ✅ PASSED No IAC issues

View Full Results

@codspeed

codspeed Bot commented Oct 13, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

ℹ️ 1 benchmark has no flame graph

The flamegraph could not be generated because too much time was spent in runtime internals, making the visualization not useful for performance analysis.

✅ 8 untouched benchmarks


Comparing claude/project-thread-8ygx0b (347d894) with main (08d8fb3)

Open in CodSpeed

@supabase

supabase Bot commented Oct 13, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@gitar-bot

gitar-bot Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor
Code Review ✅ Approved

🟡 Medium risk · Tracking retries across My Day sources restamps the freshness label when reads finish; inconsistent refresh signals could make displayed data age inaccurate.

Restamps the My Day "Updated N min ago" line to "Updated just now" when a Retry returns fresh data, even if the answer matches the previous one, and keeps the old age while the retry is still in flight. Also stabilises a WebKit browser test by waiting for the documents home canvas to mount before measuring. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Approved

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Counting what did not apply, without listing it.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@gitar-bot gitar-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Gitar has auto-approved this PR (configure)

@BigSimmo
BigSimmo marked this pull request as ready for review October 13, 2026 06:06
@codeant-ai

codeant-ai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR 347d894 Oct 13, 2026 · 06:06 06:12

@greptile-apps greptile-apps 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.

BigSimmo has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@codeant-ai

codeant-ai Bot commented Oct 13, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T06:09:49.910891Z 347d894 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@claude

claude Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Claude encountered an error after 2s —— View job


I'll analyze this and get back to you.

@codeant-ai codeant-ai Bot added the size:M This PR changes 30-99 lines, ignoring generated files label Oct 13, 2026
@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Reset My Day data age when a retry completes

🐞 Bug fix 🧪 Tests 🕐 20-40 Minutes

Grey Divider

AI Description

• Reset My Day’s update age when a retry answers, even if visible data is unchanged.
• Keep the previous age visible while sources refresh; leave first-load behavior unchanged.
• Wait for documents-home elements before measuring their layout in the browser test.
Diagram

graph TD
  A["Retry"] --> B["On Call entries"] --> F["My Day read"] --> G["My Day page"] --> H["Update age"]
  A --> C["Roster"] --> F
  A --> D["CPD"] --> F
  A --> E["Teaching"] --> F
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Track an explicit answer revision
  • ➕ Represents completed reads directly, without relying on an observed refreshing transition.
  • ➖ Requires coordinated revision tracking across source hooks and shared state for a timestamp-only fix.

Recommendation: Keep the PR’s refresh-state approach: it reuses the sources’ existing retry behavior and preserves the displayed age until an answer arrives. An explicit answer revision is worth considering only if more consumers need precise read-completion events.

Files changed (9) +76 / -28

Bug fix (7) +39 / -14
my-day-page.tsxRestamp data age after a refresh finishes +7/-2

Restamp data age after a refresh finishes

• Adds the refresh state to the answer key. The page retains the previous timestamp while refreshing and records a new one when the refresh ends, even if statuses and item count are unchanged.

src/components/my-day/my-day-page.tsx

cme.tsExpose CPD retry progress +9/-5

Expose CPD retry progress

• Stores the generation that produced the displayed CPD answer and reports refreshing while a newer generation is being read. Initial loading and signed-out states report false.

src/components/my-day/sources/cme.ts

entries.tsExpose On Call entries loading as refresh progress +4/-1

Expose On Call entries loading as refresh progress

• Returns a refreshing flag from the existing entries loading state when the My Day source is enabled.

src/components/my-day/sources/entries.ts

roster.tsExpose Roster retry progress +9/-5

Expose Roster retry progress

• Stores the generation of the displayed Roster answer and reports refreshing until the retried read settles. Initial loading and signed-out states report false.

src/components/my-day/sources/roster.ts

teaching.tsCombine Teaching resource refresh states +4/-1

Combine Teaching resource refresh states

• Reports refreshing when any enabled Teaching resource is rereading its data, allowing My Day to wait for its answer.

src/components/my-day/sources/teaching.ts

use-my-day-items.tsAggregate source refresh progress +4/-0

Aggregate source refresh progress

• Combines refresh flags from the four source hooks into My Day state and clears the flag for signed-out views.

src/components/my-day/use-my-day-items.ts

model.tsAdd refresh progress to the My Day state contract +2/-0

Add refresh progress to the My Day state contract

• Adds an optional refreshing field so consumers can distinguish an in-flight reread from its displayed answer.

src/lib/my-day/model.ts

Tests (2) +37 / -14
my-day-page.dom.test.tsxCover unchanged-data retry timing +15/-0

Cover unchanged-data retry timing

• Tests that the update age continues to advance during a retry and resets to “just now” when an identical answer arrives.

tests/my-day-page.dom.test.tsx

ui-chrome-scroll.spec.tsWait for documents-home geometry before measuring +22/-14

Wait for documents-home geometry before measuring

• Polls until the home card, centring canvas, and main scroller are mounted before asserting alignment and scroll range. This avoids a transient null during the tablet WebKit run.

tests/ui-chrome-scroll.spec.ts

@qodo-code-review

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can turn these tips off under Display > Comment parts

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown
Contributor

Qodo Fixer

No findings are available for this PR yet. Findings appear here once Qodo has reviewed the PR.

@codeant-ai

codeant-ai Bot commented Oct 13, 2026

Copy link
Copy Markdown

CodeAnt PR Risk: Medium Risk

  • The PR needs attention before merging because On Call retries do not retain the previous answer.
  • During an On Call retry, loading clears the source items and My Day shows a skeleton; the new refreshing flag does not prevent this.

Assessed commit: 347d89425ba4

@BigSimmo
BigSimmo enabled auto-merge October 13, 2026 06:19
@BigSimmo
BigSimmo merged commit 3e359e9 into main Oct 13, 2026
119 checks passed
@BigSimmo
BigSimmo deleted the claude/project-thread-8ygx0b branch October 13, 2026 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🟠 Medium blast radius size:M This PR changes 30-99 lines, ignoring generated files 🕐 20-40 Minutes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants