Fix local markdown title option persistence

This commit is contained in:
lix-2026
2026-05-26 16:47:03 +08:00
parent bb17513821
commit 2c7a91e1fb
7 changed files with 31 additions and 2 deletions
@@ -163,8 +163,13 @@ import {
const syncPageAggregateScript = (session, aggregate) => {
if (!session || !aggregate) return;
const scriptId = session.pageAggregateScriptId || '__MNOTE_PAGE_AGGREGATE__';
const node = document.getElementById(scriptId);
if (!node) return;
let node = document.getElementById(scriptId);
if (!node) {
node = document.createElement('script');
node.id = scriptId;
node.type = 'application/json';
document.body.appendChild(node);
}
try {
node.textContent = JSON.stringify(aggregate);
node.setAttribute('data-mnote-page-aggregate-synced-at', String(Date.now()));
@@ -343,6 +348,7 @@ import {
}
const aggregate = options.aggregate || await fetchPageAggregateForPane(descriptor);
const bootstrap = buildBootstrapFromAggregate(aggregate, descriptor, paneRole);
syncPageAggregateScript({ pageAggregateScriptId: bootstrap.pageAggregateScriptId }, aggregate);
const runtimeDescriptor = { paneRole, root, observability, aggregate, bootstrap };
updatePaneChrome(runtimeDescriptor);
if (paneRole === 'secondary' && workspace instanceof HTMLElement) {