Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Reporting] Remove layout management behaviour #100797

Closed
jloleysens opened this issue May 27, 2021 · 3 comments
Closed

[Reporting] Remove layout management behaviour #100797

jloleysens opened this issue May 27, 2021 · 3 comments
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

Comments

@jloleysens
Copy link
Contributor

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
  • Today we offer the ability to capture a screenshot "as is" and a screenshot that is optimised for printing on A4 paper, this is "print" vs "screen" media. Will CSS offer everything we might want for creating the kind of layouts we want for those to media for all different views users might want to print?

Related issues

CC @tsullivan

@jloleysens jloleysens added (Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead Team:AppServices labels May 27, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-reporting-services (Team:Reporting Services)

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-services (Team:AppServices)

@exalate-issue-sync exalate-issue-sync bot added impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort labels Jun 1, 2021
@exalate-issue-sync exalate-issue-sync bot added loe:medium Medium Level of Effort and removed loe:small Small Level of Effort labels Jul 8, 2021
@exalate-issue-sync exalate-issue-sync bot added impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. and removed impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. labels Aug 11, 2021
@tsullivan
Copy link
Member

tsullivan commented Oct 5, 2021

@jloleysens and I spoke earlier today and found that the existence of the xpack.reporting.capture.viewport width and height settings interfere with this effort, since the application (Dashboard) should have its own styles for print view that define the viewport width and height.

Since xpack.reporting.capture.viewport is undocumented and users have no reason to change it, I see those settings as functionally just a constant in the code.

The plan is to deprecate xpack.reporting.capture.viewport by declaring it as unused, and just use constants in the Reporting code (for now). PR: #114019. The settings will be removed from the config schema in 8.0.

@exalate-issue-sync exalate-issue-sync bot added loe:small Small Level of Effort and removed loe:medium Medium Level of Effort labels Nov 22, 2021
@sophiec20 sophiec20 added Feature:Reporting:Framework Reporting issues pertaining to the overall framework and removed (Deprecated) Team:Reporting Services labels Aug 21, 2024
@botelastic botelastic bot added the needs-team Issues missing a team label label Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

4 participants