Feat v0.7.3 extension shell migration (#57)
All checks were successful
CI/CD / detect-changes (push) Successful in 4s
CI/CD / test-runners (push) Has been skipped
CI/CD / test-frontend (push) Successful in 5s
CI/CD / test-go-pg (push) Successful in 2m51s
CI/CD / test-sqlite (push) Successful in 3m2s
CI/CD / build-and-deploy (push) Successful in 27s

Co-authored-by: Jeffrey Smith <jasafpro@gmail.com>
Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #57.
This commit is contained in:
2026-04-02 13:07:59 +00:00
committed by xcaliber
parent d6c7b21713
commit 32e4d8725c
19 changed files with 204 additions and 63 deletions

View File

@@ -1,10 +1,10 @@
/**
* Notes — Surface Entry Point (v0.8.0)
* Notes — Surface Entry Point (v0.9.0)
*
* Markdown notes surface using the SDK:
* sw.api.ext('notes') — scoped API client
* sw.ui.* — primitive components
* sw.shell.Topbar — navigation bar
* sw.shell.topbar shell topbar API
* window.CM — CodeMirror 6 bundle (optional)
*/
(async function () {
@@ -59,7 +59,6 @@
// ── SDK modules ────────────────────────────
var api = sw.api.ext('notes');
var { Button, Spinner } = sw.ui;
var Topbar = sw.shell.Topbar;
// ── Debounce helper ────────────────────────
var _timers = {};
@@ -1729,13 +1728,19 @@
debounce('search', function() { loadNotes(); }, 300);
}
return html`
<${Topbar} title="Notes">
// ── Shell topbar ───────────────────────────
useEffect(() => {
if (!sw.shell?.topbar) return;
sw.shell.topbar.setTitle('Notes');
sw.shell.topbar.setSlot(html`
<${Button} variant="primary" size="sm" onClick=${handleNew}>+ New Note<//>
<${Button} variant="secondary" size="sm" onClick=${handleImport}>Import .md<//>
<${Button} variant=${showGraph ? 'primary' : 'secondary'} size="sm"
onClick=${function() { setShowGraph(!showGraph); }}>Graph<//>
<//>
`);
}, [showGraph]);
return html`
<div class="ext-notes-app">
<div class="ext-notes-sidebar">
<${SidebarTabs} activeTab=${sidebarTab} onTabChange=${setSidebarTab} noteSelected=${!!activeNote} />