Changeset 0.37.11 (#223)

Co-authored-by: gobha <jasafpro@gmail.com>
Co-committed-by: gobha <jasafpro@gmail.com>
This commit is contained in:
2026-03-22 00:57:49 +00:00
committed by xcaliber
parent 8d8a118232
commit c687002015
18 changed files with 1142 additions and 87 deletions

View File

@@ -16,6 +16,7 @@
{{/* panels.css, pane-container.css, chat-pane.css removed in v0.37.10 */}}
<link rel="stylesheet" href="{{.BasePath}}/css/surfaces.css?v={{.Version}}">
<link rel="stylesheet" href="{{.BasePath}}/css/splash.css?v={{.Version}}">
<link rel="stylesheet" href="{{.BasePath}}/css/sw-primitives.css?v={{.Version}}">
<link rel="stylesheet" href="{{.BasePath}}/css/sw-chat-pane.css?v={{.Version}}">
<link rel="stylesheet" href="{{.BasePath}}/css/sw-notes-pane.css?v={{.Version}}">
<link rel="stylesheet" href="{{.BasePath}}/css/user-menu.css?v={{.Version}}">
@@ -24,6 +25,7 @@
<link rel="stylesheet" href="{{.BasePath}}/css/admin-surfaces.css?v={{.Version}}">
<link rel="stylesheet" href="{{.BasePath}}/css/extension-surface.css?v={{.Version}}">
{{if eq .Surface "chat"}}{{template "css-chat" .}}{{end}}
{{if eq .Surface "notes"}}{{template "css-notes" .}}{{end}}
{{/* v0.27.0: Extension surface CSS — loaded from /surfaces/{id}/css/main.css */}}
{{if and .Manifest (eq .Manifest.Source "extension")}}
<link rel="stylesheet" href="{{.BasePath}}/surfaces/{{.Surface}}/css/main.css?v={{.Version}}">

View File

@@ -1,47 +1,65 @@
{{/*
Notes surface (v0.37.9).
Server renders the layout shell. SDK boots Preact NotesPane kit
into #notesMainMount via sw.notesPane().
Notes surface (v0.37.11 — Preact).
Replaced the v0.37.9 template mount with a single mount point.
Preact NotesSurface component handles all rendering.
*/}}
{{define "surface-notes"}}
<div class="surface-notes" id="surfaceNotes">
<div class="surface-notes-body">
{{/* Notes list + editor */}}
<div class="surface-notes-main" id="notesMainMount"></div>
{{/* Chat assist pane (optional, can toggle) */}}
<div class="surface-notes-assist" id="notesAssistMount"></div>
{{/* ── Crash Catcher (visible without devtools) ── */}}
<div id="crashBanner" style="display:none;position:fixed;top:0;left:0;right:0;z-index:99999;background:#b00020;color:#fff;padding:12px 20px;font-family:monospace;font-size:13px;max-height:40vh;overflow-y:auto;">
<strong>Init Error</strong> <button onclick="this.parentElement.style.display='none'" style="float:right;background:none;border:1px solid #fff;color:#fff;cursor:pointer;padding:2px 8px;border-radius:3px">X</button>
<pre id="crashDetail" style="margin:8px 0 0;white-space:pre-wrap;font-size:12px;"></pre>
</div>
<script nonce="{{$.CSPNonce}}">
window.addEventListener('error', function(e) {
var b = document.getElementById('crashBanner');
var d = document.getElementById('crashDetail');
if (b && d) {
b.style.display = '';
d.textContent += (e.filename || '') + ':' + (e.lineno || '') + ' ' + (e.message || e) + '\n';
}
});
window.addEventListener('unhandledrejection', function(e) {
var b = document.getElementById('crashBanner');
var d = document.getElementById('crashDetail');
if (b && d) {
b.style.display = '';
d.textContent += 'Promise: ' + (e.reason?.message || e.reason || 'unknown') + '\n' + (e.reason?.stack || '') + '\n';
}
});
</script>
{{/* ── Mount Point ────────────────────────── */}}
<div id="notes-mount" style="height:100%;display:flex;">
<div style="display:flex;align-items:center;justify-content:center;width:100%;color:var(--text-2,#999);font-size:14px;">
Loading...
</div>
</div>
{{end}}
{{define "css-notes"}}
{{/* v0.37.9: Notes surface CSS — sw-notes-pane.css loaded in base.html */}}
<link rel="stylesheet" href="{{.BasePath}}/css/sw-notes-surface.css?v={{.Version}}">
<link rel="stylesheet" href="{{.BasePath}}/branding/custom.css" onerror="this.remove()">
{{end}}
{{define "scripts-notes"}}
{{/* v0.37.9: Notes surface — Preact vendor globals + SDK boot + NotesPane */}}
<script type="module" nonce="{{.CSPNonce}}">
// Vendor: Preact + htm → globals
const { h, render } = await import('{{.BasePath}}/js/sw/vendor/preact.module.js');
const hooksModule = await import('{{.BasePath}}/js/sw/vendor/hooks.module.js');
const { default: htm } = await import('{{.BasePath}}/js/sw/vendor/htm.module.js');
<script nonce="{{$.CSPNonce}}" src="{{$.BasePath}}/vendor/marked.min.js"></script>
<script nonce="{{$.CSPNonce}}" src="{{$.BasePath}}/vendor/purify.min.js"></script>
<script type="module" nonce="{{$.CSPNonce}}">
// v0.37.11: Preact boot — same pattern as chat surface.
const { h, render } = await import('{{$.BasePath}}/js/sw/vendor/preact.module.js');
const hooksModule = await import('{{$.BasePath}}/js/sw/vendor/hooks.module.js');
const { default: htm } = await import('{{$.BasePath}}/js/sw/vendor/htm.module.js');
const html = htm.bind(h);
window.preact = window.preact || { h, render };
window.hooks = window.hooks || hooksModule;
window.html = window.html || html;
// Boot SDK
const { boot } = await import('{{.BasePath}}/js/sw/sdk/index.js?v={{.Version}}');
const sw = await boot();
const { boot } = await import('{{$.BasePath}}/js/sw/sdk/index.js?v={{$.Version}}');
await boot();
// Mount NotesPane
const mount = document.getElementById('notesMainMount');
if (mount) sw.notesPane(mount, { standalone: true });
// Optional: mount chat assist pane
const assist = document.getElementById('notesAssistMount');
if (assist) sw.chatPane(assist, { standalone: true });
await import('{{$.BasePath}}/js/sw/surfaces/notes/index.js?v={{$.Version}}');
</script>
{{end}}

View File

@@ -1,3 +1,3 @@
package main
const Version = "0.37.10"
const Version = "0.37.11"