docs/Design/Table-Page.md -> docs/Design/Page/Table.md, with every reference updated: the three design docs that link to it (History, CPU-usage, Recovery), the code comments in the shared template, stylesheet and helpers, and the four test suites that read it. Its own link to History.md is re-based, since the file is one level deeper now. docs/Design/Page/Left-Menu.md is the second page design: the menu beside the content on every Admin Panel page. It records what those seven menus share, which pages use it, the entry shape, and how a page adds one. Which side it is on is part of the design, not an accident of the markup: for a left-to-right language the menu is on the LEFT with the content to its right; for a right-to-left language the whole panel MIRRORS - the menu is on the right, the content to its left, and inside each entry the icon and label mirror too. That works only through the document direction plus logical CSS, so the doc says to never write left/right/margin-left/padding-left for this menu. Checking that turned up two places where the current CSS did exactly that: - .side-menu had `box-shadow: inset -0.2vh ...`. An inset shadow offset on the X axis is a PHYSICAL direction and does not mirror, so it shaded the wrong inner edge once the menu moved to the right. The X offset is dropped. - the entries used `padding: 1.3vh 0 1.3vh 1.3vw`, i.e. padding-LEFT, so under an RTL language the indent stayed on the left - the outer edge of a right-hand menu. Now padding-block + padding-inline-start. Theme: the menu was entirely hard-coded greys. Most of it stays neutral on purpose - it is chrome, and tinting the whole card would fight the content beside it - but the entry you are ON now takes the per-user theme accent (Member Settings -> Change color sets --theme-accent on :root), with `inherit` as the fallback so the WeKan default look is byte-for-byte unchanged when no colour is chosen. No brand colour is hard-coded in the menu. The shared pieces are in place: client/components/settings/leftMenu.jade renders the menu from an item list, and models/lib/leftMenu.js turns (items, activeId) into it - marking exactly ONE entry active, dropping conditional holes, and supporting group separators. Tests: tests/leftMenu.test.cjs is the one suite for this design - the pure helpers, the template, the mirroring, the theming, the shared narrow-window stacking, and that every path in the doc's related-files table exists. NOT done yet: the seven Admin Panel templates still render their own copy of the menu markup. Converting them to +leftMenu is the next step; the design, the template, the helpers and the tests it will be checked against are ready. Thanks to xet7 !
6.8 KiB
Design: the Left Menu
One design, one implementation, for the menu beside the content on every Admin Panel page: a list of entries, each an icon and a label, with the current one highlighted.
This page is the single source for everything those menus have in common. A page-specific design doc describes only what is different about that page and links back here.
Pages that pair this menu with a paginated table also use Table — the two designs compose: menu on the reading-start side, table beside it.
Related files
| File Path | File Type | Description |
|---|---|---|
client/components/settings/leftMenu.jade |
.jade template |
The left menu: the .side-menu list, its entries and the active row. |
models/lib/leftMenu.js |
.js module, pure helpers |
buildMenuItems() turns a plain item list plus the active id into what the template renders. activeCount() proves only one row is ever active. |
client/components/settings/settingBody.css |
.css stylesheet |
The .side-menu look and width, and the flex row that places it beside .main-body. Shared by every Admin Panel page. |
client/components/settings/tablePage.css |
.css stylesheet |
The ≤ 800px rule that stacks the menu above the content instead of squeezing both onto one row. |
client/components/settings/settingBody.jade |
.jade template |
Admin Panel / Settings. |
client/components/settings/peopleBody.jade |
.jade template |
Admin Panel / People (People, Organizations, Teams, Domains, Locked users, Roles, Templates). |
client/components/settings/adminFeatures.jade |
.jade template |
Admin Panel / Features. |
client/components/settings/attachments.jade |
.jade template |
Admin Panel / Attachments. |
client/components/settings/adminReports.jade |
.jade template |
Admin Panel / Problems. |
client/components/settings/translationBody.jade |
.jade template |
Admin Panel / Translation. |
client/components/settings/informationBody.jade |
.jade template |
Admin Panel / Info. |
tests/leftMenu.test.cjs |
.cjs Node test |
The one suite: the pure helpers, the template, the side placement and mirroring, and that no page re-implements the menu. |
Pages that use this design
Admin Panel
| Menu name | Menu path | Description |
|---|---|---|
| Settings | Admin Panel / Settings | Registration, E-mail, Accounts, Table visibility mode, Announcement, Accessibility, Layout, Webhook. |
| People | Admin Panel / People | People, Organizations, Teams, Domains, Locked users, Roles, Shared templates. |
| Features | Admin Panel / Features | Performance, Security, Notifications. |
| Attachments | Admin Panel / Attachments | The storage backends and the attachment/avatar tools. |
| Problems | Admin Panel / Problems | Summary, Security, Speed, Tests, CPU usage, then the reports — see Table. |
| Translation | Admin Panel / Translation | The single Translation entry. |
| Info | Admin Panel / Info | The single Info entry. |
Which side the menu is on
The menu is on the side the language starts from.
- Left-to-right languages (English, Finnish, German, …) — the menu is on the left, the content to its right.
- Right-to-left languages (Arabic, Hebrew, Persian, …) — the whole panel is mirrored: the menu is on the right and the content to its left. Inside each entry the contents mirror too — the icon sits on the right of its label, and the label reads from the right edge.
Nothing in the markup says "left". The mirroring comes from the document
direction (dir=rtl on <html>, set from the user's language) plus logical
CSS properties, so there is one stylesheet and one template for both directions:
text-align: startrather thanleft, so a label aligns to the reading start.margin-inline-*/padding-inline-*rather thanmargin-left/padding-left, so an icon's gap flips with the direction.- Ordinary flex order for the row, which reverses under
dir=rtlon its own.
Never write left, right, margin-left or padding-left for this menu: a
physical property does not flip, and produces a right-hand menu whose entries are
still indented from the left.
Theme
Most of the menu is deliberately neutral: the panel is a light grey card
(#f7f7f7 on #f0f0f0) and the row you are on, or hover, lifts to white with a
soft shadow. That is the WeKan default look and it does not change with the theme
— a menu is chrome, and tinting the whole card would fight the content beside it.
The themeable part is the active entry's label:
.side-menu ul li.active > a { color: var(--theme-accent, inherit); }
- Per-user theme — Member Settings → Change color sets
--theme-accenton:root, and the entry you are on picks it up, for that user only. - WeKan default — with no custom colour the fallback is
inherit, so the label keeps the normal text colour and the menu looks exactly as it always has.
So: nothing in the menu is hard-coded to a brand colour, and the one part that
should follow a chosen theme does. If you add a themeable part, take the colour
from var(--theme-accent, …) with a fallback that reproduces today's look, and
never introduce a second accent variable.
The Font Awesome icons inherit their colour from the entry, so an active entry's icon follows the accent with the label.
Layout
- Wide windows — the menu keeps a fixed width beside the content, which fills the rest of the row.
- Narrow windows (≤ 800px) — the menu goes full width on top and the content
sits below it, rather than the two being squeezed side by side. The rule
lives in
tablePage.cssand applies to the whole.content-body, so both designs stack the same way.
Entries
A page describes its menu as data, not as markup:
{ id, icon, labelKey, cls } // one entry
{ separator: true } // a horizontal rule between groups
idis what the page's click handler reads fromdata-id.iconis the Font Awesome class,labelKeyan i18n key.buildMenuItems(items, activeId, jsClass)marks exactly one entry active, from the id the page passes in — so a menu cannot highlight two rows at once, which is what happens when each entry has its ownisXActivehelper.- A conditional entry may be
null(e.g. the E-mail entry is absent on Sandstorm); holes are dropped rather than rendered as an empty row.
Clicks
Every entry carries the shared js-left-menu-item class and, optionally, the
page's own class, so a page keeps one handler:
'click .js-left-menu-item'(event, tmpl) { ...read data-id... }
Adding an entry is a line in the item list. It needs no markup, no CSS and no new handler.
Adding a page
- Build the item list.
- Render
+leftMenu(menuItems)beside.main-bodyinside.content-body. - Handle
click .js-left-menu-itemand switch ondata-id.