Commit Graph
36 Commits
Author SHA1 Message Date
Lauri Ojansivu 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 !
2026-10-16 23:45:35 +03:00
Lauri Ojansivu 5b04b4b47c Reorganize docs: platform pages under docs/Platforms, and update their links.
The autoupdate design pages move from docs/Design/Autoupdate to where their
platform lives: the per-OS pages to docs/Platforms/FOSS/OS/OS-future-alternatives,
Snap-Core and Snap-Ondra-Gantt to Container/Snap, UCS and Nextcloud to
Container/Docker, and Platforms.md to docs/Platforms. docs/Platforms/FOSS/Cloud
is split into Container/Docker (Helm, OpenShift, CloudFoundry) and
FOSS/CloudFlare; Friend and UCS move under Container/Docker; Leo moves to
Features/ImportExport/Leo.

Every link to a moved page is updated: relative links in the docs, including
the moved pages' own links to the rest of the tree, full docs/ paths in the
workflows, tests and comments, and the Upcoming CHANGELOG entry. Released and
archived CHANGELOG sections are records and keep their original links.
tests/docsLinksResolve.test.cjs passes.

Thanks to xet7 !
2026-10-11 19:53:18 +03:00
Lauri Ojansivu 1c200407a2 Show archived-card contributions in Pulse
Add a UTC annual archive grid with count shading, colored label tooltips,
year selection and keyboard/touch details. Scope counts and labels to the
board and each assigned-only viewer, and exclude restored or undated cards.

Verify calendar aggregation with unit tests and real MongoDB/DDP/Chromium
coverage for the UI, all assigned-only roles, invalid input and isolation.
Document current-archive semantics and the remaining issue-audit work.

Thanks to xet7 !

Fixes #5444,
2026-09-28 23:56:20 +03:00
Lauri Ojansivu 46d2039b8a Preflight complete Scrum recovery batches before resuming writes 2026-09-28 17:17:05 +03:00
Lauri Ojansivu bf75fafdd3 Fence Scrum restoration writes with captured placement and content 2026-09-28 17:13:49 +03:00
Lauri Ojansivu 62f5a48740 Confirm persisted Scrum restoration targets before completing recovery 2026-09-28 17:10:11 +03:00
Lauri Ojansivu a0f84ac115 Require expected revisions before acknowledging restored Scrum values 2026-09-28 17:06:08 +03:00
Lauri Ojansivu eb91a68a5a Bind Scrum recovery ownership to the exact persisted checkpoint plan 2026-09-28 17:02:33 +03:00
Lauri Ojansivu 2bbc13456f Refuse superseded Scrum redo checkpoints before replaying writes 2026-09-28 16:59:05 +03:00
Lauri Ojansivu 6465fd28e1 Stream History pages through bounded permission batches 2026-09-28 02:25:44 +03:00
Lauri Ojansivu 0da7d2d41e Preserve nested dates in History field snapshots 2026-09-28 02:21:36 +03:00
Lauri Ojansivu 0e7394cd85 Keep rule button menus consistent with trigger type changes
Clear stale manual-button metadata for automatic triggers and populate it for REST button rules. Verify actual menu visibility and History undo/redo for editor and REST changes.

Thanks to xet7 !
2026-09-27 20:27:41 +03:00
Lauri Ojansivu 21cb6e8c86 Isolate shared rule components when editing automation rules
Copy changed shared triggers and actions while preserving unshared IDs and REST patch semantics. History restores component references and cleans unreferenced private copies.

Thanks to xet7 !
2026-09-27 20:24:42 +03:00
Lauri Ojansivu 7472456ada Preserve shared trigger and action records when deleting rules
Reuse one cleanup path for editor, REST and History deletion. Restore shared components only when their recorded content is unchanged, without writing over another rule.

Thanks to xet7 !
2026-09-27 20:21:30 +03:00
Lauri Ojansivu e0bcf7bde3 Record compound Rules REST changes in reversible History
Use the authenticated API user and shared rule snapshot wrapper for creation, edits and deletion. Verify one entry per operation, no-op suppression, permission denial and undo/redo.

Thanks to xet7 !
2026-09-27 20:18:47 +03:00
Lauri Ojansivu 08a1646618 Restore list deletion batches through History undo and redo
History restored a list but left deletion markers on its cards. Replay the
existing soft-delete/restore modifiers across the same board/list and batch.
Keep independently deleted cards untouched and refuse lifecycle rows for
lists moved to another board. Preserve the deletion batch in lifecycle
content and record the actual lifecycle state in history snapshots.

The browser regression failed against the previous implementation. It now
passes undo, redo and undo again with persisted card checks. Separate
read-only rejection, pure negative cases, existing history tests and
flow/time-history browser regressions pass.

Thanks to rawwerks and xet7 !

Fixes #1023,
2026-09-27 00:10:25 +03:00
Lauri Ojansivu 6d99ad73c4 Preserve time history and record reversible move reasons
Keep card and checklist activity after deletion, retain card snapshots for
flow reports, and show recorded hour adjustments by their actual author in
Time and its PDF/Excel exports. Record whole positions centrally, including
optional move reasons and direct REST edits. Append undo/redo checkpoints
so blocker intervals and time corrections follow reversals through time.

Audit the open time-related requests against existing features. Exact inline
activity timestamps requested in #1673 already exist in dateDisplay and the
activities template; add a browser regression for that existing behavior.

Reuse established locale terminology for the new compact labels. Labels
outside English and Finnish are low-confidence glossary combinations for
human review; existing translations remain untouched.

Validation: 43 focused Node suites pass. Fifteen Chromium scenarios pass
across flow analytics, time history and existing REST move coverage, including
real chart and Time PDF/Excel exports, undo/redo, retention and access denial.

Thanks to ladistrupl, zombah and xet7 !

Fixes #1598,
Fixes #1673,
2026-09-26 23:00:58 +03:00
Lauri Ojansivu 0b411b5476 Add flow analytics charts and reversible dependency history
Reuse board dates, activities, estimates, dependencies and universal History for Aging WIP, Blocker Analysis, Monte Carlo forecasts, XmR and size versus cycle time. Keep Chart.js lazy loaded and share parameterized PDF/Excel exports. Record dependency edits in History with undo/redo and board-boundary validation.

Validation: 21 focused Node suites and 8 Chromium tests pass, including every chart download and dependency undo/redo. Report labels reuse native locale vocabulary and formula notation; compact explanatory wording outside English/Finnish has low confidence and welcomes review.

Thanks to sojournerc and xet7 !

Fixes #1476,
2026-09-26 22:40:39 +03:00
Lauri Ojansivu bbcd98d9d8 Add REST API for attachment soft delete and restore, Admin Panel Problems, OAuth login provider and passwordless settings, card field order and pausing a rule.
Every feature of the recent releases that had a UI but no endpoint, on the
same server-side code the UI uses:

- DELETE /api/boards/:boardId/attachments/:attachmentId soft-deletes,
  POST .../attachments/:attachmentId/restore restores, and
  GET /api/boards/:boardId/attachments/deleted lists what is restorable -
  all through the attachments.softDelete / attachments.restore methods the
  card and the card history use, run as the request's user. No hard delete.
- GET /api/admin/problems (the Problems status overview plus the new-problem
  count per stream), GET /api/admin/problems/:stream (one page, with
  limit/skip/search) and POST /api/admin/problems/:stream/acknowledge,
  through the admin-only eventLog* methods the Admin Panel pages call.
- GET /api/admin/oauth-providers, PUT /api/admin/oauth-providers/:providerKey
  and PUT /api/admin/passwordless, through saveOauthProviderSettings,
  savePasswordlessSettings and getOauthProviderConfigSources. A provider's
  secret is reported only as { source, hasValue }, never its value.
- GET/PUT /api/boards/:boardId/cardFieldOrder, normalised with the same
  applyCardFieldOrder() the card renders with.
- PUT /api/boards/:boardId/rules/:ruleId accepts `enabled` to pause and
  resume a rule, and GET reports it.

The OpenAPI generator is fixed on the way: server/models/boards.js has had a
bare `catch {` since v11.67, the esprima parser cannot read that, and a parse
failure was silently skipped - so public/api/wekan.yml has shipped WITHOUT
the whole Boards API since then. It now downlevels `catch {` and
`for await (`, warns when a file cannot be parsed, and no longer emits an
empty sub-schema for a primitive array-element marker such as
`wipLimitGroups.$.listIds.$`, which made the spec unparseable YAML.
public/api/wekan.yml and wekan.html are regenerated with the release
workflow's own commands: 156 operations, up from 122.

tests/restApiNewFeatureRoutes.test.cjs pins every new route to its method,
path, @operation block and authentication check, that the OAuth endpoints
never mention a secret outside the input whitelist, the generator's two
fixes, that the generated and the committed spec carry the Boards API and the
new operations, and - as the negative sweep - that no route in models/ or
server/models/ lacks an authentication check.

Thanks to xet7 !
2026-09-11 21:18:35 +03:00
Lauri Ojansivu 9a32261811 Design: attachments are soft-deleted, restored from card history, and hard-deleted only with the archived board.
History.md gains section 12 and closes the section 11 question about restoring
a removed attachment: delete on a card is a soft delete that keeps the file and
unsets the cover, the card, its count and the minicard badge hide it, the card
history shows who deleted it and restores it with the same preview and download
controls as the card but never cover or background, no per-attachment hard
delete exists anywhere, and the one hard delete is Admin Panel / Problems /
Delete enabled, board archived, board deleted from the archive.

Thanks to xet7 !
2026-09-11 21:17:32 +03:00
Lauri Ojansivu 902f142263 Document Gantt engines, WIP limit groups, custom field admin/order,
label milestones, checklist reset/bulk-edit, card field order and
Flowtime/Pomodoro.

Thanks to xet7 !
2026-09-10 21:34:32 +03:00
Lauri Ojansivu 1914720360 Document new board-view charts, Bigboard, Roadmap, Group by Assignee,
Multi Board Calendar, Notification Settings, Two-Factor Authentication
and the My Cards/Due Cards/My Attachments member pages.

Thanks to xet7 !
2026-09-10 21:29:43 +03:00
Lauri Ojansivu f6220a3332 Added list of charts that are upcoming to board views.
Thanks to xet7 !
2026-09-08 18:24:13 +03:00
Lauri Ojansivu 1218cd281f Add test-menu.sh and checked-in example inputs for docs/Features
test-menu.sh mirrors the docs/Features menu structure and runs the actual
WeKan code for each feature: a dedicated runner for Login (a real REST
username/password round trip) and ImportExport/PDF (create a board, export
it, check the PDF header), and a generic fallback that matches a feature
against this repo's own automated tests by filename. Every feature run
writes output.txt/result.txt/run.log under .tools/test-menu/<timestamp>/,
mirroring the docs/Features path, and never leaves an empty or missing
result.

The example INPUT for a feature is checked into the repository next to its
documentation instead: docs/Features/<path>/example-input.txt, hand-written
for Login and ImportExport/PDF and extracted from the feature's own .md
elsewhere. test-menu.sh only reads these; it never writes into docs/Features.

An earlier version of the matcher also grep'd test file CONTENTS for a
keyword once the filename search failed, which pulled in noise (a word like
"webhook" mentioned in passing in a dozen unrelated tests); it is
filename-only now.

Thanks to xet7.
2026-09-08 17:49:24 +03:00
Lauri Ojansivu 3980dd9fc3 Design verified recovery and low-load maintenance 2026-09-05 23:51:02 +03:00
Lauri Ojansivu 77dd5f2539 Say what opening History actually proved.
The previous commit verified the card scope. The rest has now been opened too,
so the document and the changelog say what was done rather than what was
likely: the card, list and swimlane menus each open the table with their own
scope reaching the template; search narrows it and reports no results for a
term nothing matches; a contributor's avatar filters to that person; and with
32 rows the footer reads 1 / 2, the second page holds the remaining seven in
sequence, and the next arrow disables itself there.

Nothing new was found. That is worth recording as plainly as the four faults
the first pass found, because "it shares a template with something that works"
is the reasoning those four faults survived.

Thanks to xet7 !
2026-09-05 00:20:05 +03:00
Lauri Ojansivu 731461eaea Update upcoming WeKan changelog
Records what opening History found, and corrects History.md, which still said
none of it had been exercised in a running WeKan. The card scope now has been:
what was verified, what the pass found, and - said plainly, because it is the
same reasoning that produced those four faults - which scopes remain untested.

Thanks to xet7 !
2026-09-05 00:16:35 +03:00
Lauri Ojansivu 1fe46c6044 Record every group, and give History one table for every scope
Phases 3, 5 and 6 of docs/Features/Reports/History/History.md, and the viewer of
phase 2.

RECORDING EVERYTHING, FROM ONE PLACE. §5 suggests "a thin, central choke point
... avoids sprinkling calls everywhere", and server/models/changeHistoryHooks.js
is that: an after.update hook per collection that diffs the changed fields, plus
insert/remove for the sub-entities. Cards, lists, swimlanes, checklists,
checklist items and comments are covered across every group §3 names.

The advantage over editing twenty setters is not brevity, it is COVERAGE: the
REST API, the CSV and Trello importers and the rules engine all write through
the collection and none of them call the client setters, so a per-setter rollout
would have recorded a description edited in the UI and silently missed the same
edit made over the API.

What a hook must not do is record too much, so models/lib/changeHistoryGroups.js
is a table rather than a rule: modifiedAt and dateLastActivity change on nearly
every write and would bury the changes a person actually made, and the four
fields of a move only mean anything together - reported separately, one drag
becomes four rows and undo puts back a quarter of it. Card.move and the list
soft delete therefore record themselves, as one change each. The description
setter records nothing now: the hook covers it, and recording in both places
would have needed two presses of Ctrl+Z to undo one edit.

ONE TABLE, EVERY SCOPE. §7a: "there is ONE implementation, parametrised by
scope". client/components/history/historyTable is that one - contributor pane,
search, pagination, row selection, Restore, RTL - and the card, list and
swimlane menus each open it with a different scope. Adding History to a menu is
a menu item and a two-line handler, exactly as the design promises.

tests/historyOneTemplate.test.cjs keeps it that way. Six copies of a table
drift: one gets RTL and the others do not, one gets the search fixed and the
others keep the bug. The test walks every .jade under client/ and fails if a
second History table is ever defined.

Two things the UI needed that were nearly wrong. The scope has to travel as
`dataContextIfCurrentDataIsUndefined`, because Popup.open's second argument is
OPTIONS - a bare object there is ignored and the popup opens on the menu's own
data context, showing the wrong history. And the popup needs a title key or it
renders with no header and no close button; it reuses the existing `history`
key rather than adding one.

FOUR NEW WORDS. Removed, Edited, Moved, Restored - the Action column is the one
a reader must understand. 'Added' the app already had, and every other label
reuses the word the card view already uses for that section, so a group is
labelled Description or Labels in the language the card beside it speaks. That
kept this to four keys in 197 locales instead of twenty-six. Low confidence on
the same long tail as before.

NOT VERIFIED LIVE. There is no Meteor runtime here, so none of this has been
opened in a browser. §10 asks for each phase to be verified live before the
next; that has not happened, both documents now say so, and the UI in
particular should be treated as unproven.

Thanks to xet7 !
2026-09-04 23:20:12 +03:00
Lauri Ojansivu 898643eea9 Build the universal change history, and put undo on top of it
Phase 1 of docs/Features/Reports/History/History.md §10, plus the write half of
phase 2. Ctrl+Z is no longer a position-only feature.

THE STORE. models/changeHistory.js is the append-only collection of §4: one row
per change, carrying every container id it sits inside (boardId, swimlaneId,
listId, cardId) so a container scope is a plain equality rather than a join the
database cannot do - which is what makes a swimlane's history include its lists'
and cards' rows.

It imports NO other model, deliberately. Its predecessor imports Cards, Lists,
Swimlanes, Checklists and ChecklistItems so its undo() can write to them, and
that is precisely why models/cards.js could not import it, guarded on an assumed
global instead, and recorded nothing for years. A collection that entities must
import cannot import entities. Applying a change back to a document therefore
lives in server/models/changeHistory.js, which nothing imports and which may
import anything.

THE RULES ARE PURE. models/lib/changeHistoryQuery.js holds the scope-to-selector
translation, the search and the selection normalisation, with no Meteor and no
database, because that is where this feature is either right or quietly wrong:
a scope that resolves to the wrong id column shows one board's history under
another board's menu, and a selection that does not normalise its input restores
the wrong rows. Both are silent. 17 tests, including that an unknown or
half-given scope is REFUSED rather than widened into a selector that matches
everything.

UNDO IS NOW THE WHOLE HISTORY. changeHistory.undoLast/redoLast replace the
position-only methods; the keyboard bindings and the tested pickUndo/pickRedo
rule are unchanged. One rule covers every change type instead of a case per
action: undo applies previousContent, redo applies newContent. Restores go
through the same setters an ordinary edit uses, so validation, hooks and
Activities still run, and each restore is itself recorded twice - once
attributed to whoever made the change being restored, once to whoever pressed
Restore (§8.3).

RECORDED SO FAR: card description edits (§10.2's first content group - the
previous text is read BEFORE the write, since after it the old value is gone),
card moves, list moves, and list soft-delete/restore, which is what makes
"undo a deleted list" work.

changeHistory is in the snap's MERGE_COLLECTIONS, as §9a.4 requires the moment
the collection exists: a history row written on the copy that is not served is
work that would otherwise be stranded in a database nobody opens.

NOT BUILT: every UI in §7, §7a and §8 - the popup, the table, the contributor
avatars, the Restore button, the "History" menu items - and recording for the
remaining groups of §3. The methods those screens need exist and are tested;
nothing calls them yet. Both docs now say which half is which, because the last
time this document claimed more than the code did, the gap survived for months.

Thanks to xet7 !
2026-09-04 22:56:52 +03:00
Lauri Ojansivu 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 !
2026-08-16 15:15:01 +03:00
Lauri Ojansivu bb76e7bf10 Snap: remove the database setting. There is one answer, and it is FerretDB.
`snap set wekan database=mongodb|ferretdb` is gone, and so is
`snap run wekan.database`. WeKan runs on FerretDB on every platform; MongoDB is
in the amd64/arm64 snaps to be READ while a migration is owed.

A setting could say something the data did not support, and every way it could
was a report: set to mongodb it kept a site on the database the snap migrates
away from, for good, because nothing ever set it back - including instances a
failed migration or a wrong staleness guess had put there; set to ferretdb with
no FerretDB present it would have served an empty site, so the guard against
that had to exist anyway; and each script carried its own copy of "which
database is this, then".

snap-src/bin/database-role replaces it. One helper, asked by wekan-control,
mongodb-control, ferretdb-control, migration-pending, attachment-repair and the
configure hook, answering from the data: a FerretDB with something in it and a
migration that has finished means ferretdb, MongoDB data with the migration
still owed means mongodb. An interrupted migration is told from a finished one
by the importer's checkpoint, so a partial FerretDB resumes and a finished one
whose marker went missing is not migrated over again (#6585). An empty FerretDB
beside a MongoDB full of boards is never served.

The explanatory page is no longer a dead end: when this snap cannot read the
MongoDB files but a FerretDB copy is there, the copy is served - older beats
unreadable - and the page says the snap keeps trying rather than giving a
command to type. A snap that still has the old setting is told once that it is
ignored, and it is unset.

docs/Platforms/FOSS/Container/Snap/Migration-to-FerretDB.md is the design in one
page: all text data to SQLite, CollectionFS and Meteor-Files attachments to the
filesystem, the card History with it, which MongoDB versions can be read, when
it runs, what happens when it fails, and how two copies are reconciled. The
Admin Panel, Snap and CPU-platform docs point there instead of documenting a
setting that no longer exists.

Nine guards updated; each says in it which decision changed and why.

Thanks to xet7 !
2026-08-12 22:25:18 +03:00
Lauri Ojansivu 40ff8151ea Snap: pick the database that holds the work, and merge the other one into its history.
An email report, on an instance being served the older of its two copies: "some
users are unable to log in (error: 'user not found'), and boards created after
mid-July appear to be missing." That is what serving a copy looks like from the
outside - the accounts and boards made after the copy was taken simply are not
there.

Until now the snap handled that by telling the admin to sort it out. #6583 taught
it not to switch on a guess, so when both MongoDB and the migrated FerretDB have
been written to since the migration it printed the two `snap set wekan
database=...` commands and stayed where it was. That message is in `snap logs`;
most people never see it, and their site meanwhile shows the wrong copy.

A file timestamp cannot answer "which copy holds the work" - an mtime says when a
file was touched, and starting a database touches its files. But both copies can
be READ, so ask them. bin/db-eval.mjs gains an `evidence` command (per-collection
counts, plus the newest timestamp any document carries) and bin/database-choose.mjs
decides from the two answers:

  one holds everything the other holds, and is not older -> serve it, nothing to
  merge;
  both hold work the other does not, and one is clearly newer -> serve the newer
  one and copy across what only exists in the other;
  too close to call, or nothing readable -> change NOTHING and keep the existing
  message, because that case is a decision about somebody's work.

"Clearly newer" is a margin, not a tie-break: six hours by default, so the writes
the migration itself makes on both sides cannot decide anything.

WHY THE MERGE IS SAFE, and it is WeKan's own design that makes it safe: the
history is APPEND-ONLY (docs/Features/Reports/History/History.md, which gains a
section 9a on exactly this). Activities, comments and the coming changeHistory
rows are never rewritten in place, so they can only be ADDED to. bin/database-
merge-missing.mjs therefore inserts every document whose _id is ABSENT from the
chosen database and does nothing else:

  * a document that IS there is never overwritten - a card edited on both sides
    keeps the version in the copy being served, which is the newer one;
  * nothing is deleted, on either side;
  * the copy that was not chosen stays on disk, so `snap set wekan database=<the
    other one>` is still the way back - now a choice rather than a repair;
  * the work done on the copy that is not being served becomes readable in the
    served copy's card History instead of sitting in a database nobody opens.

For the reported symptoms that means the missing users and boards are inserted
rather than left behind: a user who could not log in exists again, with their own
_id, and their boards with them.

A three-way merge - reconciling two edits of one field - is not attempted and will
not be from a script. Where the evidence cannot separate the copies, the snap
still says so and hands the decision to a person.

WEKAN_AUTOPICK=false turns the whole thing off, `database-autopick --dry-run`
shows what it would do, and AUTOPICK_MERGE_LIMIT bounds how much it copies.

tests/snapDatabaseAutopick.test.cjs covers the decision (both superset
directions, the both-diverged case, one side empty or unreadable, too-close, no
timestamps, and a BIGGER but older copy that must not win on size) and runs the
merge against an in-memory pair of databases: what is missing is inserted, what
exists is not overwritten, nothing is deleted on either side, --dry-run writes
nothing, a limit is not an error, and the merge script contains no update or
delete operation at all.

tests/ferretdbMigrationStale.test.cjs keeps its rule - no switch on a guess - with
the assertion updated to match what changed: this branch may not choose from the
timestamps it has, it delegates to the one thing that can choose, and when even
that cannot tell the copies apart the admin still gets both commands.

Verified by running both suites and the whole node suite (381 suites, 0 failed).
The snap itself cannot be built or refreshed in this sandbox, so the orchestration
that starts each database on a temporary port is verified from the code and from
the shapes migration-control already uses, not from a running snap.

Thanks to xet7 !
2026-08-12 15:30:25 +03:00
Lauri Ojansivu f628a69889 Reorganized docs Platforms etc.
Thanks to xet7 !
2026-08-03 13:07:12 +03:00
Lauri Ojansivu 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 !
2026-07-25 16:49:19 +03:00
Lauri Ojansivu 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 !
2026-07-25 16:22:10 +03:00
Lauri Ojansivu 54cc0ec614 docs: organize docs/Features into categories and update all links
Move the flat feature docs and feature subdirectories under category
parents: Admin-Panel/ (+ Problems/), Board/, Cards/, Editor/, Reports/,
Automation/, Lists/, Troubleshooting/. Every relative markdown link in
docs/ (and the docs GitHub URLs in CHANGELOG.md and the code-span path
in Undo.md) is recomputed so it still resolves to the same target after
the move.

Done with a scripted move + relative-link rewriter that verifies link
integrity: all 160 rewritten links resolve, and a full scan confirms the
reorg introduces zero new broken docs-internal links (the pre-existing
53 unrelated to the move are unchanged).
2026-07-20 13:37:44 +03:00