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:
+15
-1
@@ -240,6 +240,14 @@ type FlatOpenProvider struct {
|
||||
Supports []FlatOpenProviderSupport `json:"supports"`
|
||||
}
|
||||
|
||||
type FlatWorkspaceItem struct {
|
||||
PluginID string `json:"pluginId"`
|
||||
ID string `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Icon string `json:"icon,omitempty"`
|
||||
Component string `json:"component"`
|
||||
}
|
||||
|
||||
// ContributionSummary aggregates all contribution types for the frontend.
|
||||
type ContributionSummary struct {
|
||||
Views []FlatView `json:"views"`
|
||||
@@ -247,6 +255,7 @@ type ContributionSummary struct {
|
||||
SettingsPanels []FlatSettingsPanel `json:"settingsPanels"`
|
||||
SidebarItems []FlatSidebarItem `json:"sidebarItems"`
|
||||
OpenProviders []FlatOpenProvider `json:"openProviders"`
|
||||
WorkspaceItems []FlatWorkspaceItem `json:"workspaceItems"`
|
||||
}
|
||||
|
||||
// buildContributionSummary creates a ContributionSummary from the registry.
|
||||
@@ -259,6 +268,7 @@ func buildContributionSummary(r *contribution.Registry) ContributionSummary {
|
||||
regPanels := r.SettingsPanels()
|
||||
regSidebar := r.SidebarItems()
|
||||
regOpenProviders := r.OpenProviders()
|
||||
regWorkspaceItems := r.WorkspaceItems()
|
||||
|
||||
views := make([]FlatView, len(regViews))
|
||||
for i, v := range regViews {
|
||||
@@ -291,7 +301,11 @@ func buildContributionSummary(r *contribution.Registry) ContributionSummary {
|
||||
Supports: supports,
|
||||
}
|
||||
}
|
||||
return ContributionSummary{Views: views, Commands: cmds, SettingsPanels: panels, SidebarItems: sidebar, OpenProviders: openProviders}
|
||||
workspaceItems := make([]FlatWorkspaceItem, len(regWorkspaceItems))
|
||||
for i, v := range regWorkspaceItems {
|
||||
workspaceItems[i] = FlatWorkspaceItem{PluginID: v.PluginID, ID: v.Item.ID, Title: v.Item.Title, Icon: v.Item.Icon, Component: v.Item.Component}
|
||||
}
|
||||
return ContributionSummary{Views: views, Commands: cmds, SettingsPanels: panels, SidebarItems: sidebar, OpenProviders: openProviders, WorkspaceItems: workspaceItems}
|
||||
}
|
||||
|
||||
// GetContributions returns all registered contributions flattened for the frontend.
|
||||
|
||||
@@ -668,6 +668,25 @@ func TestWorkbenchOpenResourceRequiresPermission(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestWorkbenchDisabledPluginProviderExcluded(t *testing.T) {
|
||||
app := newBridgeTestApp(t)
|
||||
|
||||
result, errStr := app.OpenWorkbenchResource("bridge.plugin", map[string]interface{}{
|
||||
"kind": "vault-file",
|
||||
"path": "Docs/readme.md",
|
||||
"extension": ".md",
|
||||
})
|
||||
if errStr != "" {
|
||||
t.Fatalf("OpenWorkbenchResource: %s", errStr)
|
||||
}
|
||||
if result.ProviderPluginID != "bridge.plugin" {
|
||||
t.Fatalf("expected bridge.plugin provider, got providerPluginId=%q", result.ProviderPluginID)
|
||||
}
|
||||
if result.ProviderID == "disabled.markdown" {
|
||||
t.Fatal("disabled plugin provider should be excluded from selection")
|
||||
}
|
||||
}
|
||||
|
||||
func TestPluginBridgeSettingsRequireLoadedPluginAndStoragePermission(t *testing.T) {
|
||||
app := newBridgeTestApp(t)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user