feat(entity): Chunk #4 remaining items — consistency UI, context rail, palette search, expanded seed & DATA_MODEL
- Consistency tab in EntitiesView surfacing findInconsistencies() results - ContextRail + MentionPopover wired into WritingView for entity context/hover - CommandPalette indexes entities and chapters for cross-entity search - link field type for entity references in character fields - findDeadCharacterMentions consistency check + tests - Expand seed with a location, note, and a natural Elias Vell mention so the dead-character-after-death case is actually exercised - Author docs/DATA_MODEL.md documenting core schemas, types, storage contract - Rename CharacterMention id attr -> entityId to match core backlinks/consistency
This commit is contained in:
@@ -103,7 +103,7 @@ export const MentionAutocomplete = Extension.create({
|
||||
const nodeType = schema.nodes[CHARACTER_MENTION];
|
||||
if (!nodeType) return false;
|
||||
|
||||
const mention = nodeType.create({ id, label });
|
||||
const mention = nodeType.create({ entityId: id, label });
|
||||
const tr = state.tr.deleteRange(atPos, from).insert(atPos, mention);
|
||||
editor.view.dispatch(tr);
|
||||
return true;
|
||||
|
||||
@@ -3,7 +3,7 @@ import { CHARACTER_MENTION, colorAttribute } from "../constants.js";
|
||||
|
||||
/**
|
||||
* Character mention — an inline atom linking to a character entity.
|
||||
* Attributes: `id` (character id) and `label` (display name). Inline in HTML
|
||||
* Attributes: `entityId` (character id) and `label` (display name). Inline in HTML
|
||||
* as `<span class="mention mention-character" data-id="...">@Name</span>`.
|
||||
*/
|
||||
export const CharacterMention = Node.create({
|
||||
@@ -14,11 +14,11 @@ export const CharacterMention = Node.create({
|
||||
|
||||
addAttributes() {
|
||||
return {
|
||||
id: {
|
||||
entityId: {
|
||||
default: null,
|
||||
isRequired: true,
|
||||
parseHTML: (element) => element.getAttribute("data-id"),
|
||||
renderHTML: (attributes) => ({ "data-id": attributes.id }),
|
||||
renderHTML: (attributes) => ({ "data-id": attributes.entityId }),
|
||||
},
|
||||
label: {
|
||||
default: "",
|
||||
@@ -36,9 +36,9 @@ export const CharacterMention = Node.create({
|
||||
renderHTML({ node }) {
|
||||
return [
|
||||
"span",
|
||||
{ class: "mention mention-character", "data-id": node.attrs.id, "data-label": node.attrs.label },
|
||||
{ class: "mention mention-character", "data-id": node.attrs.entityId, "data-label": node.attrs.label },
|
||||
"@",
|
||||
node.attrs.label ?? node.attrs.id,
|
||||
node.attrs.label ?? node.attrs.entityId,
|
||||
];
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user