-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
UX Unification - header component with variations #8539
Comments
Also related. |
we need subtitle also (different to count) and already used in class based views in many locations. And we need a description (or maybe info) that could be used for the count content in the abstract sense. (e.g. the dashboard username). Content that is not part of the title but provides useful header info for the page. And remember that the dashboard has an icon (ish) but it is the avatar. So the icon content should be able to house any Content maybe. Or we use template overrides as a secondary way to control content. |
See also #7190 |
Here is a Figma file with the Wagtail 3 screenshots from above, and the WIP designs for Wagtail 4: https://www.figma.com/file/3SZAkXYKTo52047weXDvb9/Wagtail-3-UI-Inventory?node-id=6613%3A40905. |
@PaarthAgarwal a few code snippets from today's discussion, some potential improvements to the shared header include.
{% block content %}
{% trans "Explorer" as title %}
{% breadcrumbs page=parent_page url_name='wagtailadmin_explore' url_root_name='wagtailadmin_explore_root' use_next_template=True as header_breadcrumbs %}
{% include "wagtailadmin/shared/header.html" with title=title merged=True breadcrumbs=header_breadcrumbs %}
<form id="page-reorder-form">
... |
Just wondering, would it be possible to make the breadcrumbs tag more generic, i.e. not dependent on the page tree? I imagine instead of working with Page objects, it could accept e.g. a list of dicts with |
@laymonage - we discussed this today and I agree that we will need to support a more generic version of the breadcrumbs template tag. I might raise this as a separate issue though. The UI team agreed with the proposed approach of using breadcrumbs outside of just showing a page tree. My thinking
|
@PaarthAgarwal as per chat today, one idea could be to move the 'search' stuff (dates/search form etc) into a row under the main row. We would need to solve for small devices so that the action buttons still show after the search form content - we can either keep the existing DOM structure and move things around with CSS grid on larger devices or go the other way (keep DOM roughly as is but move content for larger devices). Probably best to go mobile first. |
@laymonage #8767 created to solve for the generic case of a simple breadcrumb |
Pages with are not using shared header:Pages which can use shared header with little work:
Pages which can use slim header:
Pages that'll take more work to use shared header:
|
@PaarthAgarwal I have transposed that list to the main issue description (see 'issues') with just a xs/sm/md/lg framing. A few bits of feedback
|
Quick update to note we now have designs for all headers – in particular the dashboard, and page listings. Page listingsDashboardI have created a separate ticket for the summary metrics component underneath the header: #8818. |
@PaarthAgarwal - I think we should add a It can be used for the username on the dashboard page and be smaller text. I think that content will come in handy for other shared header adoption |
- relates to wagtail#8539 - fixes wagtail#3759 - rename index_submissions to submissions_index (aligns with naming of all other index views)
- relates to wagtail#8539 - fixes wagtail#3759 - fixes wagtail#3236 - rename index_submissions to submissions_index (aligns with naming of all other index views)
Most of this is now done - will look at what needs to be split out so that this issue can be closed. |
Closing as completed - left over items that are great to have but ended up being quite large have been split out:
Great work here @PaarthAgarwal ! |
Overview
There are too many variations of our header component, with and without breadcrumbs, which don’t always work well in Wagtail 3.0. They’re copy-pasted with little consistency across too many places. We need to revisit this, in particular:
Issues
w-
prefix & style against the classes no the bareheader
w-bg-grey-50
or similar on containers that have the breadcrumbs in page listing index -wagtail/admin/templates/wagtailadmin/pages/index.html
{% header %}...{% endheader %}
template tag so we can work through the headers that have a more complex sets of actionsxs
wagtail/admin/templates/wagtailadmin/home.html adopt shared header template on the dashboard view #8781sm
wagtail/admin/templates/wagtailadmin/reports/base_report.htmlAdopted shared header in reports view #8839sm
wagtail/contrib/redirects/templates/wagtailredirects/index.html adopted shared header for redirect page #8849sm
wagtail/admin/templates/wagtailadmin/workflows/index.html adopted shared header template in workflows #8850sm
wagtail/admin/templates/wagtailadmin/workflows/task_index.html adopted shared header template in workflows #8850sm
wagtail/contrib/settings/templates/wagtailsettings/edit.html Adopted shared header for menu settings editing view #8854md
(slim header) wagtail/admin/templates/wagtailadmin/pages/index.html Adopted slim header in page listing views #8792md
wagtail/contrib/forms/templates/wagtailforms/index_submissions.html Adopt shared header in Form submissions listing #8862sm
(might be done) wagtail/snippets/templates/wagtailsnippets/snippets/type_index.htmlDe-scoped
lg
wagtail/contrib/modeladmin/templates/modeladmin/index.html Adopt core shared header for ModelAdmin headers #8907Review templates that extend shared header and see if they can use the template/end tag approach insteadProposed solution
I think this could be a good addition to the Apply new page editor UX to all of Wagtail GSoC project if it goes ahead. We would need:
Component architecture
A
{% header %}
template tag, potentially with a way to pass arbitrary HTML for actions, and support for a breadcrumb. Something like:This component could have blocks so it can be overridden and used with
{% include %}
, however I think this should be reserved for really special cases (for example the homepage’s avatar) rather than be the default means of reuse. This is similar to why frameworks like React encourage composition over inheritance.Related
banner
landmark should be outside ofmain
(Rework the admin UI’s landmark based on established best practices #5411)Variants
Here are the variants I have identified so far. I believe there are more for projects that support translations.
Home
Looks a lot like other templates but has the current user’s avatar rather than an icon.
Pages listing
Legacy Wagtail 2 header style with a lot of metadata and actions
Move page
Strange combination of the Wagtail 3 header reskin with the Wagtail 2 breadcrumb
Modeladmin inspect
Similar to the above but with slightly different styles for some reason
Simple header
One of the simplest – icon + heading
Simple header w/ action
The above + action
Simple header multiple actions
I believe some instances have 3 actions.
Simple header with search
A common pattern, often including one or two actions
Header with search, actions, count
I believe this has everything we could put in the header: icon, title, count, search, actions
Header with filtering & export action
Form submission listing
ing
Breakpoints
**Important: ** Must remember that on small devices the side bar shinks down to a small corner square.
The text was updated successfully, but these errors were encountered: