mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 09:59:47 -05:00
Reported one after another, all in the Admin Panel, and they turned out to share
two causes: a stylesheet deciding a table's width from outside the design that
owns it, and a pane having to write for itself what every pane needs.
The tables
* Admin Panel / People / People rendered NOTHING - no table, no search box, no
pager. `buildFilters` and `buildActions` were used in peopleTablePageData but
never imported. That is not a build error: it is a ReferenceError thrown inside
a helper while rendering, which Blaze answers by rendering nothing at all.
Organizations, Teams and Domains use neither function, so they drew normally,
which is what made it look like a People-only problem.
* The right-hand side of a table was off screen - reported on Domains, and just
as true of Admin Panel / Version, where the value column was cut off at the
window edge. Two admin stylesheets forced `min-width: 1200px !important;
width: max-content !important` with nowrap cells on a bare `table` selector.
peopleBody.css had no page in the selector at all, so it reached every table in
WeKan, and `!important` beat the shared table page's own width:100% +
table-layout:fixed. The same rules also made a SHORT table shrink to its
content, which is why Domains sat at a third of the panel on a narrow window.
No admin table is forced wide any more: it fits its panel and its cells wrap,
and the phone-width exception that used to undo the floor is simply the rule at
every width. The shared table page's width and wrapping are `!important` now -
a guarantee a stylesheet in another folder can silently override is not a
guarantee.
* An empty table page rendered no table at all, and the "New" link of
Organizations, Teams, People and Translation is a column HEADER - so an empty
pane had no way to create the first row. The table always renders now; the
"no items" message moved below it.
* The controls row: every control shares one height and no margin. forms.css is
`button { display: block; margin-bottom: 14px }`, written for stacked form
buttons, so a button that kept that margin was centred higher than one that did
not - "Unlock all users" sat lower and shorter than "Teams" beside it, since it
also carried a 20px margin and a 28px height from the old hand-written header.
Action buttons are themed with the pager, in the one stylesheet that owns those
colours, every state spelled out, or a bare <button> falls through to the
forms.css fallback, which is literally black.
Admin Panel / Settings / Translation now renders through the shared table page
(docs/Design/Page/Table.md) instead of a hand-written table: four columns, an
interactive row, the "New" link as a column header. It pages ONE page of 25
server-side with limit/skip and a count method, where it used to grow a window by
infinite scroll; the publication publishes the field it is sorted by, so the
client's sort matches the server's page.
The pane title
Every Admin Panel pane opens with the same heading, and the heading is the ACTIVE
LEFT MENU ENTRY's own label - `paneTitle()` in models/lib/leftMenu.js, one class
`.admin-pane-title`, which the shared table page's own title carries too. Before
this only the paginated table pages had a title at all: Domains said "Domains"
while Login, Announcement, Accessibility, PWA and Version opened with no heading.
Deriving it from the menu is what keeps them identical - a pane cannot end up with
a title of a different size or none at all - and it is why a table page inside the
Admin Panel now passes no titleKey: the section already rendered the heading.
The menus
* Version is the FIRST pane of Admin Panel / Settings and the one that opens with
the page, so what an admin sees first is the version, database and system
information they usually came for. Its page, its one-entry menu and its tab are
gone - a page whose menu had a single entry was a page in name only - and
/information redirects to Settings, the same move Translation made.
* Admin Panel / People: Domains moves up beside E-mail, the settings it is about.
* Admin Panel / Attachments: Backup moves to the top.
Tests: tests/tablePage.test.cjs gains the Translation conversion, the empty-table
header, the one-height controls row, the themed actions and a guard that no admin
stylesheet may force a table's width; tests/leftMenu.test.cjs gains the pane title
(helper, template, every page renders it, one shared size) and Version as the
first Settings pane; tests/translationPane.test.cjs is rewritten for the pane that
is left once the shared design owns the table.
Thanks to xet7 !
223 lines
8.6 KiB
CSS
223 lines
8.6 KiB
CSS
/* The ONE table page layout. Design: docs/Design/Page/Table.md
|
|
Used by every paginated admin table (Security, Speed, Tests, CPU usage, Files,
|
|
Rules, Boards, Cards, Impersonation, Recovery). Defined once here so a fix to
|
|
the layout reaches every page instead of one report at a time. */
|
|
|
|
/* Rows, top to bottom: title, status, controls, table. Plain block order - no
|
|
flex `order` anywhere, so the DOM order in tablePage.jade IS the visual order,
|
|
in both LTR and RTL. */
|
|
.table-page {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 12px;
|
|
/* min-width:0 lets this shrink inside the flex .main-body; without it a wide
|
|
table sets a min-content floor and pushes the panel's right edge past the
|
|
window, which is exactly the "table runs off-screen" report. */
|
|
min-width: 0;
|
|
max-width: 100%;
|
|
}
|
|
|
|
.table-page-title {
|
|
margin: 0;
|
|
}
|
|
|
|
.table-page-desc {
|
|
margin: 0;
|
|
}
|
|
|
|
/* Search on the start side, pagination pushed to the end. margin-inline-start
|
|
mirrors automatically in RTL. Wraps to a second line rather than overflowing
|
|
when the panel is narrow. */
|
|
.table-page-controls {
|
|
display: flex;
|
|
flex-direction: row;
|
|
align-items: center;
|
|
flex-wrap: wrap;
|
|
gap: 10px;
|
|
min-width: 0;
|
|
}
|
|
|
|
.table-page-controls input.js-table-page-search {
|
|
flex: 0 1 320px;
|
|
min-width: 0;
|
|
max-width: 100%;
|
|
padding: 0 8px;
|
|
height: 34px;
|
|
}
|
|
|
|
/* ONE height and NO margins for everything in the controls row, so the search
|
|
field, the action buttons and the prev/next buttons share the same top and
|
|
bottom edge instead of each floating at its own y.
|
|
|
|
The global `button` rule in forms.css is `display: block; margin-bottom: 14px;
|
|
min-height: 41px` - written for stacked form buttons. In this row that margin is
|
|
part of the flex item's box, so a button carrying it is centred HIGHER than one
|
|
without: the pager buttons kept the 14px and the action buttons did not, which is
|
|
exactly the "Teams is higher, Unlock all is lower" misalignment. Height and
|
|
margin belong to the layout, so they are set here, once, for every control in the
|
|
row; the colours stay in paginationControls.css.
|
|
|
|
The pager selector is spelled out because paginationControls.css sizes
|
|
`.table-page-pagination button` at the same specificity as a plain
|
|
`.table-page-controls button` - whichever file happened to load last would win,
|
|
which is not something a layout rule may depend on. */
|
|
.table-page-controls button,
|
|
.table-page-controls .table-page-pagination button,
|
|
.table-page-controls button.js-table-page-action {
|
|
margin: 0;
|
|
height: 34px;
|
|
min-height: 34px;
|
|
}
|
|
|
|
/* Layout only. The COLOURS of the prev/next buttons and of the "3 / 42" counter
|
|
come from the one shared pager stylesheet, client/components/main/
|
|
paginationControls.css, which every pager in WeKan uses: they follow the
|
|
per-user theme accent (Member Settings -> Change color sets --theme-accent on
|
|
:root) and fall back to the WeKan default blue when no custom theme is chosen.
|
|
Do NOT restate the button colours here. That stylesheet spells out :hover,
|
|
:focus, :active and :active:hover on purpose, because the global button rules
|
|
in forms.css set those states from --theme-accent with a BLACK/grey fallback at
|
|
equal or higher specificity - a partial copy loses the moment the button is
|
|
clicked and leaves a black button sitting on the page. */
|
|
.table-page-pagination {
|
|
margin-inline-start: auto;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
}
|
|
|
|
/* Filter dropdowns, action buttons and the total: the controls-row features that
|
|
came from Admin Panel / People. Same height as the search field so the row
|
|
reads as one strip, and all of them shrink before the row wraps. */
|
|
.table-page-controls select.js-table-page-filter {
|
|
height: 34px;
|
|
min-width: 0;
|
|
max-width: 100%;
|
|
padding: 0 6px;
|
|
}
|
|
|
|
/* The icon centred beside the label, on one line. Height and margin come from the
|
|
shared control rule above, so an action button lines up with the search field and
|
|
with the prev/next pair. (People's "Unlock all users" used to bring its own 20px
|
|
top margin and 28px height from the old page header, and sat lower and shorter
|
|
than "Teams" next to it.) Layout only; the colours are in paginationControls.css
|
|
with the pager. */
|
|
.table-page-controls button.js-table-page-action {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 6px;
|
|
padding: 0 12px;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
/* The total sits with the controls, not in the table: it counts the whole result
|
|
set, not the page. Inherits its colour so it stays readable on a dark theme. */
|
|
.table-page-total {
|
|
color: inherit;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
/* Last-resort sideways scroll for the table only - never the whole page. */
|
|
.table-page-table-wrap {
|
|
max-width: 100%;
|
|
overflow-x: auto;
|
|
}
|
|
|
|
/* Full width, equal columns, wrapping text - at EVERY window width.
|
|
`table-layout: fixed` is what makes the columns an equal share of the width AND
|
|
what makes width:100% binding: with the default `auto` layout the browser sizes
|
|
columns to their content, so one long id or file name widened the table past
|
|
the panel and the right-hand columns ended up outside the window - and a table
|
|
with two short columns shrank to a third of the panel instead of filling it.
|
|
|
|
`!important` on the three properties that ARE this design: they have twice been
|
|
overridden from outside by app-wide `table { width: max-content !important;
|
|
min-width: 1200px !important }` rules that a page stylesheet declared with no
|
|
page in the selector. Those are fixed, but an unscoped `table` rule anywhere in
|
|
the app must never be able to decide the width of a table page again - a rule
|
|
that a stylesheet in another folder can silently break is not a guarantee. */
|
|
.table-page-table {
|
|
width: 100% !important;
|
|
max-width: 100% !important;
|
|
table-layout: fixed !important;
|
|
border-collapse: collapse;
|
|
}
|
|
|
|
/* Cells wrap and carry no minimum of their own - `white-space: nowrap` or a
|
|
`min-width` on a cell is the other way a table grows past its panel, and admin
|
|
stylesheets used to set both on every `table td` in the app.
|
|
|
|
The wrapping is `!important` for the same reason the width above is: it IS the
|
|
design, and it was being switched off from outside by app-wide `table td`
|
|
rules. A cut-off id or a value that runs under the next column is the same
|
|
report as a table running off the right edge - and it is the wrapping, not the
|
|
width, that fixes it once a column is narrow. */
|
|
.table-page-table th,
|
|
.table-page-table td {
|
|
text-align: start;
|
|
padding: 4px 8px;
|
|
border-bottom: 1px solid rgba(0, 0, 0, 0.08);
|
|
vertical-align: top;
|
|
min-width: 0 !important;
|
|
/* Long unbroken text (ids, URLs, file names, stack details) must wrap inside
|
|
its cell instead of widening the column. `anywhere` breaks a long word that
|
|
has no space in it; `break-word` is the older spelling kept for Safari. */
|
|
white-space: normal !important;
|
|
overflow-wrap: anywhere !important;
|
|
word-break: break-word !important;
|
|
}
|
|
|
|
.table-page-table th {
|
|
font-weight: 700;
|
|
}
|
|
|
|
/* Opt-in per column from the column spec. */
|
|
.table-page-table .table-page-end {
|
|
text-align: end;
|
|
}
|
|
|
|
/* The one opt-out, per column from the column spec (the datetime columns). Two
|
|
classes plus !important, so it still beats the !important wrapping above - a
|
|
guarantee that cannot be opted out of on purpose is a bug of its own. */
|
|
.table-page-table .table-page-nowrap {
|
|
white-space: nowrap !important;
|
|
overflow-wrap: normal !important;
|
|
word-break: normal !important;
|
|
}
|
|
|
|
/* Severity, coloured from the cell's own data attribute so the rule lives with
|
|
the table rather than in each report's stylesheet. */
|
|
.table-page-table td[data-sev='high'],
|
|
.table-page-table td[data-sev='critical'] {
|
|
color: #c0392b;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.table-page-empty {
|
|
padding: 8px 0;
|
|
}
|
|
|
|
/* Narrow windows: the side menu goes full width on top and the table sits BELOW
|
|
it, instead of the two being squeezed side by side. Above this width the menu
|
|
stays on the start side with the table next to it.
|
|
|
|
This deliberately overrides the older "always side by side, even on narrow
|
|
windows" rule in settingBody.css: keeping both on one row left the table a few
|
|
dozen pixels wide on a phone, with its right-hand columns unreachable. 800px is
|
|
the same phone breakpoint the rest of WeKan uses. */
|
|
@media screen and (max-width: 800px) {
|
|
.setting-content .content-body {
|
|
flex-wrap: wrap;
|
|
}
|
|
.setting-content .content-body .side-menu {
|
|
width: 100%;
|
|
flex: 1 1 100%;
|
|
}
|
|
.setting-content .content-body .main-body {
|
|
flex: 1 1 100%;
|
|
/* The table wraps now, so the panel itself never needs to scroll sideways. */
|
|
overflow-x: auto !important;
|
|
}
|
|
}
|