Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

[terra-flowsheet-data-grid] Allow flowsheet sections to have sticky title #2043

Merged
merged 6 commits into from
Feb 28, 2024

Conversation

sugan2416
Copy link
Contributor

@sugan2416 sugan2416 commented Feb 20, 2024

Summary

What was changed:

Changed flowsheet sections to have sticky titles.

Why it was changed:

When flowsheet with sections are height restricted and have more cells in row, the section header is still absolute in its position. Due to this title of terra-section-header is made sticky during horizontal scroll.
cerner/terra-core#4037
cerner/terra-core#4043

Testing

This change was tested using:

  • WDIO
  • Jest
  • Visual testing (please attach a screenshot or recording)
  • Other (please describe below)
  • No tests are needed

Reviews

In addition to engineering reviews, this PR needs:

  • UX review
  • Accessibility review
  • Functional review

Additional Details

This PR resolves:

UXPLATFORM-10215


Thank you for contributing to Terra.
@cerner/terra

Copy link
Contributor

@eawww eawww left a comment

Choose a reason for hiding this comment

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

@sugan2416 I didn't see an example or test example that demonstrated the behavior this is supposed to fix, but I was able to recreate it by manually changing styles on the existing examples. That means extra steps for each reviewer, and most UX reviewers aren't going to poke around in code. To make reviewing easier in the future, could you be sure a test example demonstrating the fix is included. Instructions in the PR on how to navigate to and recreate the conditions would be great too.

If something was available and I just missed it, please disregard most of the above.

Anyway, it looks good from a UX perspective!

@sugan2416 sugan2416 added ⭐ UX Reviewed UX Reviewed and approved. and removed UX Review Required labels Feb 22, 2024
@ShettyAkarsh
Copy link
Contributor

@sugan2416 can we add/update an example for this change ?

@ShettyAkarsh
Copy link
Contributor

added do not merge label as the section header changes has to be released and consumed here

@@ -136,6 +141,8 @@ function Section(props) {
const isGridContext = gridContext.role === GridConstants.GRID;

const hasSectionButton = isCollapsible && onSectionSelect;
const boundedWidth = isCollapsible && boundingRef && boundingRef.current ? boundingRef.current.clientWidth - 50 : null;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The 50px offset used here is to reduce button width (under header) further from the bounding width to maintain sticky header. It fails to stick when its exactly set to container width.

@github-actions github-actions bot temporarily deployed to preview-pr-2043 February 28, 2024 10:39 Destroyed
@sugan2416 sugan2416 merged commit 69091a4 into main Feb 28, 2024
22 checks passed
@sugan2416 sugan2416 deleted the flowsheet-defect branch February 28, 2024 11:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants