[Reporting] Remove layout management behaviour #100797
Labels
(Deprecated) Feature:Reporting
Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead
Feature:Reporting:Framework
Reporting issues pertaining to the overall framework
impact:high
Addressing this issue will have a high level of impact on the quality/strength of our product.
loe:small
Small Level of Effort
needs-team
Issues missing a team label
This issue is intended as a point of departure for other issues that can inform a more well-defined project (with stakeholders). This issue should be closed once this information has been translated to a more well-defined project.
Summary
Reporting injects custom CSS and JavaScript into the server-side rendering environment to adjust layout for print. See:
x-pack/plugins/reporting/server/lib/screenshots/inject_css.ts
x-pack/plugins/reporting/server/lib/layouts
This code is responsible for adjusting UI elements outside of the control of Reporting after they have been rendered. The adjustments optimise the UI for the requested media.
The problem
An implicit contract exists between the UI being rendered (the plugin) and the behaviour of the renderer (Reporting). If either of these changes it will often not be explicit that something may have broken in generated reports until they are re-tested. This "knowledge" that Reporting has is implicit and can be classified as tech debt since it is a burden to maintain and forces Reporting into the domain of what is being rendered not just the process of rendering.
Additionally, any issues encountered with layout are often routed to both the reporting team and the plugin team which creates ambiguity in ownership.
Remove all layout code that adjusts client components
Reporting should not have any concept of "layout" that extends to the domain of how components should respond to different view port sizes or print media. Reporting should only be responsible for rendering a page in the specified size and sharing the result.
This means that clients of reporting become fully responsible for managing layout and should provide a URL to access the print-friendly version of their content.
Path forward
We want to get consumers of reporting to a place where they are empowered to make decisions about how their app looks in the browser and on print and screen media. We also want to ensure that the UX for getting a printable version of various pieces of UI is consistent for all users (cmd/ctrl+P). This is outlined as option 2 for giving users a way to get PDF/PNG reports without saving.
Migration path
In conversation with @timroes we spoke about how removal of layout-related code (CSS and JS) in Reporting will require coordination across the Reporting, Core, Maps, Dashboard, Visualize and Canvas teams to achieve.
A solution: Pure CSS and print media solution
Plugins could add and maintain some CSS that targets print media. Hiding irrelevant visual elements and repositioning any relevant elements once a browser attempts to the print the page.
Challenges
Related issues
CC @tsullivan
The text was updated successfully, but these errors were encountered: