Skip to content

[Lens] Remove visible title in workspace panel#82234

Merged
flash1293 merged 5 commits intoelastic:masterfrom
lykims:bug/lens-workspace-title
Nov 5, 2020
Merged

[Lens] Remove visible title in workspace panel#82234
flash1293 merged 5 commits intoelastic:masterfrom
lykims:bug/lens-workspace-title

Conversation

@lykims
Copy link
Copy Markdown
Contributor

@lykims lykims commented Nov 2, 2020

Summary

Resolves #81979.

kibana_lens_workspace_title

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@lykims lykims requested a review from a team November 2, 2020 02:59
@kibanamachine
Copy link
Copy Markdown
Contributor

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@flash1293 flash1293 self-assigned this Nov 2, 2020
@flash1293 flash1293 added Feature:Lens Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// v7.11.0 v8.0.0 labels Nov 2, 2020
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@flash1293 flash1293 added the release_note:skip Skip the PR/issue when compiling release notes label Nov 2, 2020
@flash1293
Copy link
Copy Markdown
Contributor

Thanks for working on this @lykims . I checked the PR and it seems like the empty header is still adding margin to the top - this space should be used by the chart:
Screenshot 2020-11-02 at 14 36 35

Also there are now unused css classes lnsWorkspacePanelWrapper__pageContentHeader and lnsWorkspacePanelWrapper__pageContentHeader--unsaved

Copy link
Copy Markdown
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

Checked the PR and there is some wasted whitespace in place of the header

@lykims
Copy link
Copy Markdown
Contributor Author

lykims commented Nov 3, 2020

Hi @flash1293!

Good observation! If the CSS classes lnsWorkspacePanelWrapper__pageContentHeader and lnsWorkspacePanelWrapper__pageContentHeader--unsaved are removed, the margin would still be there because of the UI element EuiPageContentHeader that has the CSS class euiPageContentHeader with margin-bottom: 24px;.

If the UI element EuiPageContentHeader is removed, then the logic !emptyExpression || title wouldn't be needed because the h1 elements would be redundant:

<EuiPageContent className="lnsWorkspacePanelWrapper">
  {!emptyExpression || title ? (
    <EuiScreenReaderOnly>
      <h1 data-test-subj="lns_ChartTitle">
        {title ||
          i18n.translate('xpack.lens.chartTitle.unsaved', { defaultMessage: 'Unsaved' })}
      </h1>
    </EuiScreenReaderOnly>
  ) : (
    <EuiScreenReaderOnly>
      <h1 data-test-subj="lns_ChartTitle">
        {title ||
          i18n.translate('xpack.lens.chartTitle.unsaved', { defaultMessage: 'Unsaved' })}
      </h1>
    </EuiScreenReaderOnly>
  )}
  ...

Then, the workspace part could simply look like:

<EuiPageContent className="lnsWorkspacePanelWrapper">
  <EuiScreenReaderOnly>
    <h1 data-test-subj="lns_ChartTitle">
      {title ||
        i18n.translate('xpack.lens.chartTitle.unsaved', { defaultMessage: 'Unsaved' })}
    </h1>
  </EuiScreenReaderOnly>
  ...

and the prop emptyExpression would become unused.

What do you think?

@flash1293
Copy link
Copy Markdown
Contributor

@lykims Sounds good to me!

If the CSS classes lnsWorkspacePanelWrapper__pageContentHeader and lnsWorkspacePanelWrapper__pageContentHeader--unsaved are removed, the margin would still be there because of the UI element EuiPageContentHeader that has the CSS class euiPageContentHeader

Yeah, removing the classes and removing the margin are two separate things I just put in a single comment

@lykims lykims requested a review from a team as a code owner November 4, 2020 00:10
@lykims
Copy link
Copy Markdown
Contributor Author

lykims commented Nov 4, 2020

@flash1293 I pushed new changes to be reviewed.

@flash1293
Copy link
Copy Markdown
Contributor

Thanks @lykims , I will take a look later today 👍

@flash1293
Copy link
Copy Markdown
Contributor

@elasticmachine merge upstream

@flash1293
Copy link
Copy Markdown
Contributor

Jenkins, test this

@flash1293
Copy link
Copy Markdown
Contributor

@lykims Seems like there's a little additonal cleanup to do:

ERROR x-pack failed
x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel_wrapper.test.tsx:39:9 - error TS2322: Type '{ children: Element; dispatch: Mock<any, any>; framePublicAPI: Mocked; visualizationState: {}; visualizationId: string; visualizationMap: { ...; }; datasourceMap: {}; datasourceStates: {}; emptyExpression: boolean; }' is not assignable to type 'IntrinsicAttributes & WorkspacePanelWrapperProps'.
Property 'emptyExpression' does not exist on type 'IntrinsicAttributes & WorkspacePanelWrapperProps'.

Copy link
Copy Markdown
Contributor

@ryankeairns ryankeairns left a comment

Choose a reason for hiding this comment

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

+1 for leaning into the dashboard-first/default-no-title approach; breadcrumb seems sufficient in this case.

@flash1293
Copy link
Copy Markdown
Contributor

@elasticmachine merge upstream

Copy link
Copy Markdown
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

Tested in Chrome and Firefox and looks great, thanks for this!

@flash1293
Copy link
Copy Markdown
Contributor

Jenkins, test this.

@kibanamachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

async chunks size

id before after diff
lens 1.0MB 1.0MB -2.0KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💝community Feature:Lens release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// v7.11.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Lens] Remove visible title in workspace panel

5 participants