Lots of changes to the cmap stuff

This commit is contained in:
2026-08-22 13:51:15 +02:00
parent 63b7ca0853
commit 20c1584016
17 changed files with 3105 additions and 204 deletions
+108 -1
View File
@@ -2,7 +2,7 @@
Version 0.2.31 adds page namespaces as database metadata and extends wiki references to forms such as `RWS:ModelTreeWalker` and `[roadmap](racket:roadmap)`. Todo items and bookmarks are grouped by namespace. The source has also been documented more thoroughly, especially `static/js/wiki.js`.
Current development version: **0.2.94**.
Current development version: **0.2.99**.
A small self-hosted wiki with a Racket backend and an HTML5/CSS/JavaScript frontend.
@@ -834,3 +834,110 @@ instead of passing the invalid alphabetic escapes `\\r` and `\\n` to the
regexp parser. The CMap-embed expression uses an actual newline character in
its exclusion class for the same reason. Regression tests cover LF and CRLF
source markers and single-line CMap embeds.
### 0.2.95
CMap concepts can link to missing wiki pages by entering a new title or address; opening
that link uses the normal missing-page creation flow. Every concept can also have aspects
and a Markdown description page, defaulting to the `cmap` namespace. Separate icons open
the description and linked target, while double-clicking opens the concept editor.
The CMap document now separates stable concept identity from diagram-specific placement.
Position, size, colours and typography are retained per root/child-map context. Linked
copies made with Ctrl/Cmd+C and Ctrl/Cmd+V share their label, synopsis, aspects and link
targets while keeping independent presentation. Existing version-1 documents are upgraded
in memory when loaded.
Holding Alt while drawing a relation creates a direct arrow without a linking phrase. The
tools menu is moved outside the drawing stacking context so it remains above large maps.
The active stored CMap now shows its title and `cmap:slug`; clicking it copies ready-to-use
Markdown link syntax.
Concept descriptions now appear as rendered Markdown previews when the serif `I` is hovered
or focused. Its light-grey/white state shows whether a description exists. The compact concept
dialog adds local colour palettes, reusable style presets, normal/bold and italic controls, and
wrapped synopsis text.
Switching between stored CMaps now destroys the previous drawing surface before another one is
created. Deferred redraws from the old map are ignored, preventing duplicate layers and relations
whose visual endpoints no longer match their concepts. CMap content also scrolls underneath the
sticky toolbar instead of over it.
The sticky CMap header now paints through the main view's former top padding, so scrolled concepts
are clipped underneath the complete header area and cannot remain visible above its controls.
Deleting a concept or relation now limits orphan cleanup to linking phrases directly affected by
that deletion. Unrelated incomplete relations already present in a document are left untouched,
so deleting one relation cannot unexpectedly remove other parts of the map.
A stored relation whose source or target concept is missing no longer prevents the complete CMap
from opening. Such a damaged relation is omitted from the drawing but retained verbatim in the
document, including across automatic saves, until its remaining endpoint is explicitly deleted.
Every ordinary concept placement shows a compact `(n)` usage indicator. It counts all placements
sharing that concept identity across every active stored CMap and updates immediately for unsaved
changes in the open map. New concepts receive wiki-wide UUID-based identities. Legacy document-local
IDs are qualified with their CMap slug so coincidentally equal old IDs are never conflated.
### 0.2.96
**Make separate CMap** now creates a stored derived view of a sub-CMap instead of copying or moving
its graph. The parent remains the canonical owner of every concept and relation. Its sub-CMap can
still expand and collapse in place, while a separate arrow opens the same elements with their own
page-specific layout at a normal `cmap:slug` address.
Elements inside an expanded nested view can be hidden only in the parent context. A toolbar dropdown
lists those hidden concepts and restores them individually. The standalone view continues to contain
all elements. Relations crossing the submap boundary remain in the canonical graph; on the standalone
page they appear from the viewport edge with the external concept name, which navigates back to the
source CMap when clicked.
An expanded sub-CMap has an independently movable group frame. Its concept remains at its anchor
position and a quiet grey line connects that anchor to the group. Collapsing removes only the frame
and line; expanding restores the group at its last position for that CMap context.
The tools menu can mark the current map as the browser's start CMap. The sidebar CMaps icon and the
plain `#cmaps` route open that preference, falling back to the first available map if it no longer
exists.
For a complete installation, `racket migrate-cmap-subpages.rkt` first reports every legacy internal
page and the target slug without changing data. Run `racket migrate-cmap-subpages.rkt --apply` to
perform the conversion in one PostgreSQL transaction. The parent retains its complete document and
receives only the child-view slugs; each stored child contains a `derivedView` reference to the parent
slug and submap root id. Every preceding parent and child version remains available. A target slug is
only reused when it belongs to the earlier subpage migration; an unrelated existing map aborts the
transaction.
### 0.2.97
CMap autosave now updates only the current document and optimistic version number. It no longer
creates a history row. Explicit saves from Ctrl/Cmd-S or **Save now** retain at most the five newest
versions per CMap, while explicitly named snapshots remain unlimited. The history dialog displays
only those manual versions and snapshots and allows an editor to delete either kind after a
confirmation; deleting history never changes the current CMap.
Database migration 12 removes legacy automatic-save history rows, reclassifies recognizable legacy
manual saves, and transactionally trims those manual saves to five per CMap. Migration, repair and
other internal safety versions remain stored outside the everyday history list.
### 0.2.98
Concept headings and synopsis text now have independent text colour, font family, point size, bold
and italic controls. These presentation fields belong to the placement and its CMap context; linked
concept identity remains shared while each view can keep its own typography. Legacy concepts inherit
their existing shared typography for both text parts until an editor changes either section.
The compact colour palette is now editable. A single click applies a palette colour to the current
form, while a double-click on a palette tile opens the browser's native HTML colour picker and
replaces that reusable tile. Double-clicking the current-colour swatch opens the same picker for a
one-off colour. The palette is stored locally in the browser, whereas every concept placement stores
its selected hexadecimal colour directly; changing a palette tile therefore never recolours existing
concepts.
### 0.2.99
A wiki page now shows a **Connected CMap concepts** panel when one or more current concepts link to
that page. Concepts are grouped by stable `conceptId`; each row shows the concept label, total
placement count and clickable chips for every CMap containing it. Repeated placements in one CMap
show their local count. The panel follows page aliases and uses only current, non-archived CMap
documents—not historical versions.