refactor(plugin): drop the theme sounds field

The host never played these files. A theme with an interactive script can
play its own sounds, so a second way is not needed. Old manifests still load
and get the usual notice about a field the host does not know.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
千川白浪andClaude Opus 5.5 committed 2026-12-03 22:22:02 -07:00
1 parent f6cbd5d650
commit 8f7d62d0cc
5 files changed
+10 -9

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
{
"group": "removals",
"order": 0,
"authors": [
"Nwflower"
],
"zh": "主题清单不再支持从未生效的 `sounds` 字段。带交互脚本的主题可以自行播放提示音。",
"en": "Theme manifests no longer accept the `sounds` field, which never took effect. Themes with an interactive script can play their own sounds."
}
+1 -1
View File
@@ -50,7 +50,7 @@ Sidecar 的控制台 Host API 只接受 VM 引用,不接受 QMP 套接字或 V
## 主题、面板桥接与契约演进
宿主内置浅色与深色外观,同时提供三档主题扩展能力:第一档通过种子色与派生规则生成表面、文字和边框色阶,支持替换包内字体、单色图标、品牌标志与事件提示音;第二档提供面向公开部件类名(`rg-p-*`)与只读状态属性(`data-*`)的样式表及槽位/全窗图层状态装饰,由宿主锁定层叠顺序并清洗外部链接,且始终保护标题栏拖拽区、键盘焦点环与最小点击热区;第三档通过稳定的 `contributes.themes[].uiScript` 字段声明交互脚本,仅对获批 `ui:script` 高危权限的主题按需加载前端交互接口。交互脚本运行在主窗口前端环境并共享页面 DOM(并非隔离沙盒),加载前宿主会自动收起桌面底层绑定全局对象。
宿主内置浅色与深色外观,同时提供三档主题扩展能力:第一档通过种子色与派生规则生成表面、文字和边框色阶,支持替换包内字体、单色图标与品牌标志;第二档提供面向公开部件类名(`rg-p-*`)与只读状态属性(`data-*`)的样式表及槽位/全窗图层状态装饰,由宿主锁定层叠顺序并清洗外部链接,且始终保护标题栏拖拽区、键盘焦点环与最小点击热区;第三档通过稳定的 `contributes.themes[].uiScript` 字段声明交互脚本,仅对获批 `ui:script` 高危权限的主题按需加载前端交互接口,提示音也由交互脚本自行播放。交互脚本运行在主窗口前端环境并共享页面 DOM(并非隔离沙盒),加载前宿主会自动收起桌面底层绑定全局对象。
已激活的外部主题在重启客户端和升级插件后自动保留,并在脚本变更重新批准后带版本哈希参数重载;仅停用或卸载所属主题插件时回退内置默认主题并清空当前配色方案,安全模式或命令行停用无关插件不会影响当前主题。从市场安装并启用主题插件时,仅当当前仍处于内置默认主题才自动切换为该插件的首个主题,不覆盖用户已选的其他外部主题。
-2
View File
@@ -1799,7 +1799,6 @@ export namespace plugin {
icons?: Record<string, string>;
brandMark?: string;
background?: string;
sounds?: Record<string, string>;
stylesheet?: string;
decorations?: ThemeDecoration[];
uiScript?: string;
@@ -1825,7 +1824,6 @@ export namespace plugin {
this.icons = source["icons"];
this.brandMark = source["brandMark"];
this.background = source["background"];
this.sounds = source["sounds"];
this.stylesheet = source["stylesheet"];
this.decorations = this.convertValues(source["decorations"], ThemeDecoration);
this.uiScript = source["uiScript"];
-5
View File
@@ -453,11 +453,6 @@ func ValidateThemeContribution(th ThemeContribution, rootDir string) error {
return fmt.Errorf("theme icon %q (%q): %w", k, asset, err)
}
}
for k, asset := range th.Sounds {
if err := validateSafeManifestAsset(asset, rootDir); err != nil {
return fmt.Errorf("theme sound %q (%q): %w", k, asset, err)
}
}
for _, dec := range th.Decorations {
for _, st := range dec.States {
if st.Asset != "" {
-1
View File
@@ -358,7 +358,6 @@ type ThemeContribution struct {
Icons map[string]string `json:"icons,omitempty"`
BrandMark string `json:"brandMark,omitempty"`
Background string `json:"background,omitempty"`
Sounds map[string]string `json:"sounds,omitempty"`
Stylesheet string `json:"stylesheet,omitempty"` // relative path inside package
Decorations []ThemeDecoration `json:"decorations,omitempty"`
UIScript string `json:"uiScript,omitempty"` // requires ui:script