Convert SummaryPanel and ActionBar to functional components#9635
Open
camd wants to merge 1 commit into
Open
Conversation
Convert the SummaryPanel and ActionBar class components to functional components with hooks, building on the expired-task handling already in place: - SummaryPanel becomes a memoized function component. - ActionBar moves its lifecycle window-event listeners into a useEffect and reads decisionTaskMap directly from the pushes store, so the class wrapper is no longer needed. Its export becomes the function itself (default export remains a memoized wrapper for compatibility). - The keyboard-shortcut handlers (openLogviewer/openRawLog) open the log URLs directly instead of clicking DOM buttons, and skip when the task has expired. No behavior change beyond the handler simplification; the expired-task disabling and tooltips are preserved.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## camd/expired-jobs-details-panel #9635 +/- ##
===================================================================
+ Coverage 82.99% 83.05% +0.05%
===================================================================
Files 618 618
Lines 35858 35823 -35
Branches 3330 3325 -5
===================================================================
- Hits 29762 29753 -9
+ Misses 5726 5700 -26
Partials 370 370 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Splits the class→functional conversion out of the expired-task bug fix
(#9532) into its own change. This PR is stacked on
camd/expired-jobs-details-panel, so its diff is only the componentconversion — no behavior change to the expired-task handling.
Converts the two remaining class components in the summary panel to
functional components with hooks:
windowevent listeners into auseEffect, and readsdecisionTaskMapdirectly from the pushesstore, so the class-injection wrapper is no longer needed. The
component is now exported as a named function (the default export
remains a memoized wrapper for compatibility).
openLogviewer/openRawLog) openthe log URLs directly via
window.openinstead of programmaticallyclicking DOM buttons, and no-op when the task has expired.
Why split it out
The bug fix (#9532) only needs the expired-task disabling logic, which
applies cleanly to the existing class components. Keeping the conversion
separate makes the fix easy to review and lets the refactor land on its
own merits.
Testing
pnpm lint— cleanpnpm test— full suite passes (2030 passed, 10 skipped)ActionBar_test.jsx/SummaryPanel_test.jsxcover the expired-taskbehavior against the functional components.
Review note
Review/merge after #9532. Once the fix merges, this PR can be
retargeted to
master.