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
New design for default tables #7895
Conversation
Can this CSS be used for data table visualizations too (at least to some level)? If not, maybe 'table' isn't necessarily the best CSS class to use, since it's so generic. |
There are 2 things addressed in this PR:
Since the system check is just a table (nothing specific here), and since we might want to display some tables elsewhere in Piwik (e.g. plugins might want to), I chose to make this style generic (that's why the name is really generic, and again for reference it's inspired by bootstrap tables). Data tables are different since they are much more specific (plenty of features for those tables for example), I didn't change anything regarding that. We could look into it, but I think those tables are really different and they don't serve the same purpose (i.e. it's fine if they have their own style). |
I wasn't suggesting that you make any changes in this regard. The CSS class |
As it doesn't look like this is a style that would be used somewhere else I wouldn't make it generic. I would have it in the plugin that defines the system check and only there until we actually have more use cases for this table. Then it'll be also clear what name would be maybe better. I wouldn't go with Generic can be good, but wouldn't make it generic yet. We don't have to expose CSS classes for any possible use cases yet. I'd personally rather focus on the ones that we're kinda sure will be used multiple times such as dataTable and entityTables. I would not even see this here as a table even if it is technically a table. I'd see it rather as a |
I would be +1 for
I would classify "making a simple table" in the "any possible use case" category. When I see that plugin developers need to resort using the tables that are meant for reports (with the very explicit names Have you seen what a table look like in Piwik: This is a joke. And what I want to do is to fix that. Maybe my mistake was to have the system check as a central example, but the title of the pull request is
Now we could create a different style for that default/simple table. However I don't see why the system check should have its own custom style (we have already too much custom styles for everything…). I very much favor simplicity and consistency both visually and in the code for the benefit of users, core developers and plugin developers. Ideally we would have a table style for DataTable reports, and one for simple tables (and maybe another one for the site/user/alerts/… managers…). And if the style proposed here isn't good enough for a simple table design, we change it. |
Then I would maybe style I'm not sure re The questions is what kind of tables will developers create and what do we want them to create etc. I do not really want them to create tables etc at all "if possible". Re entity tables we already have a solution and instead of having to use HTML I rather want them to use a component see #6951 . It is way to hard (it's impossible) to make it all look and feel the same otherwise. For plugin settings we already wrote the Settings API to avoid having them to create any HTML/Controller... Ideally developers don't have to write any HTML for most of the cases. Still, we have to use such classes internally anyway. Those components do not replace that. I guess what I'm trying to say is that not having tables styled super awesome is not a big deal but definitely would be nice to have tables look nice out of the box. Anyway, it's okay for me as we can refactor it again later if we don't have to care about BC |
This makes sense to me, and I'd be ok w/ this. However, since Piwik uses tables in many places, making sure these styles are overridden correctly everywhere could be a daunting task. Using a separate CSS class that isn't part of the
Seems more like a table w/ checklists in it to me. |
As I explained in the PR introduction, tables are used a lot in Piwik for layout. I've tried to style default tables and it breaks many screens. Like @diosmosis said, fixing that could be a daunting task. But I definitely agree that this would be the ideal solution. The CSS class I'm suggesting is a workaround for this, just like it's done in Bootstrap and in PureCSS, but unlike MaterializeCSS and Foundation which style the default tables.
I understand, but current classes are "data" table and "entity" table… What's more generic than a table that contains data. But to be more constructive I see 2-3 kind of needs today in Piwik (maybe there's more?):
Today when we have 1., we need to use 2. or 3. as a workaround or code custom style (examples I linked to).
… In the list of example I provided, there are indeed examples of "managers". However 1, 2, 6, 7, 8 are not about managing anything, these are informational tables. There is no interaction at table, it's just a list of things displayed in a table. And for 1 and 2 I agree with @diosmosis:
FYI icons in the system check are not part of the table. If you strip the icons (which are content because not part of the table itself) and change the words, it has nothing left to do with a checklist (whereas "manager table" would stile have features to manage the list, and "report table" would still have features specific for showing/browsing/sorting report data)
I understand and agree with that, however I've had experiences with "we want to provide a generic component to edit a list of entities" and it's a huge task. But anyway, in the meantime, it doesn't address the problem n°1.
I don't understand this part, the point is that plugins will be able to use this class (so it would become API). |
I think everyone would agree to the following points:
Points of contention appear to surround making the CSS class API (ie, so plugin developers can use them) and the amount of work needed to do it for
What do you think? |
I'm pretty much ok with anything. If it's a lot of work to make it work with |
@diosmosis sounds good will do that! #7960 should definitely help in that direction too |
Created #8023 |
…mple-table class name
Renamed the Ready for final review/merge! |
@mnapoli Screenshot tests fail, some of them are very different (like the Installation DB setup page). Can you take a look? |
Thank you I have pushed an update (made the installation forms use the simple-table style). This is not really important as #7960 should be merged in 2.14 and redesign those forms anyway, but might as well keep a clean pull request so 👍 |
New design for simple table layouts w/ non-API CSS class simple-table. To be eventually replaced w/ styling table elements directly.
This PR introduces a base
table
CSS class that can be used to create simple tables:I have not styled all
<table>
tags directly because it would affect anywhere else we use tables for not displaying tables (which shouldn't happen in theory ;) but actually happens a lot, e.g. all admin forms…).The need for this is the system check in the installer/admin (see #7875): it has been redesigned during the Installer redesign, and rather to have a specific CSS for that it's better to have a simple CSS class for tables (since currently it's not possible to create a simple table in Piwik: as you can see in the demo it looks broken).
Current system check
Target (redesign mockup)
This is Rafa's mockup I have used as target:
New system check/simple tables
Icons haven't been changed yet because #7618 is still open.
Once the build has finished I will also post a link to the UI demo screenshot diff so that you can see what the simple table looks like.