Feat v0.7.3 extension shell migration
All checks were successful
CI/CD / detect-changes (pull_request) Successful in 4s
CI/CD / test-runners (pull_request) Has been skipped
CI/CD / test-frontend (pull_request) Successful in 7s
CI/CD / test-sqlite (pull_request) Successful in 2m48s
CI/CD / test-go-pg (pull_request) Successful in 2m53s
CI/CD / build-and-deploy (pull_request) Successful in 1m8s

Migrate Chat, Notes, and Schedules from legacy sw.shell.Topbar to the
v0.7.0 shell topbar contract (sw.shell.topbar.setTitle/setSlot),
eliminating double topbars on all extension surfaces.

- Chat v0.3.0: reactive slot for thread title + People button
- Notes v0.9.0: slot for New/Import/Graph buttons
- Schedules v0.2.0: reactive slot for count + New button
- 6 new shell-topbar runner tests (2 per surface)
- Headless E2E deferred to v0.7.5

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-02 12:52:40 +00:00
parent d6c7b21713
commit 4a6109b74f
18 changed files with 188 additions and 58 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} />