+ ${entry.kind === "task"
+ ? ``
+ : `${entry.kind === "decision" ? "⚖️" : "🗒"}`}
+
+
${escapeHtml(entry.text)}
+
+ ${entry.due ? `due ${escapeHtml(entry.due)}` : ""}
+ ${entry.tags.map((tag) => `#${escapeHtml(tag)}`).join("")}
+ ${provenance}${sourceLink ? ` · ${sourceLink}` : ""} · ${escapeHtml(relativeTime(entry.updated))}
+
+
+
+
+
+ ${isOpen ? `` : ""}
+
+ `;
+}
+
+function renderSection(title: string, entries: NotepadEntry[]) {
+ if (!entries.length) return "";
+ return `
+
+
+
${escapeHtml(options.status || "")}
+ ${active.length === 0 ? `
${query ? "Nothing matches this filter." : "Nothing here yet. Notes added by you or by agents in any conversation show up in this one shared planner."}
` : ""}
+ ${renderSection("📌 Pinned", pinned)}
+ ${renderSection("☐ Tasks", tasks)}
+ ${renderSection("🗒 Notes & decisions", other)}
+ ${closed.length ? `
Recently closed (${closed.length})
${closed.map(renderEntryRow).join("")}
` : ""}
+
`;
+ return { title: "Global notepad", html };
+}
+
+function renderEditForm(entry: NotepadEntry): PiWebPanelView {
+ const payload = escapeHtml(JSON.stringify({ id: entry.id }));
+ const html = `${panelStyles}
+