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 !
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 !