fix(webapp): "Link it" on Wiki health makes the link (#1157) #1164
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/1157-wiki-health-link-it"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #1157 (D301).
"Link it" beside an unlinked mention used to open the editor. It now makes the link in one press, with Undo.
POST /campaigns/{id}/lore/{entry_id}/link-mention {to}, GM only. Saves throughupdate_lore_entryas the acting GM (version row, link index, wiki event), and writes an audit eventlore.mention_linked.[[Title]]when the words equal the title exactly, else[[Title|the words]], so the GM's prose is kept. The editor's own suggestion now does the same.wiki_health._bare_textblanks everything a renderer does not draw as prose (code, fences, links and embeds, web links and images, footnotes and their definitions, anchors, headings, marker lines). Where the server's reading and the frontend's could differ, the text is treated as not prose. The report and the route share it, so such mentions also leave the report.?if_version_id=; refused with 409 if the page has changed since. The comparison is now made under the row lock.Additive only; no bot contract change, no migration.
Review
An independent review found two must-fix defects (headings; footnote definitions masking a later mention) and nine smaller ones (blockquote grouping, fence disagreements, length caps,
!/\prefixes, unlinkable titles, two concurrency gaps, body limit and audit, Health page focus and refresh, editor agreement). All eleven are fixed, each with a test using the reviewer's input. The review found no authorisation or disclosure problem and no super-linear pattern at 200,000 characters.Verified
On
docker-test:tests/wikiin full (1626 passed, 1 failed: a title-reader guard, then fixed; only that file and two others were re-run, 92 passed). Ruff clean. Frontend lint clean, full vitest 4017 passed. Changelog check OK.Not run:
e2e/j8-wiki-health-link-it.spec.js(CI will); no race test for the locking.Known limits: a pair whose only mentions sit in quote lines, lists or near a length cap can still be listed while the route refuses; it never writes wrongly. The audit row is a second commit after the link.
🤖 Generated with Claude Code