Closed hughess closed 1 year ago
Latest commit: d1176cff8b86ad7ff723b89cb75d14970141edd8
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated |
---|---|---|---|---|
evidence-development-workspace | ✅ Ready (Inspect) | Visit Preview | 💬 Add your feedback | Jan 6, 2023 at 9:39PM (UTC) |
evidence-docs | ✅ Ready (Inspect) | Visit Preview | 💬 Add your feedback | Jan 6, 2023 at 9:39PM (UTC) |
This is a huge improvement on what we have.
Some thoughts for your consideration:
<slot>
of the Column. This makes it harder to achieve certain extensions.currentPage
editable and clickable.Thanks @archiewood
I'm going to take a look at the mobile search bar again, and I like your approach to abstracting the sort icons into a component - I'll add that into the new table component.
I'm not able to reproduce the header truncation issue - it should automatically add horizontal scroll even for headers only. Which browser/page width are you using?
I agree on pagination, but I think it's probably a longer-term fix because of scrolling considerations for long tables within an article and vertical scroll on mobile. I think in the future we might want to allow multiple options - e.g., pagination, vertical scroll, scrubber, etc.
Hmmm I can't repro the header issue either... Maybe I had changed something else in my branch
Re pagination I was just hoping I might be able to click on where it says page 1 and type in 500
, which would then jump me to page 500 or similar, vs clicking 500 times
Also, now I notice it, we might want to style 10000 as 10,000 in the pages
Ahh, good catch - I hadn't considered such high page numbers.
I've fixed the number formatting, but I'll need to think about the page editing idea.
If the pagination section didn't have the editable page number, would your preference be to use pagination or the data scrubber like we have in the query viewer? And does your answer change for either of these situations:
Probably depends on the size of the dataset more than these different situations. For small datasets either seems okay. For larger datasets:
I think the scrubber is probably better overall. Though I think would probably prefer the scrubber to sit vertically up the right hand size rather than the bottom
@hughess @archiewood this is really sick.
Pagination styling: alignment of elements needs a bit of work here.
Print formatting: print formatting can be a lot better (e.g., pagination buttons remain in print version) A stopgap solution here could be to display a nicer looking “X of Y records” message rather than the pagination buttons
I took a stab at the alignment and printing issues identified in the original PR, and adjusted the colouring. I'll open a PR into this branch w/ the proposed changes for your consideration. I've included some screenshots and discussion below.
In addition to the already identified issues in the PR, I would add two more. Neither of these are blocking in my opinion.
Before
After
@mcrascal looks really nice - I like it!
Just played around with the hovering - looks much cleaner. Liking the fade in on the download button too
I played around with the idea Archie had to allow an input for the page number (and using the hover feature Adam added).
@archiewood @mcrascal what do you guys think of this?
The input width is tricky to set - would need to try it with larger page numbers and see what our options are.
I dig it. Seems discoverable without being intrusive when you're just reading.
One other idea for a future release: I think it would be nice to advance the pages continuously when you hold down the next/previous page button. I often use the scrubber to visually scan data that way, and I find it demos really well for teams who are moving off of a slower tool.
Yeah I really like that.
Could have a tiny bit more spacing after the "/" before the "total pages" number to even it out? Not a biggie though.
Ok I made some modifications and got it working more consistently. I've set it up to show 3 digits, which I hope will cover most scenarios.
This isn't great for very large page numbers, but I think we'll need a better solution for those anyways, so this can be a good option until we have that.
Description
This PR is the first step in implementing improved tables in Evidence (see #468). It covers the following improvements to our
DataTable
component:Column selection: select specific columns to include in your table by using the new
Column
component like so:Column
component, you can make decisions on a column-by-column basis for the following options (more to follow in the future):title
: override the title of the columnalign
: left / center / right align the contents and header of the columnDataTable
has been replaced by page numbers and buttons shown at the bottom of the tablesortable=true
; it is on by default)search=true
, you can add a search bar to the top of your table. This is off by default to avoid cluttering your pageColumn
components - we're hoping this will be helpful in cases where you have many columns in your query and only want to export what's visible to your readersrowNumbers
: true | false - turns on or off row index numbers (off by default)rowLines
: true | false - turns on or off borders at the bottom of each row (on by default)rowShading
: true | false - shades every second row in light grey (off by default)Examples
Sample Table
Interactive Demonstration
Development Demonstration
Checklist
Issues with this PR
Column
componentsdata
object)ErrorChart
as in the previousDataTable
. This is because the error needs to be passed from theColumn
component to theDataTable
, and this will take a bit more effort to get workingIdeally, the column sort icons would be vertically centeredPagination styling: alignment of elements needs a bit of work here. This is not an issue now, but will be in the future when we want to offer more font size/density options within tablesMobile search experience: the automatic zoom-in when typing in the search bar on mobile makes the experience worse. Fix for this is increasing the font size until zoom is not required, but the required font size makes the search bar stand out from the contents of the page too muchSearch icon styling: the search icon in development mode appears in a light grey (as expected), but it appears black in production (see vercel dev-workspace preview for an example)Column
component is not used as a traditional slot, but is used to update the store used byDataTable