mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 18:10:06 -05:00
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 !