[Fix] Hide chrome when printing #227095
Conversation
|
Pinging @elastic/appex-sharedux (Team:SharedUX) |
tsullivan
left a comment
There was a problem hiding this comment.
LGTM
Note: I wasn't able to reproduce the issue occurring when using PNG/PDF reports, but I could see it when using the browser's print functionality.
Note: I see an issue where the PDF report is horizontally stretched. This is the same as #183550 - the dimensions of the captured image are not what is expected according to the report job parameters.
Weird! I tried 9.1 and it seems like it depends on something else? https://github.com/user-attachments/files/21139207/Elastic.Security.Detection.rule.monitoring.pdf
It looks like it is streched without this PR with solution nav , I filed #227187 |
|
Starting backport for target branches: 8.18, 8.19, 9.0, 9.1 |
## Summary fix elastic#226865 Proposed quick fix for elastic#226865. The main reason the dashboard print looks broken is that the new navigation is expanded by default, pushing the content to the side. In this PR, we use existing, well-tested functionality—chrome visibility—to hide the chrome along with the navigation and allow printing to focus on the main content: the dashboard. The printing is still not ideal, but at least usable [example good export.pdf](https://github.com/user-attachments/files/21125283/example.good.export.pdf) ## Release Notes Hide Kibana's header and side navigation when trying to print or use the dashboard export with print mode. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 6130f2b)
## Summary fix elastic#226865 Proposed quick fix for elastic#226865. The main reason the dashboard print looks broken is that the new navigation is expanded by default, pushing the content to the side. In this PR, we use existing, well-tested functionality—chrome visibility—to hide the chrome along with the navigation and allow printing to focus on the main content: the dashboard. The printing is still not ideal, but at least usable [example good export.pdf](https://github.com/user-attachments/files/21125283/example.good.export.pdf) ## Release Notes Hide Kibana's header and side navigation when trying to print or use the dashboard export with print mode. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 6130f2b)
## Summary fix elastic#226865 Proposed quick fix for elastic#226865. The main reason the dashboard print looks broken is that the new navigation is expanded by default, pushing the content to the side. In this PR, we use existing, well-tested functionality—chrome visibility—to hide the chrome along with the navigation and allow printing to focus on the main content: the dashboard. The printing is still not ideal, but at least usable [example good export.pdf](https://github.com/user-attachments/files/21125283/example.good.export.pdf) ## Release Notes Hide Kibana's header and side navigation when trying to print or use the dashboard export with print mode. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 6130f2b)
## Summary fix elastic#226865 Proposed quick fix for elastic#226865. The main reason the dashboard print looks broken is that the new navigation is expanded by default, pushing the content to the side. In this PR, we use existing, well-tested functionality—chrome visibility—to hide the chrome along with the navigation and allow printing to focus on the main content: the dashboard. The printing is still not ideal, but at least usable [example good export.pdf](https://github.com/user-attachments/files/21125283/example.good.export.pdf) ## Release Notes Hide Kibana's header and side navigation when trying to print or use the dashboard export with print mode. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 6130f2b)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
# Backport This will backport the following commits from `main` to `8.19`: - [[Fix] Hide chrome when printing (#227095)](#227095) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Anton Dosov","email":"anton.dosov@elastic.co"},"sourceCommit":{"committedDate":"2025-07-10T09:04:32Z","message":"[Fix] Hide chrome when printing (#227095)\n\n## Summary\n\nfix https://github.com/elastic/kibana/issues/226865\n\nProposed quick fix for https://github.com/elastic/kibana/issues/226865.\nThe main reason the dashboard print looks broken is that the new\nnavigation is expanded by default, pushing the content to the side. In\nthis PR, we use existing, well-tested functionality—chrome visibility—to\nhide the chrome along with the navigation and allow printing to focus on\nthe main content: the dashboard.\n\nThe printing is still not ideal, but at least usable\n\n[example good\nexport.pdf](https://github.com/user-attachments/files/21125283/example.good.export.pdf)\n\n\n## Release Notes\n\nHide Kibana's header and side navigation when trying to print or use the\ndashboard export with print mode.\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"6130f2b7b523549d76ec88e99b26ac4f03c6dd10","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:SharedUX","backport:version","v9.1.0","v8.19.0","v9.2.0","v8.18.4","v9.0.4"],"title":"[Fix] Hide chrome when printing ","number":227095,"url":"https://github.com/elastic/kibana/pull/227095","mergeCommit":{"message":"[Fix] Hide chrome when printing (#227095)\n\n## Summary\n\nfix https://github.com/elastic/kibana/issues/226865\n\nProposed quick fix for https://github.com/elastic/kibana/issues/226865.\nThe main reason the dashboard print looks broken is that the new\nnavigation is expanded by default, pushing the content to the side. In\nthis PR, we use existing, well-tested functionality—chrome visibility—to\nhide the chrome along with the navigation and allow printing to focus on\nthe main content: the dashboard.\n\nThe printing is still not ideal, but at least usable\n\n[example good\nexport.pdf](https://github.com/user-attachments/files/21125283/example.good.export.pdf)\n\n\n## Release Notes\n\nHide Kibana's header and side navigation when trying to print or use the\ndashboard export with print mode.\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"6130f2b7b523549d76ec88e99b26ac4f03c6dd10"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19","8.18","9.0"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/227095","number":227095,"mergeCommit":{"message":"[Fix] Hide chrome when printing (#227095)\n\n## Summary\n\nfix https://github.com/elastic/kibana/issues/226865\n\nProposed quick fix for https://github.com/elastic/kibana/issues/226865.\nThe main reason the dashboard print looks broken is that the new\nnavigation is expanded by default, pushing the content to the side. In\nthis PR, we use existing, well-tested functionality—chrome visibility—to\nhide the chrome along with the navigation and allow printing to focus on\nthe main content: the dashboard.\n\nThe printing is still not ideal, but at least usable\n\n[example good\nexport.pdf](https://github.com/user-attachments/files/21125283/example.good.export.pdf)\n\n\n## Release Notes\n\nHide Kibana's header and side navigation when trying to print or use the\ndashboard export with print mode.\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"6130f2b7b523549d76ec88e99b26ac4f03c6dd10"}},{"branch":"8.18","label":"v8.18.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
# Backport This will backport the following commits from `main` to `9.0`: - [[Fix] Hide chrome when printing (#227095)](#227095) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Anton Dosov","email":"anton.dosov@elastic.co"},"sourceCommit":{"committedDate":"2025-07-10T09:04:32Z","message":"[Fix] Hide chrome when printing (#227095)\n\n## Summary\n\nfix https://github.com/elastic/kibana/issues/226865\n\nProposed quick fix for https://github.com/elastic/kibana/issues/226865.\nThe main reason the dashboard print looks broken is that the new\nnavigation is expanded by default, pushing the content to the side. In\nthis PR, we use existing, well-tested functionality—chrome visibility—to\nhide the chrome along with the navigation and allow printing to focus on\nthe main content: the dashboard.\n\nThe printing is still not ideal, but at least usable\n\n[example good\nexport.pdf](https://github.com/user-attachments/files/21125283/example.good.export.pdf)\n\n\n## Release Notes\n\nHide Kibana's header and side navigation when trying to print or use the\ndashboard export with print mode.\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"6130f2b7b523549d76ec88e99b26ac4f03c6dd10","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:SharedUX","backport:version","v9.1.0","v8.19.0","v9.2.0","v8.18.4","v9.0.4"],"title":"[Fix] Hide chrome when printing ","number":227095,"url":"https://github.com/elastic/kibana/pull/227095","mergeCommit":{"message":"[Fix] Hide chrome when printing (#227095)\n\n## Summary\n\nfix https://github.com/elastic/kibana/issues/226865\n\nProposed quick fix for https://github.com/elastic/kibana/issues/226865.\nThe main reason the dashboard print looks broken is that the new\nnavigation is expanded by default, pushing the content to the side. In\nthis PR, we use existing, well-tested functionality—chrome visibility—to\nhide the chrome along with the navigation and allow printing to focus on\nthe main content: the dashboard.\n\nThe printing is still not ideal, but at least usable\n\n[example good\nexport.pdf](https://github.com/user-attachments/files/21125283/example.good.export.pdf)\n\n\n## Release Notes\n\nHide Kibana's header and side navigation when trying to print or use the\ndashboard export with print mode.\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"6130f2b7b523549d76ec88e99b26ac4f03c6dd10"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19","8.18","9.0"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/227095","number":227095,"mergeCommit":{"message":"[Fix] Hide chrome when printing (#227095)\n\n## Summary\n\nfix https://github.com/elastic/kibana/issues/226865\n\nProposed quick fix for https://github.com/elastic/kibana/issues/226865.\nThe main reason the dashboard print looks broken is that the new\nnavigation is expanded by default, pushing the content to the side. In\nthis PR, we use existing, well-tested functionality—chrome visibility—to\nhide the chrome along with the navigation and allow printing to focus on\nthe main content: the dashboard.\n\nThe printing is still not ideal, but at least usable\n\n[example good\nexport.pdf](https://github.com/user-attachments/files/21125283/example.good.export.pdf)\n\n\n## Release Notes\n\nHide Kibana's header and side navigation when trying to print or use the\ndashboard export with print mode.\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"6130f2b7b523549d76ec88e99b26ac4f03c6dd10"}},{"branch":"8.18","label":"v8.18.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
# Backport This will backport the following commits from `main` to `9.1`: - [[Fix] Hide chrome when printing (#227095)](#227095) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Anton Dosov","email":"anton.dosov@elastic.co"},"sourceCommit":{"committedDate":"2025-07-10T09:04:32Z","message":"[Fix] Hide chrome when printing (#227095)\n\n## Summary\n\nfix https://github.com/elastic/kibana/issues/226865\n\nProposed quick fix for https://github.com/elastic/kibana/issues/226865.\nThe main reason the dashboard print looks broken is that the new\nnavigation is expanded by default, pushing the content to the side. In\nthis PR, we use existing, well-tested functionality—chrome visibility—to\nhide the chrome along with the navigation and allow printing to focus on\nthe main content: the dashboard.\n\nThe printing is still not ideal, but at least usable\n\n[example good\nexport.pdf](https://github.com/user-attachments/files/21125283/example.good.export.pdf)\n\n\n## Release Notes\n\nHide Kibana's header and side navigation when trying to print or use the\ndashboard export with print mode.\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"6130f2b7b523549d76ec88e99b26ac4f03c6dd10","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:SharedUX","backport:version","v9.1.0","v8.19.0","v9.2.0","v8.18.4","v9.0.4"],"title":"[Fix] Hide chrome when printing ","number":227095,"url":"https://github.com/elastic/kibana/pull/227095","mergeCommit":{"message":"[Fix] Hide chrome when printing (#227095)\n\n## Summary\n\nfix https://github.com/elastic/kibana/issues/226865\n\nProposed quick fix for https://github.com/elastic/kibana/issues/226865.\nThe main reason the dashboard print looks broken is that the new\nnavigation is expanded by default, pushing the content to the side. In\nthis PR, we use existing, well-tested functionality—chrome visibility—to\nhide the chrome along with the navigation and allow printing to focus on\nthe main content: the dashboard.\n\nThe printing is still not ideal, but at least usable\n\n[example good\nexport.pdf](https://github.com/user-attachments/files/21125283/example.good.export.pdf)\n\n\n## Release Notes\n\nHide Kibana's header and side navigation when trying to print or use the\ndashboard export with print mode.\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"6130f2b7b523549d76ec88e99b26ac4f03c6dd10"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19","8.18","9.0"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/227095","number":227095,"mergeCommit":{"message":"[Fix] Hide chrome when printing (#227095)\n\n## Summary\n\nfix https://github.com/elastic/kibana/issues/226865\n\nProposed quick fix for https://github.com/elastic/kibana/issues/226865.\nThe main reason the dashboard print looks broken is that the new\nnavigation is expanded by default, pushing the content to the side. In\nthis PR, we use existing, well-tested functionality—chrome visibility—to\nhide the chrome along with the navigation and allow printing to focus on\nthe main content: the dashboard.\n\nThe printing is still not ideal, but at least usable\n\n[example good\nexport.pdf](https://github.com/user-attachments/files/21125283/example.good.export.pdf)\n\n\n## Release Notes\n\nHide Kibana's header and side navigation when trying to print or use the\ndashboard export with print mode.\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"6130f2b7b523549d76ec88e99b26ac4f03c6dd10"}},{"branch":"8.18","label":"v8.18.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
# Backport This will backport the following commits from `main` to `8.18`: - [[Fix] Hide chrome when printing (#227095)](#227095) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Anton Dosov","email":"anton.dosov@elastic.co"},"sourceCommit":{"committedDate":"2025-07-10T09:04:32Z","message":"[Fix] Hide chrome when printing (#227095)\n\n## Summary\n\nfix https://github.com/elastic/kibana/issues/226865\n\nProposed quick fix for https://github.com/elastic/kibana/issues/226865.\nThe main reason the dashboard print looks broken is that the new\nnavigation is expanded by default, pushing the content to the side. In\nthis PR, we use existing, well-tested functionality—chrome visibility—to\nhide the chrome along with the navigation and allow printing to focus on\nthe main content: the dashboard.\n\nThe printing is still not ideal, but at least usable\n\n[example good\nexport.pdf](https://github.com/user-attachments/files/21125283/example.good.export.pdf)\n\n\n## Release Notes\n\nHide Kibana's header and side navigation when trying to print or use the\ndashboard export with print mode.\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"6130f2b7b523549d76ec88e99b26ac4f03c6dd10","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:SharedUX","backport:version","v9.1.0","v8.19.0","v9.2.0","v8.18.4","v9.0.4"],"title":"[Fix] Hide chrome when printing ","number":227095,"url":"https://github.com/elastic/kibana/pull/227095","mergeCommit":{"message":"[Fix] Hide chrome when printing (#227095)\n\n## Summary\n\nfix https://github.com/elastic/kibana/issues/226865\n\nProposed quick fix for https://github.com/elastic/kibana/issues/226865.\nThe main reason the dashboard print looks broken is that the new\nnavigation is expanded by default, pushing the content to the side. In\nthis PR, we use existing, well-tested functionality—chrome visibility—to\nhide the chrome along with the navigation and allow printing to focus on\nthe main content: the dashboard.\n\nThe printing is still not ideal, but at least usable\n\n[example good\nexport.pdf](https://github.com/user-attachments/files/21125283/example.good.export.pdf)\n\n\n## Release Notes\n\nHide Kibana's header and side navigation when trying to print or use the\ndashboard export with print mode.\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"6130f2b7b523549d76ec88e99b26ac4f03c6dd10"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19","8.18","9.0"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/227095","number":227095,"mergeCommit":{"message":"[Fix] Hide chrome when printing (#227095)\n\n## Summary\n\nfix https://github.com/elastic/kibana/issues/226865\n\nProposed quick fix for https://github.com/elastic/kibana/issues/226865.\nThe main reason the dashboard print looks broken is that the new\nnavigation is expanded by default, pushing the content to the side. In\nthis PR, we use existing, well-tested functionality—chrome visibility—to\nhide the chrome along with the navigation and allow printing to focus on\nthe main content: the dashboard.\n\nThe printing is still not ideal, but at least usable\n\n[example good\nexport.pdf](https://github.com/user-attachments/files/21125283/example.good.export.pdf)\n\n\n## Release Notes\n\nHide Kibana's header and side navigation when trying to print or use the\ndashboard export with print mode.\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"6130f2b7b523549d76ec88e99b26ac4f03c6dd10"}},{"branch":"8.18","label":"v8.18.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
## Summary fix elastic#226865 Proposed quick fix for elastic#226865. The main reason the dashboard print looks broken is that the new navigation is expanded by default, pushing the content to the side. In this PR, we use existing, well-tested functionality—chrome visibility—to hide the chrome along with the navigation and allow printing to focus on the main content: the dashboard. The printing is still not ideal, but at least usable [example good export.pdf](https://github.com/user-attachments/files/21125283/example.good.export.pdf) ## Release Notes Hide Kibana's header and side navigation when trying to print or use the dashboard export with print mode. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>

Summary
fix #226865
Proposed quick fix for #226865. The main reason the dashboard print looks broken is that the new navigation is expanded by default, pushing the content to the side. In this PR, we use existing, well-tested functionality—chrome visibility—to hide the chrome along with the navigation and allow printing to focus on the main content: the dashboard.
The printing is still not ideal, but at least usable
example good export.pdf
Release Notes
Hide Kibana's header and side navigation when trying to print or use the dashboard export with print mode.