Skip to content

Convert SummaryPanel and ActionBar to functional components#9635

Open
camd wants to merge 1 commit into
camd/expired-jobs-details-panelfrom
camd/functional-summary-actionbar
Open

Convert SummaryPanel and ActionBar to functional components#9635
camd wants to merge 1 commit into
camd/expired-jobs-details-panelfrom
camd/functional-summary-actionbar

Conversation

@camd

@camd camd commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

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 component
conversion — no behavior change to the expired-task handling.

Converts the two remaining class components in the summary panel to
functional components with hooks:

  • 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-injection wrapper is no longer needed. The
    component is now exported as a named function (the default export
    remains a memoized wrapper for compatibility).
  • The keyboard-shortcut handlers (openLogviewer / openRawLog) open
    the log URLs directly via window.open instead of programmatically
    clicking 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 — clean
  • pnpm test — full suite passes (2030 passed, 10 skipped)
  • ActionBar_test.jsx / SummaryPanel_test.jsx cover the expired-task
    behavior against the functional components.

Review note

Review/merge after #9532. Once the fix merges, this PR can be
retargeted to master.

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-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 68.75000% with 45 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.05%. Comparing base (20ea61f) to head (a88953c).

Files with missing lines Patch % Lines
ui/job-view/details/summary/ActionBar.jsx 64.95% 39 Missing and 2 partials ⚠️
ui/job-view/details/summary/SummaryPanel.jsx 85.18% 3 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants