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

fix(weave): align tables column header cell text based on panel type #2486

Merged
merged 5 commits into from
Oct 3, 2024

Conversation

domphan-wandb
Copy link
Contributor

@domphan-wandb domphan-wandb commented Sep 25, 2024

Description

Internal JIRA: WB-17238

The JIRA reports a difficulty in difficulty in reading Tables because column header cells are left justified while numerical value cells are right justified.

This PR fixes that by using the same text alignment for the column header cell as the value cell. This solution differs from the proposed solution on the JIRA (center all header cells and cells) because typically numerical columns are right justified for visual clarity. It's easier to interpret the magnitude of cells when numerical values have the same level of precision. Non-numerical column header cells are defaulted to center text alignment.

Previous PR that introduced the issue: #875

Implementation Details

I leveraged the new WeaveFormatContext from the PR mentioned above to add a columnFormat field to specifies the column headers' textAlign value.

Screenshots

Before:
image

After:
image

One thing to note, on hover-over, the EllipsisIcon to trigger the Popup will overlap the column name text due to its negative margin.
image

I thought this behavior is acceptable because it currently happens when the column widths are resized smaller than the column header text.

edit(10/02): See update below

Testing

How was this PR tested?
Visually with my pytorch-intro project.

Update to handle overlapping indicators

I took a display approach that material-ui data grid uses to place the indicators on the opposite side in reverse for numerical columns. This mitigates the ellipses stacking on the right justified column name.

Here's the column header on hoverover:
image

When pinned on hoverover:
image

Pinned, sorted on hoverover:
image

Without hoverover:
image

@domphan-wandb domphan-wandb requested review from a team as code owners September 25, 2024 23:03
Copy link
Contributor

github-actions bot commented Sep 25, 2024

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@domphan-wandb domphan-wandb force-pushed the dom/consistent-panel-formatting branch from 4b98cf5 to 13b3646 Compare September 25, 2024 23:09
@circle-job-mirror
Copy link

circle-job-mirror bot commented Sep 25, 2024

@domphan-wandb
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

Copy link
Collaborator

@jamie-rasmussen jamie-rasmussen left a comment

Choose a reason for hiding this comment

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

Even though this PR doesn't introduce the problem with the ellipsis it does seem like it would be encountered a lot more frequently with this change. This is part of a larger problem with indicators in the header e.g pinned columns.

I don't know how hard it would be to fix the underlying issue, but you might want to take a crack at it before merging this one in.

@domphan-wandb domphan-wandb force-pushed the dom/consistent-panel-formatting branch from 103c656 to 77a492b Compare October 2, 2024 01:48
@domphan-wandb domphan-wandb force-pushed the dom/consistent-panel-formatting branch from 77a492b to 79a29b3 Compare October 2, 2024 15:03
@domphan-wandb domphan-wandb force-pushed the dom/consistent-panel-formatting branch from 2022f09 to 05f94db Compare October 2, 2024 22:18
@domphan-wandb domphan-wandb merged commit d24a147 into master Oct 3, 2024
79 checks passed
@domphan-wandb domphan-wandb deleted the dom/consistent-panel-formatting branch October 3, 2024 21:47
@github-actions github-actions bot locked and limited conversation to collaborators Oct 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants