Repository navigation
Open the export dialog with the flatten option matching the report on screen - #25894
AltamashShaikh wants to merge 4 commits into
Conversation
…creen The export popover always opened with "flat" ticked when flat export was available, so exporting an unflattened (hierarchical) report produced a flat file that did not match what was shown. It now starts flat only when the report is currently flattened. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # plugins/CoreHome/vue/dist/CoreHome.umd.min.js
|
Auto-fix agent: merged Only the generated bundle plugins/CoreHome/vue/dist/CoreHome.umd.min.js conflicted: 6.x-dev rebuilt it for the themed notification close icon (#25888), and this PR rebuilt it for the ReportExport flat-option fix. |
|
Auto-fix agent: the failing checks (All required tests passed) need a developer; the agent will not push to this PR again. Only the UI-core job failed (the 'All required tests passed' gate reports UI-core: failure; PHP, plugin UI, JS and client jobs passed). The UI-core log was not saved and GitHub is not reachable here, so the failing test was found by running both core specs that open the export popover, on 6.x-dev and with the PR. Needs a developer: UI-core fails on ViewDataTableTest 'should display the export popover when clicking the export icon' (screenshot ViewDataTableTest_export_options). This PR caused it, as intended: the popover now opens with 'Flatten report' unticked for the non-flat Keywords report, so the 'Include dimensions separately' option is hidden. Verified locally: with and without the PR, only this one of the 26 ViewDataTableTest screenshots differs, and ReportExporting passes. Fix: copy tests/UI/expected-screenshots/ViewDataTableTest_export_options.png from this PR's UI-core CI artifact (processed-ui-screenshots) and commit it through Git LFS. It could not be done here: the CI artifact is not available (GitHub is not reachable), local rendering does not match CI (the local 6.x-dev image is 35090 bytes, sha256 9ee1f6e5..., while the committed CI image is 35699 bytes, LFS oid 574cb13e...), and git-lfs is not installed to commit a PNG correctly. PHPCS: the PR changes no PHP files. |
… hierarchical report Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Auto-fix agent: fixed checks broken by this PR (UI-core (0)). UI-core failed on 2 screenshots. ViewDataTableTest_export_options is caused by this PR: by that step the spec has made the Keywords report hierarchical again (step 13), so the export popover now correctly opens with 'Flatten report' unchecked. Synced the CI screenshot (commit daf31eb). PeriodSelector_month_selected (478 px diff) is not related to this PR. Changed:
Screenshots synced from CI, changed by this PR:
Not caused by this PR, left alone: PeriodSelector 'should change the date when a date is clicked in month-period mode' (PeriodSelector_month_selected.png, 478 px diff): this PR only changes the export popover (ReportExport.ts, its tests and expected export files) and does not touch the period selector. The CI image and the repo image look the same (same month, same selection), so this is CI rendering noise. Re-run UI-core; if it keeps failing on 6.x-dev too, sync it in a separate screenshot-sync PR. |
|
Auto-fix agent: the failing checks are not caused by this PR, so the agent leaves them and waits for a new commit. UI-core failed on one screenshot: PeriodSelector 'should change the date when a date is clicked in month-period mode' (PeriodSelector_month_selected.png, 478 px differ). All 478 pixels are in the Sa/Su calendar columns (x 437-482, y 127-230): the weekend day numbers are rendered slightly lighter. Dates, selection and layout are the same, so this looks like a colour transition caught mid-render. This PR only changes the report export popover (ReportExport.ts + spec, CoreHome dist, ReportExportPopover UI spec/screenshot, export expected files) and touches no PeriodSelector, calendar or CSS code. Nothing changed. What has to happen: PeriodSelector_month_selected.png (UI-core): flaky rendering difference not caused by this PR. Only the anti-aliasing/colour of the weekend day digits in the calendar differs, with no change in data or layout, and the PR does not touch the period selector. Re-run the UI-core job. If it keeps failing, it needs a separate fix or screenshot sync on 6.x-dev, not in this PR. |
Description
Bug: When you open the Export dialog on a report that can be flattened but is shown hierarchically (for example Behaviour > Pages), "Flatten report" is already ticked. If you export without noticing, the file is flat and doesn't match the report on screen.
Root cause:
plugins/CoreHome/vue/src/ReportExport/ReportExport.tsopened the popover withinitialOptionFlat = canExportFlat. Flat was pre-selected whenever flat export was available, whatever the report's current state. This was a deliberate default from #24045 (TSV + flat on open).Fix: The popover now starts flat only when the report is currently flattened (
canExportFlat && isDataTableFlat, using theparam.flatvalue the directive already reads). Nothing else changes:Note for product: this reverses the "flat by default" choice from #24045, as the bug report asks.
Tests:
ReportExport.spec.ts: a hierarchical report with subtables opens the popover withinitialOptionFlat=false(this failed before the fix), and a flat report opens it withinitialOptionFlat=true.plugins/CoreHome/tests/UI/ReportExportPopover_spec.jsnow expects the new default. The cases with no current subtables now tick "flat" themselves to prove it is still available. All 6 tests pass locally.ReportExporting_Referrers.getWebsites_exported.*expected files were updated: the Websites report is shown hierarchical, so its default exports are now unflattened (CSV/TSV) and without expanded subtables (XML/JSON). These are the new outputs from a local UI test run.ViewDataTable_export_options.png(Git LFS) is expected to change, because "Flatten report" is now unticked for the hierarchical Keywords report. It could not be regenerated locally and needs updating from the CI artifacts.flat=1in the link. After the fix, TSV is selected, flat is unticked and there is noflat=1. The same report forced to flat still opens with flat ticked. No page errors.QA
Checked in a browser on a test install, following the bug's steps before and after the fix.
Steps:
Before the fix: Behaviour > Pages shown hierarchical (unflattened) on the test fixture
Before the fix: the Export dialog opens with 'Flatten report' ticked although the report on screen is not flat
After the fix: the same hierarchical Pages report
After the fix: the Export dialog opens with 'Flatten report' unticked, matching the report on screen
Checklist
Review
🤖 Generated with Claude Code