Skip to content

[Fix] Hide chrome when printing #227095

Merged
Dosant merged 2 commits intoelastic:mainfrom
Dosant:d/2025-07-08-fix-dashboard-print
Jul 10, 2025
Merged

[Fix] Hide chrome when printing #227095
Dosant merged 2 commits intoelastic:mainfrom
Dosant:d/2025-07-08-fix-dashboard-print

Conversation

@Dosant
Copy link
Contributor

@Dosant Dosant commented Jul 8, 2025

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.

@Dosant Dosant requested a review from a team as a code owner July 8, 2025 16:04
@Dosant Dosant added release_note:fix Team:SharedUX Platform AppEx-SharedUX (formerly Global Experience) t// backport:all-open Backport to all branches that could still receive a release labels Jul 8, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/appex-sharedux (Team:SharedUX)

Copy link
Member

@tsullivan tsullivan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Dosant
Copy link
Contributor Author

Dosant commented Jul 9, 2025

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.

Weird! I tried 9.1 and it seems like it depends on something else?
For example with search nav + sample dashboard I didn't reproduce, but I reproduced with security nav and security dashboard

https://github.com/user-attachments/files/21139207/Elastic.Security.Detection.rule.monitoring.pdf

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.

It looks like it is streched without this PR with solution nav , I filed #227187

Copy link
Member

@umbopepato umbopepato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Scheduled PDF reports work well too:
image

@Dosant Dosant added backport:version Backport to applied version labels v9.1.0 v8.19.0 v8.18.4 v9.0.4 and removed backport:all-open Backport to all branches that could still receive a release labels Jul 10, 2025
@Dosant Dosant merged commit 6130f2b into elastic:main Jul 10, 2025
21 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.18, 8.19, 9.0, 9.1

https://github.com/elastic/kibana/actions/runs/16190861497

kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Jul 10, 2025
## 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)
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Jul 10, 2025
## 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)
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Jul 10, 2025
## 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)
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Jul 10, 2025
## 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)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.18
8.19
9.0
9.1

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jul 10, 2025
# 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>
kibanamachine added a commit that referenced this pull request Jul 10, 2025
# 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>
kibanamachine added a commit that referenced this pull request Jul 10, 2025
# 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>
kibanamachine added a commit that referenced this pull request Jul 10, 2025
# 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>
kertal pushed a commit to kertal/kibana that referenced this pull request Jul 25, 2025
## 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:fix Team:SharedUX Platform AppEx-SharedUX (formerly Global Experience) t// v8.18.4 v8.19.0 v9.0.4 v9.1.0 v9.2.0

5 participants