-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add ground truth dividers to Annotations table and correct all …
…annotation counts (#949) #433 Demo: https://dev-annotation-dividers.cryoet.dev.si.czi.technology/runs/241 @codemonkey800's original PR: 3e17d89 - Displays a divider before each ground truth/non ground truth sequence of rows in the table. - Also displays dividers with 0 count if that section is empty. - See the issue for discussions re: various edge cases. - Changes all counts (total, filtered, ground truth, and non ground truth) to count the unique `shape_type` and `annotation_id` pairs represented in `annotation_files` using `distinct_on` to match the number of rows displayed in the tables. - Removes the need to sum counts on the frontend. I'm not super satisfied with having to have 2 callbacks in AnnotationsTable.tsx for displaying dividers, but couldn't really think of something better that still worked well with react-table and satisfied the UX requirements for displaying dividers when there are no rows for that section. Making the data type a union between `Annotation` and something else that represents a divider messes up the types of the column helper, and allowing `<Table>` to take a wrapper component would be the same problem but probably even uglier because it would have to take 2, one to wrap `<table>` and one to wrap the `<tr>`s. If I had to I'd probably pick the union type option and just send down the actual divider `ReactNode`s in the `data` array as rows, but that just feels like abusing react-table...
- Loading branch information
Showing
13 changed files
with
297 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 6 additions & 12 deletions
18
frontend/packages/data-portal/app/components/Table/PageTable.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.