[Dashboard] Add recovery count to managed job detail page#10004
[Dashboard] Add recovery count to managed job detail page#10004stephenkevn wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds a "Recoveries" section to the job details page, allowing users to view the number of recoveries and smoothly scroll to the events section if the events plugin is active. The feedback recommends improving the robustness of the recoveries check by explicitly verifying if jobData.recoveries > 0 instead of using a loose truthy check, which could lead to unexpected behavior with falsy or non-numeric values.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| {jobData.recoveries ? ( | ||
| <span className="inline-flex items-center"> | ||
| {jobData.recoveries} | ||
| {eventsSlotHasPlugin && ( | ||
| <button | ||
| onClick={() => | ||
| document | ||
| .getElementById('events-section') | ||
| ?.scrollIntoView({ behavior: 'smooth' }) | ||
| } | ||
| className="text-blue-600 hover:underline ml-2" | ||
| > | ||
| View events | ||
| </button> | ||
| )} | ||
| </span> | ||
| ) : ( | ||
| 0 | ||
| )} |
There was a problem hiding this comment.
Using a truthy check (jobData.recoveries ? ...) can lead to unexpected behavior if recoveries is a string like "0" (which is truthy in JavaScript) or if it is undefined/null. It is safer and more robust to explicitly check if jobData.recoveries > 0 to ensure the "View events" link is only displayed when there are actual recoveries.
| {jobData.recoveries ? ( | |
| <span className="inline-flex items-center"> | |
| {jobData.recoveries} | |
| {eventsSlotHasPlugin && ( | |
| <button | |
| onClick={() => | |
| document | |
| .getElementById('events-section') | |
| ?.scrollIntoView({ behavior: 'smooth' }) | |
| } | |
| className="text-blue-600 hover:underline ml-2" | |
| > | |
| View events | |
| </button> | |
| )} | |
| </span> | |
| ) : ( | |
| 0 | |
| )} | |
| {jobData.recoveries > 0 ? ( | |
| <span className="inline-flex items-center"> | |
| {jobData.recoveries} | |
| {eventsSlotHasPlugin && ( | |
| <button | |
| onClick={() => | |
| document | |
| .getElementById('events-section') | |
| ?.scrollIntoView({ behavior: 'smooth' }) | |
| } | |
| className="text-blue-600 hover:underline ml-2" | |
| > | |
| View events | |
| </button> | |
| )} | |
| </span> | |
| ) : ( | |
| 0 | |
| )} |
There was a problem hiding this comment.
Thanks — adopted the explicit jobData.recoveries > 0 check. The field was also revised so the recovery count itself is the link (the separate "View events" button was removed); the link only renders when an events view is registered, otherwise the count shows as plain text.
a5d1614 to
084150f
Compare
The managed job detail page showed no recovery count in its Details section, so users had to scroll to the events table (or infer it) to see how many times a job recovered. Add a "Recoveries" field to the Details grid. When a job has recovered, show the count plus a "View events" link that scrolls to the events table; otherwise show 0. Reuses the existing scroll-anchor pattern. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
084150f to
955fb54
Compare
Summary
section, so the recovery count is visible at a glance instead of only
in the jobs list.
(smooth-scroll). The link only renders when an events view is present;
otherwise the count shows as plain text, and the field shows 0 when
there are no recoveries.
Test plan
job detail page. Verified the Recoveries field renders in Details:
shows 0 with no recoveries, shows the count as a link that scrolls to
the events section when > 0, and shows the count as plain text when no
events view is present.