mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 20:45:00 -05:00
d1be2d2131714d023a22a6ffc0a94de651dc7f4e
40
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
e34a488617 |
Phone, foldable, tablet, laptop and 55" touchscreen: the new UI checked upright and on its side.
tests/playwright/specs/viewport-matrix.e2e.js opens WeKan as an iPhone 15, an unfolded Galaxy Z Fold 7, an iPad Pro 11, a 1366x768 laptop and a 55" 4K touch panel, each upright and on its side, and checks the board header, board menu -> Original positions, Problems -> Memory Usage and Disk usage, the Table, Calendar Mode, Time, Timeline and Map views, and dragscroll by mouse or by finger. It measures that icons and texts are on screen and not drawn in the colour behind them, that the page never scrolls sideways, that every column can be reached and stays readable; screenshots of each step go to .tools/log/viewports/. What it found, fixed: - iPhone: the header bar was width: 100% plus its side padding as a content box, 24px wider than the screen, and the sidebar hamburger sat past the right edge. It measures its padding inside now. - Admin Panel left menu on a phone: the list's disc bullets showed as a dot after every entry, and a rule between groups shrank to a dash beside an entry. No bullets, and each group starts a row of its own. - Admin tables: 13 equal columns were 25px each on a phone and 42px on an upright iPad, every header one letter per line. Up to 1024px a column keeps a readable floor and the table scrolls sideways in its wrapper. - Table view: the title-wrap and swimlane-group toggles were white icons on white - two empty squares - stretched to 72px by the global button padding. And on an upright iPad or foldable, Members, Labels and the date columns lay past the edge of an overflow-hidden board with nothing to scroll; the view scrolls sideways itself now. A swipe that starts beside a list's resize handle resizes the list, as it should, so the dragscroll check starts where a person pans. The file runs in Chromium only: device emulation and the touch swipe exist only there. Thanks to xet7 ! |
||
|
|
b7589737f5 |
File docs/Features the way the WeKan menus are.
A feature's guide now sits under the menu it is used from, read from the templates rather than from where somebody once put it: Header-Bar, All-Boards, Pages, Board-Header (search and every Board View), Board-Sidebar (Board Settings, Filter, Members, Labels, Archive), Rules, Swimlanes, Lists, Cards, Member-Settings, Admin-Panel and Login-Page. Topics used from several menus (editor, history, theme, translations, email, troubleshooting) are in General. - Each area has a README mapping its menu entries to their guides and to the template or server module that implements them. Board-Header/README.md lists all 40 Board View entries with the template boardBody.jade renders; five views (Table, Calendar Mode, Time, Timeline, Map) have no guide of their own yet and say so. - Board-View.md listed 25 views while BOARD_VIEWS has 40; it now lists all of them with their English labels. - Pages keep their file names. Where a released changelog links an old path, a "# Moved" page stays there and points to the new one; test-menu.sh skips folders holding only those. - Undo was filed under Login; it is General/Undo now. - Every link in docs, code comments, scripts and tests follows the move; docsLinksResolve checks them all. Tests that read a doc follow it to its new place. boardViewSettings now fails when Board-View.md or Board-Header/README.md differs from BOARD_VIEWS, or names a template boardBody.jade does not render. Thanks to xet7 ! |
||
|
|
e4ae7c2829 |
Show image previews on cards again: a real cover picture, and a neutral attachment tile.
Reported by email against v12.12: "Preview of Images is gone". On the board
a card with an image cover showed a flat coloured band, and in the open card
the attachment row showed a small mark on a blue bar instead of the picture.
Two separate faults:
- The minicard cover() helper loaded the attachment and then returned only
a wrapper with link(). attachmentPreviewUrl() needs the attachment's _id,
so it returned '' and the cover became url('?dummyReload...') - a request
for the page itself. The helper now returns the attachment, as
models/cards.js cover() does, keeping the linked-card lookup and the
soft-delete check.
- The attachment thumbnail is a <button> (the keyboard control with its
aria-label), and forms.css fills every button with the theme accent at
rest and on hover, focus and active. The local override only cleared
padding, border and font. Every state is now reset: a fixed 144x96 frame
(96x64 below 800px) on #f4f5f7, the whole picture shown with object-fit
contain, a 2px focus outline. My Attachments, which uses the same classes
on a div, keeps its previous sizing.
The board cover and the open-card cover are now img elements of the
thumbnail, drawn only when there is a URL: cover-fitted 120px bands on the
board (100px on the modern theme) and 180px in the open card, which used the
full original before. A thumbnail that fails to load falls back to the
original once and stops, without logging. The invalid `border-radius: top`
is gone. The table page's attachment preview is out of the accent-filled
action buttons and gets the same neutral frame in every state. forms.css,
the cover options' defaults, the /thumbnail route and SVG handling are
unchanged.
Tests: the fallback executed as written (once, no loop, originals left
alone) and source guards for the cover helper, templates and every reset
state; two guards that pinned the old cover background and the preview's
accent fill are updated with the reason. A new Playwright spec checks a
real cover image, the tile's neutral colour and size at rest and on hover,
the open-card banner, the once-only fallback and the cover option off - it
passes in Chromium and WebKit, with the thumbnail, admin preview,
attachments and board-attachment specs (21 tests) still passing.
Thanks to xet7 !
|
||
|
|
23ed8d927f | Show Meteor instrumentation in Admin Panel Problems | ||
|
|
ba4637e558 | Show initials for missing impersonated users | ||
|
|
d43968d888 |
Clarify file scans and show location in address reports
Show when a partial file audit stopped before inspecting storage, allow larger bounded inventories, and avoid orphan findings from truncated metadata. Restore available locations in Offices and People, wrap long report cells, and theme report action buttons. |
||
|
|
828fc2d718 |
Revert Legacy HTML4 browser interface and parity changes
Remove the progressive HTML4/Legacy Omi middleware, cookieless sessions, page controllers, assets, parity refactors, design documents and associated tests. Restore the standard Meteor interface and operations from before the HTML4 work began. Preserve intervening translations, backup screenshots, session upgrades, cryptographic test identifiers, local image storage, document previews and lazy browser loading. Extract the GIF utilities still required by image features into imageGif. Validate the Node suites and add standard-interface and GIF regressions. Two existing failures remain in docsLinksResolve and ruleDetailsLocalization; browser regressions are registered but require a running server. Thanks to xet7 ! |
||
|
|
bd0e7eb4c2 |
Add accessible HTML4 translation settings
Share bounded admin translation services between the modern and HTML4 views, keep literal search selectors server-owned, block and report direct DDP writes, and provide complete semantic create, edit, search, paging and confirmed-delete controls. Verify both views on the same live route and keep their 25-row counters aligned. |
||
|
|
31f788b456 | Add accessible HTML4 Broken Cards Report | ||
|
|
5e3e5c16a1 | Add accessible HTML4 Cards Report | ||
|
|
eb0e347865 | Share bounded page movement | ||
|
|
828cb5e534 |
Restore sorting to board Table view
Make text, member, label and date headers toggle a shared client-side ascending or descending comparator. Keep empty date values last and use card title as a deterministic tie-breaker. Add comparator boundary coverage and a browser header-toggle regression. Thanks to rmb82 and xet7 ! Fixes #6633, |
||
|
|
2c034643b8 |
Fix Admin Problems nested pagination.
Keep specialized event-stream and Office pagination events from bubbling into the shared Problems report handler, and safely ignore missing report state during pane transitions. Add regression coverage for Next, Previous, and search controls.\n\nThanks to xet7 ! |
||
|
|
480074969b |
Show available initials in the Offices people column.
The server computed each person's initials, but person grouping discarded them and the shared table tried to find the user again in client cache. Users not published to that cache therefore rendered as empty grey circles. Carry initials through every table layer and let the existing avatar template render supplied initials before falling back to its reactive user lookup. Regression coverage checks the person-grouped response, shared table cell and direct initials fallback. Thanks to xet7 ! |
||
|
|
961ff6cb47 |
Admin Panel / Problems / Offices: where people log in from, grouped.
A new pane at /admin/problems/office, through the shared table page like every
other report here (docs/Features/Page/Table.md) - same layout, same search, same
paginator - so it needed no design of its own.
The columns are what an admin actually asks:
Location the country flag and the city: "London", not 100.100.100.100. An
admin recognises their own offices at a glance, and the flag says
WHICH London. Empty when nothing in front of WeKan resolved it.
Address the IPv4 or IPv6 it really is
People each account as its INITIALS, or its avatar where it has one, with
its own login count beside it - the same way the board sidebar and
a card show a member, and for the same reason: a column of avatars
fits where a column of usernames does not. Clicking one opens the
existing Edit user popup.
Logins how many, and the first-seen / last-seen window they fall in
Two additions to the shared table page rather than a second table: a cell that
holds SEVERAL people, and a leading flag kept apart from the cell's text so it
is not searched or sorted as text. Both are available to every other report now.
The pane is registered the way the others are - slug, title, menu entry,
reactive var, helper, reset and menu branch - and three guards caught the pieces
I would otherwise have missed: adminUrls wanted the URL in the design doc,
adminPanelDocsMatchMenu wanted the pane in the Problems README with its gap
count updated, and tablePage wanted the third paginator handler explained rather
than merely allowed. Ten strings in en.i18n.json, in key order, and appended to
238 language files as English placeholders for the fill rules to replace.
Thanks to xet7 !
|
||
|
|
fa289e4a4d |
Admin Panel Problems: the route and the template say what the menu says.
The pane is called Problems in the menu, its address is /admin/problems, and
docs/Features/Admin-Panel/Problems is where it is documented. Two things still
called it Reports, from before it was renamed:
* the route NAME was 'admin-reports', where its three siblings are 'setting',
'people' and 'attachments' - the bare page key. So the one route whose name
did not match its own address;
* the template, and its three files, were adminReports.
Both are 'problems' / adminProblems now, across 41 files.
What did NOT change is `legacyBase: '/admin-reports'`. That is an address people
have bookmarked and it still redirects here - the point of the rename is that
the code agrees with the menu, not that an old link should break. The CHANGELOG
entries describing the old addresses are left alone too: a released section is a
record of what shipped.
Thanks to xet7 !
|
||
|
|
daaf563910 |
Docs: implemented designs move to docs/Features, filed the way the menu is.
A design that describes what WeKan already DOES belongs with the feature it describes, not in the folder for things being proposed. Fifteen docs move: Design/Accessibility.md -> Features/Accessibility/Accessibility-Improvements.md Design/Original-Positions.md -> Features/Board/Original-Positions.md Design/Page/* -> Features/Page/* (thirteen pages that exist) Design/AdminPanelProblems.md -> Features/Admin-Panel/Problems/Design.md What stays in docs/Design is what the folder is for: the principles (Design-Principles, Monkey-Proof-Software), the comparisons, the roadmap (Multiverse), and the proposals not yet built (Multitenancy, Autoupdate). The Admin Panel Problems design is new and covers six changes - summaries, the per-actor tally, IPv4/IPv6 columns, an API report, a per-address login tally, and blocking with increasing delays. Three are shipped and three are planned; it is filed under the feature because the pane exists, with each planned item marked so it can become plain description as it lands. Every reference in the repository is rewritten - 152 files, including the CSS comments that point at the table-page design, which a first pass over .md and .js alone missed. Two suites asserted the old paths and now assert the new ones. A moved doc whose links nobody fixed is worse than one nobody moved. Thanks to xet7 ! |
||
|
|
efa534fddf |
Board roles: one capability table, three roles fixed, and a Roles Status pane that shows it.
What each role may do was spelled out THREE times - in the server allow helpers,
in the client's canModify* helpers, and in prose in the docs - and the three had
drifted apart. Every place they disagreed was a role that did not do what its name
says. models/lib/boardRoleCapabilities.js is that table now, in code, and
everything reads it: the allow rules, the UI helpers, the new Admin Panel pane and
the documentation. There is nowhere left for a fourth opinion to appear.
THE THREE GAPS, fixed:
* "Comment only, assigned" (isCommentAssignedOnly) had FULL WRITE ACCESS.
Nothing outside the card publications read that flag and it was not in the
write rule, so the role could create and edit cards, lists and checklists - it
was "Normal, assigned only" under another name. It is comment-only now, like
the role it is named after; the two differ only in what they see.
* "No comments" (isNoComments) could not write ANYTHING. The write rule excluded
it, so the role blocked editing as well as commenting - a second read-only
role under a name that says otherwise, and one the UI still offered the edit
buttons for. It blocks commenting only now, which is what the name and the
board schema both say it is for.
* The write rule did not exempt board admins. Every has*() helper on the board
ignores a flag on an admin; that one read the raw flags, so an admin who also
carried isNoComments silently lost write access. Not reachable from the Web
UI, which writes all eight flags at once, but reachable over the REST API,
which takes them individually. memberRoleOf() resolves isAdmin first.
The UI helpers were part of the same drift - canModifyCard() did not exclude
isNoComments while the server did, and canModifyBoard() excluded neither
isNoComments nor isWorker - so each disagreement was a button offered to somebody
whose write the server then refused. All three ask the same table now.
A FOURTH gap found while building the table, NOT fixed: a Worker cannot move a
card, which is the one thing the role is for. Moving a card is a card UPDATE, so
it goes through the write rule, which excludes Worker. The fix is not a table
edit - it means letting a role write SOME fields of a card and not others, and
"assign himself" means validating that a member change only ever adds the caller.
That is a field-level policy on the path every card update takes and wants
deciding on purpose. It is recorded under "Known gaps" with what it would take.
ROLES STATUS, at Admin Panel / People / Roles, below the Save button: a READ-ONLY
table of what each role may do - which cards it sees, and whether it may comment,
create and edit, or change the board's settings. It is the shared table page
(docs/Design/Page/Table.md), so it looks and behaves like every other Admin Panel
table, with no markup of its own; it has no rowTemplate, no actions and no
editable cell, because a role's capabilities are a property of the code and not a
setting. Every string is a translation key, the Yes/No of each cell included - the
values are booleans, and a hard-coded "Yes" would be English in every language.
The "Invite to board" column reads the pane's WORKING copy, so the table follows
the checkboxes above the Save button as they are ticked, before saving, which is
the point of putting it there.
docs/Design/Page/Table.md listed Roles among the panes that do NOT use the shared
design, "so the gap is visible rather than forgotten" - it has a table now, so it
moved to the list of pages that use it, and the exclusion covers the two panes
that are still nothing but a form.
Two guards were checking the shape of the old code rather than what it guaranteed,
and are updated with the reason in the test: listDragPermission read the flag
exclusions out of canModifyBoard's own body (it has none now, so it checks the
BEHAVIOUR - anonymous is falsy, and each excluded role still cannot drag a list),
and tablePage counted the pager handlers file-wide, which also forbade a handler
on a different template - a separate event map is not a duplicate key.
tests/boardRoles.test.cjs is the suite: the module itself including each fixed
gap, that the server rules and the UI helpers ARE the table and name no flag
themselves, that every cell of the documentation matches it, that the
assigned-only column matches the publication scope, that the remaining gap is
still real and the three fixed ones are recorded as fixed, and that the Roles
Status pane renders from the table, is read-only, is the shared template, follows
the working copy, and translates every string it shows.
Thanks to xet7 !
|
||
|
|
f6ee6388cc |
Fix the eight guards the last run surfaced, and document fixing tests while they run.
The node runner now reports every failure, so each fix reveals the next
assertion in the same suite. Twelve of the twenty are green; these eight failed
on a LATER assertion than before, and one is new.
* themeColorPicker: the category titles are `text-align: start` now, not
`left` - a physical side is what tests/rtl.test.js fails on. The guard asks
for `start` and refuses a physical side.
* adminCheckboxStyle: Attachments left the "panes that use a native checkbox"
list, because that is exactly what #6465 was. It now asserts the REMOVAL,
and the Backup row is three material checkboxes in one row.
* boardsVisibilitySettings: the site-theme picker is a fifth group.
* changelogFormat: the open/close counts are taken on the MARKUP - an entry
that explains the format writes `<details>` in backticks, closed by nothing.
* leftMenu: the heading branch is read without its jade comments; the comment
says a heading has "nothing ... to read a data-id from", and the guard was
failing on the sentence that explains the rule.
* narrowWindowLayout: the drag-handle toggle has TWO rules in the phone block,
so the declarations are looked for across both instead of in the first.
* securityLog: the Problems menu is DATA now (PROBLEMS_MENU + the shared
+leftMenu), so the entry ids are asserted where they live.
* tablePage: "the global-search machinery is gone" is checked on the code with
comments stripped - the comment above the report's config names the
machinery it no longer uses.
Three of these eight were guards reading a COMMENT as if it were code or markup.
That is now a known shape: strip comments before asserting about source.
CLAUDE.md gains the workflow this came from: check the newest logs and fix WHILE
the run is still going - the node suites are the fastest signal (~15s for 260) -
and decide per failure whether the code or the guard is the wrong side, saying
in the test why when it is the guard.
Thanks to xet7 !
|
||
|
|
b46eecf58b |
Fix the 20 node suites the && chain had been hiding.
The new runner ran all 260 suites for the first time: 20 failed. Four were real
defects in the app, the rest were guards pinning a spelling or a design that had
since changed - each of them written when it was true, and none of them run
since, because npm stopped the chain at the first failure.
The app fixes:
* models/lib/themeAccents.js: accentOf('constructor') returned Object's
constructor - a FUNCTION - because a plain lookup answers from
Object.prototype. A board colour named after any prototype member would have
written a function into a stylesheet. Only the map's own keys are themes now.
* RTL: the dependency overlay and its connect handle each set a physical
left/right AFTER the logical property, so the physical one won and both were
pinned to the LTR side in an Arabic or Hebrew layout. The skip link, the
avatar's account badge, the stats value column and the theme-category label
were physical too. All logical now (inset-inline-*, text-align: start/end).
The guards, each corrected to what the code actually does now, with the reason:
* addBoardTileHeight, publicationArgumentGuard: a fixed-size slice
(jade + 3000, source + 1400) that a grown comment pushed the subject out of.
Both now take the whole block they are about.
* adminCheckboxStyle: the Grey Icons feature is gone; asserts its REMOVAL.
* boardsVisibilitySettings: the separator count was pinned at 3; the site-theme
picker group made it 4. Asserts the shape - one Save per section, none for
the picker that applies immediately.
* changelogFormat: "# Upcoming WeKan ® release" is a legitimate heading.
* dbConformanceWiring: the log directory honours WEKAN_LOGDIR now.
* domainTablePage: the default page is the app-wide 10, not 25.
* ferretdbOplogGating: the exec runs under the CPU launcher.
* leftMenu: peopleMenu takes the user (multitenancy option D).
* loginEmailPanesMoved: the board-member restriction is two checkboxes in
Organizations and Teams now; asserted there.
* mobileAllBoardsFit: the bell and the avatar are two rules with variants.
* narrowWindowLayout: the hamburger is the last button in the flow, not pinned.
* rulesApiTriggerNormalize: #6491 made a missing matching field mean "any
value", so the #2674 "can never match" case now matches - and removeMember
iterates assignees, not members.
* securityLog: the new-problems selector moved to models/lib/eventLogProblems.
* tablePage: the Cards report renders the page the SERVER named.
* tenantWiring: the site colour is read in two places; the autorun is the one.
* themeAccents: see above - the guard was right, the code was not.
* translationPane: the "no hand-written table" regex matched the +tablePage
include it also requires.
* uiDensity: admin table cells wrap in one td+th rule now.
* rtl: the dir attribute comes from a helper, `!important` is not part of a
value, and the scanner read CSS COMMENTS as declarations - the comment
explaining why `left: 50%` needs no RTL variant was reported as a violation.
Thanks to xet7 !
|
||
|
|
c1add5bc5e |
Paginate the admin lists honestly: one page of ten, index-backed.
Admin Panel / People showed the admin on every one of its 578 pages, and Admin Panel / Problems / Broken cards was one endless page under a pager that said "1 / 1". Same bug in two shapes: the pane subscribes to a publication that sends exactly one page, then reads the page back out of minimongo - which holds far more than the page. The logged-in user's own record is always there (accounts publishes it), and so is every card of every board the admin has opened. A plain find(query) cannot tell those apart from the page. So the server names the page. getPeoplePageIds returns the ids of the People page with the publication's own selector, sort and window; the Broken cards, Cards and Boards report publications send the ids of the page they just sent alongside it. Both panes render that list, in that order, and nothing else. Every paginated page in WeKan now loads ten rows at a time, from one constant - TABLE_PAGE_ROWS_PER_PAGE - including the pages that draw a pager of their own: the reports and event streams, the four People panes, Translation, the search pages and the archive. docs/Design/Page/Table.md records the rule and its two deliberate exceptions. And the counting behind those pagers is index-backed. Every count already asks the database for a count rather than fetching the rows, but several counted and paged on unindexed fields: People sorts users newest-first, so on an instance with 14000 users each page of ten sorted all 14000 first. Broken cards asks an $or over boardId/swimlaneId/listId/type, which uses no index at all unless every branch has one. The missing indexes are created at startup by the idempotent ensureIndex, so an upgrade adds them by itself. Thanks to xet7 ! |
||
|
|
fc0fe31779 |
Admin Panel / Problems: Broken cards is a report, and the menu says which group is which.
Broken cards was the one entry in this menu with a different set of controls: no
search box, no total, no "page X / N", just a prev/next of its own - because it
ran on the global-search machinery (CardSearchPaged, a session document and the
nextPage/previousPage publications) instead of the shared table page. It is a
column spec in REPORT_TABLES now, like Files, Rules, Boards and Cards, driven by
the same loadReport(): a new admin-only `brokenCardsReport` publication takes a
search term plus limit/skip and publishes ONE page manually (a returned
sorted+limited cursor hangs on FerretDB's OpLog, as with the other reports), and
`getBrokenCardsReportCount` gives the total behind the counter.
What "broken" means - no board, swimlane or list, or a type that is not a card
type - is now one selector shared by the report and by the standalone
/broken-cards page, which still runs on the global search and keeps its own
publication unchanged.
The menu is two named groups. Summary, then a rule and a "Settings" title over the
two panes that came from Admin Panel / Features, then a rule and a "Reports" title
over the reports. A title is a new kind of menu item - `{ heading: true, labelKey }`
- with no id, no icon and no handler class, so there is nothing to click, nothing
for the page's click handler to read a data-id from, and it can never be the active
row (or a group name could end up as a pane title). Both use an i18n key the app
already has, so no language has to translate anything new.
Performance moves down to sit with the Speed, Tests and CPU usage streams it is
about, below Impersonation Report - it was three groups away from them, up with the
other two Features panes.
While there: the separator between groups is styled with the menu itself. The rule
for it lived in adminReports.css, twice, targeting a class the shared menu does not
render - so it had never applied to anything.
Thanks to xet7 !
|
||
|
|
d232194070 |
Admin Panel: the tables fit, every pane has a title, and Version opens first.
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 !
|
||
|
|
73cd930a44 |
Admin Panel: table pages fit their panel, and Translation lists its rows again.
Two reports, one of them the same bug in a third place. Domains - and with it every other shared table page - needed scrolling to the right to see its last columns. settingBody.css gives EVERY table in the admin body a 1200px floor, `width: max-content` and nowrap cells, written years ago to force a horizontal scrollbar. Applied to `.table-page-table` that overrode exactly what makes the shared page fit: width:100%, table-layout:fixed and wrapping cells (docs/Design/Page/Table.md). The three rules now exclude `.table-page-table`; the genuinely wide admin tables - GridFS statistics, Version, Translation - keep them. The panel's `overflow-x: scroll` becomes `auto` in the same breath, so a page whose content fits no longer shows a scrollbar with nothing to scroll to. Admin Panel / Settings / Translation showed no rows and no way to add one. `translationList` is a helper of Template.translationSettings, but `each translation in translationList` is written inside translationGeneral - a different template. Blaze resolves a name against the current template's helpers, the global helpers and the data context, never an enclosing template, so the list came out undefined and the tbody was empty. The parent hands the list down now. This is the third instance of that one mistake today: Organizations, Teams and People had it too. Its Search button was BLACK. forms.css styles every bare <button> from `var(--theme-accent, #000)`, and with no per-user theme chosen that fallback is literally black. It takes the same colours as the other admin buttons now - the accent when one is set, the WeKan button blue when it is not. Every state is spelled out (:hover, :focus, :active, :active:hover) because forms.css sets each of those from the same variable with its own black-ish fallback; overriding only the resting state leaves a button that turns black the moment you touch it. tests/uiDensity.test.cjs asserted against the old unscoped td/th selectors and now asserts the scoped ones, with a note about which tables they are for. Tests: 1352 passing. Thanks to xet7 ! |
||
|
|
b775ee1e1b |
Admin Panel / People: the tables are back, and the selected menu entry stands out.
Organizations, Teams and People drew their search box and their pager but NO TABLE. Their wrappers said `+tablePage(orgTablePageData)` while that helper was registered on Template.people - the PARENT template. Blaze resolves a name against the current template's helpers, the global helpers and the data context; it never searches an enclosing template. So the context came out undefined, and a table page with no rowCount draws its chrome and stops. Nothing threw and every test passed. Domains is the control that proves it: its helper sits on Template.domainGeneral, the template that uses it, and Domains kept working the whole time. The parent builds the context now - where the helper actually lives - and hands it down, so each wrapper renders `+tablePage(this)`. The named arguments the wrappers used to take (orgList, orgCurrentPage, hasOrgPrevPage, ...) went unused once these panes moved to the shared page, so they go too. A new test walks every `+tablePage(name)` in that file, works out which template it is written in, and requires `name` to be a helper OF THAT TEMPLATE unless it is `this`. Verified it flags `orgGeneral -> orgTablePageData` when the bug is put back. Also: the selected left-menu entry is darker and bold, so the menu says at a glance which page is showing on the right. Its colour fell back to `inherit`, which made it exactly the same grey as every unselected entry - the white background and soft shadow alone were easy to miss. A per-user theme accent still wins; only the fallback changed, from `inherit` to a grey darker than the panel's. The icon takes the same colour as its label. Tests: 1347 passing. Thanks to xet7 ! |
||
|
|
357283cf68 |
Admin Panel: no page-title bar on any page - just the left menu and the pane.
Every Admin Panel page except Problems drew a title bar under the top bar, repeating the name of the pane you were already looking at: "Registration" above Settings, "Info" above Version, and so on. The top bar already says which section you are in and the left menu highlights the open pane, so the third line only cost vertical space. Problems has never had one; the rest match it now. Settings, Version, Features and Attachments carried nothing but a title, so their bars are simply gone. People's bar was not only a title: the Organizations and Teams panes searched from a box and button inside it, and it showed their row counts. The searches move into the shared table page's controls row - which is where People's own pane already searched from - and the counts were already shown there as the table's total, so they needed no new home. One keydown handler now dispatches on the open pane, the way the pager and the filters already do, and each pane keeps its own search term so switching panes does not carry a search across. What the bars left behind goes with them: the `.ext-box` rules in peopleBody.css and translationBody.css, `.content-title` in settingBody.css, and the three count helpers that fed the bar - all dead once the markup went, and all verified unreferenced first. CSS was removed rule-by-rule with a brace-balance check before and after, because line-filtering this same file orphaned five rule bodies once already. Three existing tests asserted things that were true only while the bars existed - the themed search button, the search handler's scoping, the PWA pane header - and now assert the same properties in their new homes. Tests: 1346 passing. Thanks to xet7 ! |
||
|
|
ccc95bffba |
Admin Panel / People: search, filter and actions move to the shared controls row.
The last loose end of the People conversion. Its search box, its show-filter
dropdown, its "Unlock all users" and "Add / Remove Teams" buttons and its user
count lived in the PAGE HEADER, a different template from the table they act on.
They are the shared controls row now - the same slots this design gained FROM
People a few commits ago, finally used by it.
Its separate Search BUTTON is gone. Every table page searches on Enter, and a
second way to search is exactly the divergence this design removes.
Three things had to change with them, not just move:
- The search term is STATE (peopleSearchTerm) instead of being read back out of
$('#searchInput') - that id lived in the other template and no longer exists, so
filterPeople() would have searched for undefined.
- "Unlock all users" was a handler BODY. It is an instance method now, called by
the shared action handler via data-action, because the button is no longer
identified by its own id.
- The filter reset on render poked $('#userFilterSelect').val('all'). The shared
row renders the select from userFilterType, so it sets the state instead; the
old code would have silently done nothing.
All three handlers are scoped to the open pane, like the pager: every People pane
renders inside one template and they all carry the same shared classes.
Tests: none of the five removed ids survives in the header, the filter and actions
are declared to the shared row, the search term is state, the reset sets state,
and each of the three handlers is scoped to people-setting.
Thanks to xet7 !
|
||
|
|
3f44e622ba |
Table.md: People's three remaining panes are not tables, and are recorded as such.
Locked users is a form of numeric lockout settings with a Save button, Roles is a checkbox list, and Shared templates is a checkbox list of scopes. None has a paginated set of rows, so this design does not apply to them - forcing it would only wrap a form in a table. They are listed with that reason so the next person does not read the code to find out, or convert them by mistake. That completes People: all FOUR of its table panes - Domains, Organizations, Teams and People - render through the shared table page, and its three non-table panes are documented as out of scope. The old entry asking "what converting it would take" is answered and replaced. One loose end stays recorded, as wiring rather than design: People's search box, filter dropdown and two action buttons still live in the page header rather than the shared controls row. The slots for all three exist - they were added to this design FROM People - and its separate Search button should go when they move, since every table page searches on Enter. Tests: the three panes are listed with "not tables" as the reason, and none of them renders a table page in the code - so the doc cannot drift from what is there, in either direction. Thanks to xet7 ! |
||
|
|
6ff98891c8 |
Admin Panel / People / People: render through the shared table page.
Fourth and last of People's table panes. Interactive rows again (rowTemplate) and two template headers - the new-user row and the select-all checkbox. Its .people-pagination rules are gone from both stylesheets, so NO People pane keeps a pager of its own any more; all four use the shared, themed one. The page of users is now one query. peopleDocs() is shared by the table context and the old peopleList helper, instead of the same find() being written twice, and it still must not re-slice: the 'people' publication already applies limit/skip sorted createdAt:-1, and re-slicing it is what once left page 2 showing a single stray doc - the admin's own user record, always in minimongo - with later pages empty. A test pins both. The Add/Remove Teams panel stays outside the table page: it is a panel this pane opens, not part of the table. All four table panes now share ONE scoped pager pair, switching on the open pane - the only shape that works here, since every pane renders inside the same template and duplicate keys in one event map would overwrite each other. Remaining: Locked users, Roles and Shared templates. The last two still do not look like tables at all - Roles is a checkbox list with a Save button - so they may belong in the "does not use this design" list rather than converted. Not yet moved: People's search box, its filter dropdown and its two action buttons still live in the page header rather than the shared controls row. The slots for them exist; wiring them across is the remaining step for this pane. Thanks to xet7 ! |
||
|
|
6908821d17 |
Admin Panel / People / Teams: render through the shared table page.
Same shape as Organizations, so the same two slots: a rowTemplate for its interactive rows and three headerTemplate columns for the select-all pairs. 1857 characters of its own table markup gone, plus its .team-pagination rules from both stylesheets. Its three feature headers share ONE template parameterised by feature, as Organizations' do. Teams gains a working PREV button. It had one in its markup and no handler behind it - paging backwards was silently dead - and folding both panes into a single scoped handler pair fixed that on the way past. That folding was forced, not chosen: every People pane renders inside the same template and the shared page gives them all the same control classes, so a second handler for the same selector would be a duplicate key in one event map and simply overwrite the first. One pair now switches on the open pane. Tests: Teams renders the shared page and keeps no table markup, uses both slots, pages backwards, and there is exactly ONE prev handler. The uiDensity guard that pins these headers as compact icon links was updated for the team half the same way as the org half - it matches the parameterised markup and separately checks all three features still have a header. I ran the full suite BEFORE committing this time. The previous commit went in red because I chained the run and the commit in one command; that guard's team half was the failure it hid. Four panes remain: People, Locked users, Roles and Shared templates. Thanks to xet7 ! |
||
|
|
13f40bf3ab |
Table page: row and header slots (option A), and Organizations converted.
Organizations could not be expressed as a column spec: its rows carry inline checkboxes and edit links, and three of its headers carry a select-all pair. The design gains two slots rather than those panes staying outside it: - rowTemplate + docs - the page supplies a template and one data context per row, and owns its <tr>. It is then responsible for matching the column count: the guarantee that a row can never be shorter than the header holds for the CELLS form only, and the doc says so. - headerTemplate + headerData on a column - the <th> still belongs to the shared template; only its contents come from the page. Everything else stays shared either way: layout, paging, search, the themed pager, the total. The doc says to prefer the column spec and reach for these only when a pane is genuinely interactive. Organizations now renders through the shared page - 1826 characters of its own table markup gone, plus its .org-pagination rules from both stylesheets, since it uses the shared pager. Its three feature headers share ONE new template parameterised by feature, instead of three copies of the select-all pair. One thing the conversion forced: all of People's panes render inside the SAME template, so a handler bound to a shared control class fires for every converted pane at once. The org pager is scoped to the open pane via activeMenuId - Domains was unaffected because its handlers live on its own child template. Tests: the two slots exist and the plain column path is unchanged; Organizations renders the shared page, keeps no table markup, uses both slots, and scopes its pager. Two doc/test pairs updated to say "Domains and Organizations". Five panes remain: Teams, People, Locked users, Roles, Shared templates. Thanks to xet7 ! |
||
|
|
4eab5ffe9f |
Admin Panel / People / Domains: render through the shared table page.
First of People's seven panes converted to docs/Design/Page/Table.md. Its own controls row, pagination markup and table - 891 characters of jade - became one +tablePage(tablePageData) plus a two-column spec, and 56 lines of pane-specific CSS are gone: the layout comes from tablePage.css and the pager colours from paginationControls.css, like every other pager. Its separate Search BUTTON is dropped, as the design says: every table page searches on Enter, and a second way to search is exactly the divergence this design removes. The handlers keep their behaviour but move to the shared control classes, so the pane needs no markup, no CSS and no pager rules of its own - .domain-pagination and .domain-page-info had no users left and are removed from the shared pager stylesheet. The pane also gains the result total for free: it is one of the controls-row features adopted from People itself a few commits ago. Docs: the "Pages that do not use this design" entry now reads "People - six of its seven panes" and records that Domains is converted; Domains is listed among the pages that DO use the design. Tests: the entry must say Domains is converted, and that pane must render the shared template and keep no markup of its own - so the doc cannot claim a conversion that did not happen, nor stay silent about one that did. A test that listed Domains among the panes with their own themed pager was updated; it caught the now-dead CSS, which is what it was for. Six panes remain: Organizations, Teams, People, Locked users, Roles and Shared templates. Thanks to xet7 ! |
||
|
|
7e2f33387e |
Table page: adopt People's filter, actions and total into the shared controls row.
The three features that kept Admin Panel / People off this design are now part of
it, and they are ON by default - there is no enabling flag. A page that supplies a
filter or an action gets it rendered, and the total is shown whenever the page
knows one:
filters: buildFilters([{ id, labelKey, options: [{ value, labelKey }] }], current)
actions: buildActions([{ id, labelKey, icon, cls }])
total: <number> (+ optional totalLabelKey)
They are general - a Boards or Cards report wants a filter and a total as much as
People does - so they belong in the one template rather than in a per-page copy.
The controls row now reads: search, filters, actions, total, pagination.
A page identifies which control was used by its data attribute (data-filter,
data-action), so this adds no new handler pattern: the same one-handler-per-page
rule as the search and the pager.
The option matching `current` is selected as STRINGS, so a numeric filter value
still selects. The total sits with the controls, not in the table, because it
counts the whole result set rather than the page, and inherits its colour so it
stays readable on a dark theme.
Tests: the two new helpers (including junk input - a filter with no options
renders an empty select rather than crashing), that the four parts appear in
reading order between the search field and the pagination, that there is NO
opt-in flag, and that the doc says so.
One earlier guard needed fixing rather than the code: "the table page stylesheet
does not restate button colours" sliced the CSS by POSITION, so the new rules
landed inside the slice and tripped it. It now matches by selector, which is what
it always meant.
NOT done: People itself still renders its own markup. Its seven panes
(Organizations, Teams, People, Domains, Locked users, Roles, Shared templates)
are seven tables with their own columns and handlers, and converting them is a
larger piece of work than adding these features was. The blocker recorded in
Table.md is now gone, so that conversion is unblocked - the "Pages that do not
use this design" entry stays until it is actually done.
Thanks to xet7 !
|
||
|
|
18a286a740 |
Table.md: record which pages do NOT use this design, and why.
A page with a paginated table that is not built from this design is a gap. Left
unwritten, the next person re-derives the answer by reading the code - or worse,
copies a few of this design's classes into it and leaves it half-converted, which
is exactly how the ten report pages drifted apart before.
People (Admin Panel / People) is the one such page. It predates this design and
has its own controls and table markup, one set per pane - Organizations, Teams,
People, Domains, Locked users, Roles, Shared templates - so it is several tables
on one page rather than one. It also carries four things this template has no
slot for: a filter dropdown (all / locked / active / inactive / admin), action
buttons ("Unlock all users", "Add / Remove Teams"), a result count beside the
controls, and a separate Search button where a table page searches on Enter.
The entry also records what People ALREADY shares, so the remaining work is not
overstated: it pages server-side with limit/skip exactly as this design requires,
and its prev/next buttons are themed by the shared pager stylesheet through the
.people-pagination class, so it already follows the per-user theme and the WeKan
default. What is missing is on this side - optional slots in the controls row for
a filter, extra actions and a total, rendered only when a page supplies them.
Those are general enough for a Boards or Cards report to use, so they belong in
the shared template rather than in a per-page copy.
Tests: the section must exist, must come before the pages that DO use the design,
must list People with a reason that actually explains, and - so the entry cannot
quietly go stale - People must still have none of this design's markup. If it
ever gains it, the test fails and the page moves to the other section.
Thanks to xet7 !
|
||
|
|
f46aab011b |
Admin Panel / Problems: render its side menu from the shared left menu.
First page converted to docs/Design/Page/Left-Menu.md. Its thirteen entries were
six lines of markup each plus, for twelve of them, an identical click handler.
They are now a data list:
{ id, icon, labelKey } and { separator: true }
built by buildMenuItems() and rendered by the one leftMenu template. 1895
characters of markup in adminReports.jade became a single +leftMenu(menuItems).
Same styling, deliberately: the shared template reproduces all three icon shapes
the Admin Panel pages already used, so a conversion changes no pixel - an empty
span.emoji-icon before the icon (Settings, Features), the icon inside a coloured
span.emoji-icon (People / Locked users), or a bare i.fa (Problems, People,
Translation, Info). Problems uses the bare shape it had.
The twelve 'click a.js-report-<name>' handlers, all of which called switchMenu,
are one 'click .js-left-menu-item'. switchMenu no longer toggles the active class
by hand either: the active row is rendered from activeReport, so the manual
removeClass/addClass would have fought the next re-render. Its "already open"
guard now compares ids instead of reading a DOM class, and it resolves data-id
from the anchor rather than event.target, which may be the icon inside it.
Three suites looked for the menu ids in adminReports.jade; the menu is DATA now,
so they read the .js. Same intent, right file.
Tests: tests/leftMenu.test.cjs gains the conversion checks - the page renders the
shared menu, keeps no .side-menu markup of its own, builds its entries through
the shared helper, has exactly one menu handler and no manual active-class
toggling, and the three icon shapes are reproduced.
Still to convert: Settings, People, Features, Attachments, Translation and Info.
Settings, Features and the two single-entry pages are the same mechanical swap.
People and Attachments additionally need an active-id reactive var, because they
track the open pane by toggling a DOM class rather than in state.
Thanks to xet7 !
|
||
|
|
33a0cf6160 |
Design docs: move Table-Page.md under Design/Page/, and add Left-Menu.md.
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 ! |
||
|
|
f14dc6a784 |
Tests: one suite for the table page, asserting against the files the design lists.
tests/adminReportsPagination.test.cjs asserted against the same pages as tests/tablePage.test.cjs from a second file - the same split this change removed from the app code, and written when each report still had its own markup, controls row and stylesheet. It is merged into tests/tablePage.test.cjs, which is now the one suite for the design: the pure helpers, the template, the layout, the themed pager, the server-side index-backed paging, and the doc. Its last three checks cover the OTHER pagers (People/Org/Team/Domain, the board Table view, Translation). Those are not table pages, but they share the themed pager stylesheet the design lists, so a change there reaches them too - they are kept, next to what they depend on. Deduplicated on the way in: the merged "pagination controls use var(--theme-accent)" was a weaker copy of the check above it, which already pins all five button states; its two unique assertions were folded in and the copy dropped. 10 + 22 checks -> 31, no coverage lost. Two guards were pointed at the wrong file after the refactor: - fileNameDisplay's "the invisible-character filter is fully removed" read only adminReports.jade, which no longer holds ANY report markup - so it passed no matter what. It now reads the shared template too. - Table-Page.md's related-files table still listed the deleted test. The suite's own "every path in this table exists" check caught it; the row now describes the combined suite. Thanks to xet7 ! |
||
|
|
cb07a54f56 |
Table pages: take the pager colours from the one themed pager stylesheet.
Checking how the table page's buttons are themed turned up two problems.
First, a bug I introduced with the shared table page: tablePage.css restated the
pagination button colours itself, and only for the base state, :hover and
.disabled. WeKan already has ONE stylesheet for every prev/next pager in the app,
client/components/main/paginationControls.css, and it spells out :hover, :focus,
:active AND :active:hover deliberately - because the global button rules in
forms.css set those same states from --theme-accent with a BLACK / dark-grey
fallback, at equal or higher specificity:
button { background: var(--theme-accent, #000) }
button:focus { background: var(--theme-accent, #222) }
button:active { background: var(--theme-accent, #111) }
button:active:hover { background: #e6e6e6 }
A partial copy looks right until the button is CLICKED and then loses: pressing
"next" on a table page would have left a black button sitting there until it lost
focus - exactly the regression that stylesheet was written to prevent.
.table-page-pagination / .table-page-page-info are now listed in it, and
tablePage.css carries layout only.
Second, trimming adminReports.css in the previous commit removed the
.admin-report-controls layout, which Archived boards also used - so its search +
pagination row lost its flex layout. Archived boards now uses the shared controls
classes (its js- handlers are unchanged), which restores the layout and gives it
the same themed pager. .admin-report-pagination / .admin-event-pagination had no
users left afterwards and are gone from the pager stylesheet.
So a table page never invents a colour: the buttons and the "3 / 42" counter
follow the per-user theme (Member Settings -> Change color sets --theme-accent on
:root) and fall back to the WeKan default blue #01628c when no custom colour is
chosen, and the counter uses color: inherit so it stays readable on a dark theme.
Docs: Table-Page.md gains a Theme section saying exactly that, with the forms.css
specificity trap written down so the colours are not copied back into a page
stylesheet, and paginationControls.css + forms.css are added to the related-files
table.
Tests: the shared pager must cover the table page class in all five states with
the accent + WeKan-blue fallback; tablePage.css must not set background, color or
border on the pager; and the design doc must document the theming.
Thanks to xet7 !
|
||
|
|
e8f5b9262d |
Table-Page.md: list the related files at the top, with type and description.
A File Path / File Type / Description table of all sixteen files that make a table page work: the shared template, stylesheet and pure helpers; the Admin Panel wiring; the client import list (a file that is never imported is simply not loaded, which is its own class of bug); the six report publications and their count methods; the event-log model behind the Security / Speed / Tests / CPU streams; and the two test suites. The old two-column "Where the code is" section at the bottom listed a subset of the same files and is removed rather than kept in parallel - a reference table that exists twice is one that goes out of date once. Tests: tablePage.test.cjs checks the table has those three columns, that every path it lists exists on disk, that the shared implementation is among them, and that no file is listed twice. A renamed or moved file now fails the suite instead of leaving the page quietly pointing at nothing. Thanks to xet7 ! |
||
|
|
9791993d59 |
Table pages: one design, one implementation, and a layout that fits the window.
Files, Rules, Boards, Cards, Impersonation, Recovery and the four event streams
(Security, Speed, Tests, CPU usage) were ten copies of the same page: the same
title + search + prev/next markup, the same currentPage/totalPages helper pair,
and the same click/keydown handlers, retyped with a different js- prefix each
time. They had drifted apart, and any layout fix had to be made ten times.
They now render through ONE template and differ only in a column list:
{ label | labelKey, value(doc), align, nowrap, cls, userId(doc), data(doc) }
- client/components/settings/tablePage.jade - title, optional status row,
controls, table. The row ORDER is defined here once.
- client/components/settings/tablePage.css - the layout.
- models/lib/tablePage.js - pure pageInfo() / buildRows() / buildHeader() /
columnWidthPercent(), unit-tested without a browser or a database.
adminReports.jade 349 -> 112 lines, its CSS 134 -> 53, ten templates -> four,
twelve page/total helpers -> none, twenty-four control handlers -> four.
Layout fixes, now made once and reaching every page:
- The table is width:100% with table-layout:fixed, so every column gets the SAME
percentage of the width and the table can never grow wider than the panel. With
the default auto layout one long id or file name widened the table past the
panel and pushed its right-hand columns outside the browser window.
- Cells wrap: overflow-wrap:anywhere breaks even an unbroken id, URL or file name
inside its column. Datetime columns opt out with nowrap.
- .table-page has min-width:0 / max-width:100% so it can shrink inside the flex
.main-body instead of setting a min-content floor; only the table's own wrapper
may scroll sideways, never the page.
- At <= 800px the side menu goes full width on top and the table sits BELOW it.
This deliberately overrides the older "always side by side, even on narrow
windows" rule, which on a phone left the table a few dozen pixels wide with its
right-hand columns unreachable. Above that width the menu keeps its place and
the table sits beside it.
- Rows top to bottom: title, status (the live CPU figure on the CPU usage page),
controls, table.
Paging still loads only the current page - the publications apply limit/skip -
and loadReport now takes that window from the SAME pageInfo() call that renders
"page X / N", so what is fetched and what is displayed cannot drift apart.
Docs: the shared design moves out of the History design doc into
docs/Design/Table-Page.md, which lists every page that uses it (table name, menu
path, description) per group. History.md, CPU-usage.md and Recovery.md now link
to it and keep only what is specific to them.
Tests: tests/tablePage.test.cjs (18) covers the pure helpers - including a page
that no longer exists clamping to a real one, and a short row never shifting the
columns - plus the layout rules the doc promises and the "one implementation"
guarantee. Four existing tests that pinned the old per-report markup were updated
to the new mechanism, same intent.
Thanks to xet7 !
|