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: improve sorting for multi-type columns #10123

Merged
merged 2 commits into from
Oct 29, 2024

Conversation

ashtonG
Copy link
Contributor

@ashtonG ashtonG commented Oct 24, 2024

Ticket

ET-836

Description

this improves the experience for interacting with multi-type columns:

  • as sorting is type-agnostic, the multi-sort menu will show all affected types as badges next to the column name

  • all columns with the same key will appear as sorted in the header

  • multisort menu copy is updated to use the unspecified copy for these columns, instead of specific copy (but header copy for sort menu items remains the same).

Test Plan

with a project with multi-type metadata columns, visit the project runs page.

  • metadata options in the multi-sort menu should report all types in the project
  • all multi-type options of the same key should appear sorted when the column sort is applied
  • you should be able to change the direction of the sort by interacting with the header menu.

Checklist

  • Changes have been manually QA'd
  • New features have been approved by the corresponding PM
  • User-facing API changes have the "User-facing API Change" label
  • Release notes have been added as a separate file under docs/release-notes/
    See Release Note for details.
  • Licenses have been included for new code which was copied and/or modified from any external code

Copy link
Contributor

@thiagodallacqua-hpe thiagodallacqua-hpe left a comment

Choose a reason for hiding this comment

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

There's a bug where the column types are being grouped by the name, and, same as the bug that I solved in the #10046 the bannedColumns are including the duplicate of the array type. Perhaps you can rebase from that branch to also the fix.

Screenshot 2024-10-24 at 17 48 44

this improves the experience for interacting with multi-type columns:

* as sorting is type-agnostic, the multi-sort menu will show all
affected types as badges next to the column name

* all columns with the same key will appear as sorted in the header

* multisort menu copy is updated to use the unspecified copy for these columns, instead of
specific copy (but header copy for sort menu items remains the same).
@ashtonG ashtonG force-pushed the bug/ET-836/metadata-sort-bug branch from 177b997 to aff0f22 Compare October 25, 2024 19:44
Copy link

codecov bot commented Oct 25, 2024

Codecov Report

Attention: Patch coverage is 59.30233% with 35 lines in your changes missing coverage. Please review.

Please upload report for BASE (thiago/ET-790@933c480). Learn more about missing BASE report.

Files with missing lines Patch % Lines
webui/react/src/pages/FlatRuns/FlatRuns.tsx 3.57% 27 Missing ⚠️
webui/react/src/components/MultiSortMenu.tsx 86.20% 7 Missing and 1 partial ⚠️
Additional details and impacted files
@@               Coverage Diff                @@
##             thiago/ET-790   #10123   +/-   ##
================================================
  Coverage                 ?   53.82%           
================================================
  Files                    ?      447           
  Lines                    ?    77383           
  Branches                 ?     3656           
================================================
  Hits                     ?    41648           
  Misses                   ?    35600           
  Partials                 ?      135           
Flag Coverage Δ
web 54.07% <59.30%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
webui/react/src/components/MultiSortMenu.tsx 88.00% <86.20%> (ø)
webui/react/src/pages/FlatRuns/FlatRuns.tsx 11.03% <3.57%> (ø)

@ashtonG
Copy link
Contributor Author

ashtonG commented Oct 28, 2024

@thiagodallacqua-hpe it went away with the rebase as the multi-sort column select uses the same banned columns property.

Copy link
Contributor

@thiagodallacqua-hpe thiagodallacqua-hpe left a comment

Choose a reason for hiding this comment

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

Just a minor FYI, other than that LGTM

Comment on lines 166 to 181
const badges = typeMap[c.column].map((type) => {
const copy =
(runColumns as readonly string[]).includes(c.column) &&
type === V1ColumnType.UNSPECIFIED
? 'BOOLEAN'
: removeColumnTypePrefix(type);
return (
<Fragment key={type}>
<Badge text={copy} />{' '}
</Fragment>
);
});
const label = (
<>
{c.displayName || c.column} {badges}
</>
Copy link
Contributor

Choose a reason for hiding this comment

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

tbh... idk if it's better to show the badges grouped or individually, for instance, the first time that I saw it I thought that it was a bug 😅... maybe that's something to keep in mind when we add documentation for the release

@ashtonG ashtonG merged commit 2f0b14c into thiago/ET-790 Oct 29, 2024
75 of 91 checks passed
@ashtonG ashtonG deleted the bug/ET-836/metadata-sort-bug branch October 29, 2024 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants