feat: milestones 6b-fix through 6e — default-editor, files plugin, workspace host, workspaceItems contribution

- Fix PluginCard openProviders display
- Add default-editor plugin (text/markdown/notes-context)
- Add files plugin with workspaceItems placement
- Add workspaceItems contribution point (Go + API + mock + SDK)
- Add WorkspaceHost component for workspace area
- WorkspaceTree dispatches selection event
- Fix default-editor layout to fill container
- Fix PluginCard unsafe .length access
- Add E2E tests: 34/34 pass
- Add bundle execution check to official-plugins check.sh
- Update docs: PLUGIN_RUNTIME, DEV_PLUGINS, MILESTONE_6B/6C/6D plans
This commit is contained in:
2026-06-19 16:42:01 +08:00
parent 6ed6df311a
commit a6412fa070
23 changed files with 1518 additions and 286 deletions
+6
View File
@@ -101,6 +101,12 @@ Workbench selects by resource kind, extension/mime, context (`generic-text`,
deterministic `pluginId/providerId` tie-break. If nothing matches, Workbench
shows `no-provider` fallback instead of a core editor.
The official `verstak.default-editor` plugin provides three openProviders:
`verstak.default-editor.text` (generic-text), `verstak.default-editor.markdown`
(generic-markdown), and `verstak.default-editor.notes-markdown` (notes-context).
It uses a single unified `DefaultEditor` component with textarea-based editing,
simple markdown preview, dirty state tracking, and Ctrl+S save.
This is a cooperative contract, not a sandbox. Bundled plugins run in the same JS
context as the desktop frontend; real isolation is deferred to the sidecar/sandbox
milestone.
+13
View File
@@ -133,3 +133,16 @@ Out of scope:
- Watcher/sync/binary streaming/external editor.
- Sidecar/security boundary.
- Large rewrite.
## 6b-fix: Infrastructure Gaps Closed
Post-review fixes before Milestone 6c:
- Added `openProviders` to `verstak-sdk/schemas/contributions.json` contribution points.
- Added provider matching tests: text/markdown preference, MIME matching, extension
case-insensitivity, multiple supports entries, kind mismatch.
- Added disabled provider exclusion test in `api/app_test.go`.
- Fixed SDK `build.sh`/`test.sh` to detect incomplete `node_modules`.
- Documented disabled provider lifecycle: contributions remain in registry until
ReloadPlugins; `activeOpenProviders()` filters disabled/unloaded at request time.
- Installed Playwright browsers for E2E tests.
+65
View File
@@ -0,0 +1,65 @@
# Milestone 6c — Default Editor Plugin
## Goal
Create the official Default Editor Plugin as an openProvider for text, generic
markdown, and notes-context markdown files. Core desktop does not own or import
the editor component.
## What was built
### Plugin: `verstak.default-editor`
Location: `verstak-official-plugins/plugins/default-editor/`
**Manifest declares 3 openProviders:**
| Provider ID | Context | Extensions |
|-------------|---------|------------|
| `verstak.default-editor.text` | `generic-text` | `.txt`, `.log`, `.conf`, `.ini`, `.toml`, `.yaml`, `.yml`, `.json`, `.csv` |
| `verstak.default-editor.markdown` | `generic-markdown` | `.md`, `.markdown` |
| `verstak.default-editor.notes-markdown` | `notes-markdown` | `.md`, `.markdown` |
All providers use the same `DefaultEditor` component (unified, not 3 separate editors).
**Permissions:** `files.read`, `files.write`, `workbench.open`
**Capabilities required:** `verstak/core/files/v1`, `verstak/core/workbench/v1`
### Frontend component: `DefaultEditor`
- **Modes:** text (textarea), generic-markdown (editor + preview), notes-markdown (editor + preview + notes badge)
- **File loading:** `api.files.readText(path)` with loading/error states
- **Saving:** `api.files.writeText(path, content, { overwrite: true })` with dirty/saved/error states
- **Keyboard:** Ctrl+S / Cmd+S save, Tab indentation
- **Markdown preview:** Simple renderer (no raw HTML, no script injection)
- **Notes context:** Badge + info bar, no separate note entity, no `.verstak/notes`
## Verification
- `go test ./...` — PASS
- `go vet ./...` — PASS
- `npm run build` (frontend) — PASS
- `npm run test:e2e` — 28/28 PASS (20 existing + 8 new)
- `scripts/check.sh` (official-plugins) — PASS
- `scripts/build.sh` (official-plugins) — PASS
- SDK checks — PASS
## Manual testing
Until Files UI plugin exists, use platform-test diagnostics panel to manually
open files via workbench: click "Open Text Diagnostic", "Open Markdown Diagnostic",
or "Open Notes Diagnostic" buttons. These call `api.workbench.editResource` and
route through the default-editor provider.
## Deferred
- CodeMirror/Monaco editor
- Backlinks, internal link navigation
- Secret widgets
- Image asset pipeline
- Files UI plugin
- Notes UI plugin
- Watcher/sync
- External open
- Sidecar/security isolation
+64
View File
@@ -0,0 +1,64 @@
# Milestone 6d — Minimal Files Plugin
## Goal
Create a minimal Files plugin that shows vault files/folders and opens files
through Workbench openResource. No editor embedded.
## What was built
### Plugin: `verstak.files`
Location: `verstak-official-plugins/plugins/files/`
**Contributions:**
- views: `verstak.files.view``FilesView` component
- No sidebarItems — Files is not a global sidebar item
**Permissions:** `files.read`, `files.write`, `workbench.open`, `ui.register`
### Files View
- Root listing on mount
- Folder navigation (double-click)
- File open via `api.workbench.openResource()`
- Breadcrumb navigation
- Create folder/file buttons
- Refresh button
- Loading/error/empty states
- `.verstak` filtered out
### Provider priority
- default-editor: priority 50
- platform-test diagnostic: priority 10
- default-editor wins for normal file opens
### Bundle fix
Fixed missing opening quote in STYLES string (`.files-empty``'.files-empty'`).
Added automated bundle execution check to `scripts/check.sh`.
## 6d-hotfix
- Removed sidebarItems from Files plugin (Files is not a global sidebar item)
- Added `[frontend bundle execution]` check to `check.sh` — verifies all plugin
bundles parse via `new Function()` and register via `VerstakPluginRegister`
- Updated E2E tests: Files no longer expected in global sidebar
- Documented: sidebarItems are global shell navigation, not workspace template tabs
## Verification
- `go test ./...` — PASS
- `go vet ./...` — PASS
- `npm run build` — PASS
- `npm run test:e2e` — 34/34 PASS
- Official plugins — 3 plugins built, bundle execution check passes
- SDK — 11/11 tests pass
## Deferred
- Notes plugin, rename/move/trash UI, drag-and-drop, context menu,
watcher/inotify, sync, external open, binary streaming, sidecar/security,
workspace template host (Milestone 6d2)
+17
View File
@@ -335,10 +335,27 @@ extension/mime, context, user preference, priority, then deterministic
`pluginId/providerId` fallback. If nothing matches, Workbench returns
`status: "no-provider"` and shows the fallback view instead of a core editor.
Disabled/failed/missing-required-capability plugins are excluded from provider
selection at request time by `activeOpenProviders()`. Their contributions may
remain in the registry until the next `ReloadPlugins()` cycle, but they never
match during routing.
Draft app-global preferences are `defaultTextEditorProvider`,
`defaultMarkdownEditorProvider`, and `defaultNotesMarkdownEditorProvider`.
Vault-scoped and per-extension overrides are deferred.
### Default Editor Plugin
The official `verstak.default-editor` plugin (`verstak-official-plugins/plugins/default-editor/`)
provides openProviders for text, generic markdown, and notes-context markdown files.
It uses `api.files.readText` / `api.files.writeText` for file I/O and mounts through
the standard `PluginBundleHost` / provider host mechanism. Core does not import or
reference this plugin directly.
Provider plugins may have no sidebar item — openProviders are contribution points
for workbench routing, not navigation. Plugin Manager displays openProviders in the
contributions summary.
### API methods
`settings`