Skip to content

PDF export panel is missing the in-progress notice when re-opened while a report is generating #13175

Description

@benbowler

Bug Description

When a PDF report is generating and the user re-opens the download side sheet, the panel does not show the "Your report is being generated" warning notice. The Download report button is correctly disabled while a generation is in flight, but the accompanying notice, which explains why the button is disabled, was missed when the real generation flow was wired up. We already use this style of notice in other side sheets, so this is a case of rendering it while a report is generating.

Image

Steps to reproduce

  1. Enable the pdfGeneration feature flag with Search Console, Analytics 4, and PageSpeed Insights connected and holding data.
  2. Open the Site Kit dashboard and open the PDF export panel from the header.
  3. Keep all sections selected and click Download report. The panel closes and the report starts generating.
  4. While the report is still generating, re-open the PDF export panel from the header.
  5. See that the Download report button is disabled but no warning notice explains why.

Screenshots

Additional Context

  • Plugin Version: 1.184.0

Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • Re-opening the PDF export panel while a report is generating shows a warning notice reading "Your report is being generated. To create another report, please wait for the current download to complete."
  • The Download report button stays disabled for as long as the notice is shown.
  • The notice does not appear in the moment after clicking Download report while the side sheet is closing.
  • If the report finishes downloading in the background while the panel is open, the notice clears and the Download report button becomes active again.
  • The notice uses the standard warning notice style, consistent with the same notice in other side sheets.
  • Behaviour is gated behind the pdfGeneration feature flag.

Implementation Brief

Files to modify

  • Update file assets/js/components/pdf-export/PDFSectionsSelectionPanel/index.tsx - pass the existing isOpen value down to PanelContent as a prop so the in-progress notice can gate on the panel being open, not on the close animation still running.
  • Update file assets/js/components/pdf-export/PDFSectionsSelectionPanel/PanelContent.tsx - derive inFlight from select( CORE_PDF ).isExporting() and getStatus() === 'progress' (mirroring Footer.tsx), and render a SelectionPanelNotice type={ NOTICE_TYPES.WARNING } with title "Your report is being generated" and description "To create another report, please wait for the current download to complete." when isOpen && inFlight. Gating on isOpen prevents the flash: handleDownloadClick sets the open key false in the same tick it calls startExporting(), so the notice never renders during the slide-out. When the export finishes, finishExporting() clears isExporting and moves status off progress, so inFlight goes false and both the notice and the Footer's disabled button reset without extra wiring.

Test Coverage

  • assets/js/components/pdf-export/PDFSectionsSelectionPanel/PanelContent.test.tsx - asserts the warning notice renders when the panel is open and isExporting() is true, does not render when the panel is closed while a generation is in flight, and disappears once exporting finishes.
  • assets/js/components/pdf-export/PDFSectionsSelectionPanel/index.stories.tsx - add a generating-state story with isExporting seeded true so the warning notice is captured by VRT.

QA Brief

  • Enable the pdfGeneration feature flag, and connect Search Console, Analytics 4, and PageSpeed Insights on a site that holds data.
  • Open the Site Kit dashboard and click the Download PDF report icon in the header.
  • Keep every topic selected and click the Download report button. Confirm that no notice appears while the panel closes.
  • Click the Download PDF report icon again while the report still generates. Confirm that the panel holds a warning notice with the title Your report is being generated and the description To create another report, please wait for the current download to complete., and that the Download report button stays off while the notice shows.
  • Leave the panel open until the report finishes downloading. Confirm that the notice clears on its own and the Download report button works again, with no reload.

Changelog entry

  • Fix bug that could cause the PDF Report generation notice to disappear when the download panel is closed and opened again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0High priorityTeam SIssues for Squad 1Type: BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions