fix(client): internalBookmark not hidden

This commit is contained in:
Elian Doran
2026-04-18 10:30:03 +03:00
parent ae004c4334
commit 480da09bcc
3 changed files with 8 additions and 10 deletions

View File

@@ -7,6 +7,10 @@ async function renderAttribute(attribute: FAttribute, renderIsInheritable: boole
const isInheritable = renderIsInheritable && attribute.isInheritable ? `(inheritable)` : "";
const $attr = $("<span>");
if (attribute.isAutoLink) {
return $attr;
}
if (attribute.type === "label") {
$attr.append(document.createTextNode(`#${attribute.name}${isInheritable}`));
@@ -15,9 +19,6 @@ async function renderAttribute(attribute: FAttribute, renderIsInheritable: boole
$attr.append(document.createTextNode(formatValue(attribute.value)));
}
} else if (attribute.type === "relation") {
if (attribute.isAutoLink) {
return $attr;
}
// when the relation has just been created, then it might not have a value
if (attribute.value) {

View File

@@ -51,6 +51,10 @@ function AutoLinkAttribute({ attribute }: { attribute: FAttribute }) {
}
async function renderAutoLink(attribute: FAttribute) {
if (attribute.type === "label") {
return `#${escapeHtml(attribute.name)}=${escapeHtml(attribute.value)}`;
}
const note = await froca.getNote(attribute.value);
if (!note) return "";

View File

@@ -264,13 +264,6 @@ export default function EditableText({ note, parentComponent, ntxId, noteContext
editor.setData(contentRef.current);
parentComponent?.triggerEvent("textEditorRefreshed", { ntxId, editor });
// Scroll to bookmark anchor if navigated with ?bookmark=...
const viewScope = noteContext?.viewScope;
if (viewScope?.bookmark) {
const el = editor.editing.view.getDomRoot()?.querySelector(`[id="${CSS.escape(viewScope.bookmark)}"]`);
el?.scrollIntoView({ behavior: "smooth", block: "center" });
viewScope.bookmark = undefined;
}
}}
/>}