Connectors tab for the official connectors
官方连接器的“连接器”标签页
The official connector bundles, such as Feishu, WeCom, Notion, Tencent Docs, and Linear, are separately installed packages. Before installation the Plugins page shows nothing about a connector. Users need one place that offers every official connector, installs a missing one, and leads to the connector's own page, where its account section lives.
English
Problem
The official connector bundles, such as Feishu, WeCom, Notion, Tencent Docs, and Linear, are separately installed packages. Before installation the Plugins page shows nothing about a connector. Users need one place that offers every official connector, installs a missing one, and leads to the connector's own page, where its account section lives.
Decision
The experimental optional Connectors bundle is off by default, and the Plugins page lists it under Experimental plugins. One package holds the bundle declaration and the tab, because the bundle composes nothing else: its patch inserts its own row, whose browser entry registers the Connectors tab through plugins.tab. The entry is a tab rather than a bundle detail page because only a tab's owner props carry install and an openPackage whose page returns to the tab; the plugin manager keeps no navigation stack for a page opened from another bundle's page.
The tab uses the Plugins page as the Discover tab does and changes neither the page nor the shared bundle lists. It carries the connector list, each connector's title and description in every shipped language, and its brand icon. A connector the profile does not hold shows Install, which passes <package>@<DSH_CLIENT_VERSION> to the page's install dialog; an installed connector shows a switch, which the tab applies through pluginManager.setBundleEnabled, and the rest of its row opens its page. The connector packages stay separately installed and do not join ON_DEMAND_BUNDLES, so removing the experiment leaves every connector installable with dsh plugin add.
Installed connectors keep their cards and switches on the Installed tab and run whether or not the Connectors bundle is enabled; the bundle adds only the tab.
Alternatives considered
Leaving the connectors off the Installed lists. With the tab as the connectors' only entry, each connector appears once. It needs a connector list shared with the Plugins page and a filter in that page's card lists, so an experimental tab changes what the page shows. The existing lists do not fit either: HIDDEN_BUNDLES also removes the detail pages that carry the account sections, listedByDefault: false still lists installed bundles, and MORE_BUNDLES applies only to official bundles.
One switch that stops every connector. A Host service that every connector row injects lets the bundle's switch stop and resume the connectors. Every connector then runs only while an experimental bundle is enabled, in every profile, including those without a Plugins page. A row condition (disabled: !!js) cannot follow the switch, because the Loader evaluates it only when it mounts the row, and disabling the connectors from the Plugins page covers only that page's switch and overwrites each connector's own enabled state.
The Installed list's switch in each row. A switch that installs a missing connector and then switches it on needs a new Factory slot and an install-then-enable path in the Plugins page. The tab's own switch covers installed connectors through pluginManager.setBundleEnabled without either, and the install dialog's Enable now switches a newly installed connector on.
Official on-demand catalog entries for the connectors. The catalog supplies offline metadata, detail pages before installation, and development link: installs. It also makes every connector an official catalog member that requires an icon, and lists uninstalled connectors in the Plugins page's own groups unless they are hidden as well.
A detail page on the Connectors bundle card. A plugins.bundle.config page cannot install a missing connector, a connector page opened from it returns to the main list, and the bundle's own rows and source sections stay below the content.
Consequences
Installing from the tab needs the connector package published at the running DSH version; development builds install connectors with dsh plugin add. An installed connector appears on both the Installed tab and the Connectors tab, and the guidance it offers after Enable now appears on the Installed tab. A switch on the Connectors tab shows no account guidance or restart notice and sends no plugin_toggle event; the switch on the connector's Installed card does all three. A new official connector adds its package name, title, description, and icon to the tab; no check compares that copy with the connector's own. The tab shows no account connection state; the connector's page does.
中文
问题
飞书、企业微信、Notion、腾讯文档和 Linear 等官方连接器 bundle 都是单独安装的包。安装前,插件页上看不到任何连接器信息。用户需要一个入口:列出所有官方连接器,能安装未安装的连接器,并能进入连接器自己的详情页,在那里连接账号。
决策
实验性可选的 “连接器”bundle 默认关闭,插件页在“实验性插件”下列出它。这个 bundle 不组合其他插件,所以 bundle 声明和标签页放在同一个包里:bundle 补丁插入本包自己的一行,这一行的浏览器入口通过 plugins.tab 注册“连接器”标签页。入口做成标签页而不是 bundle 详情页,是因为只有标签页的 owner props 带有 install,以及打开后能返回该标签页的 openPackage;从另一个 bundle 的详情页打开的页面,插件管理器不保留导航栈。
标签页和“发现”标签页一样使用插件页现有的能力,不改动插件页,也不改动共享的 bundle 名单。它自带连接器名单、每个连接器在所有随附语言中的名称和简介,以及品牌图标。profile 未持有的连接器显示安装,点击后把 <包名>@<DSH_CLIENT_VERSION> 交给插件页的安装对话框;已安装的连接器显示一个开关,标签页通过 pluginManager.setBundleEnabled 应用它,点这一行的其余位置会打开它的详情页。连接器包保持单独安装,不加入 ON_DEMAND_BUNDLES;撤掉实验后,所有连接器仍可用 dsh plugin add 安装。
已安装的连接器在“已安装”标签页中保留自己的卡片和开关,无论“连接器”bundle 是否开启都会运行;这个 bundle 只增加标签页。
考虑过的替代方案
不在“已安装”列表中显示连接器。 标签页成为连接器的唯一入口,每个连接器只出现一次。但这需要一份与插件页共享的连接器名单,还要在插件页的卡片列表中加过滤,一个实验性标签页就此改变了插件页显示的内容。现有名单也不适用:HIDDEN_BUNDLES 会连同承载账号区块的详情页一起移除,listedByDefault: false 仍会列出已安装的 bundle,MORE_BUNDLES 只适用于官方 bundle。
用一个开关停止所有连接器。 让每个连接器条目都注入同一个 Host 服务,这个 bundle 的开关就能停止和恢复所有连接器。这样一来,在任何 profile 中(包括没有插件页的 profile),连接器都只在一个实验性 bundle 开启时运行。条目上的条件(disabled: !!js)无法跟随这个开关,因为 Loader 只在挂载条目时求值;由插件页一并关闭连接器,则只覆盖插件页自己的开关,还会覆盖每个连接器自己的开关状态。
在每一行显示“已安装”列表的开关。 开关要先安装未安装的连接器再开启它,这需要在插件页新增一个组件工厂插槽和一条“安装后开启”的路径。标签页自己的开关通过 pluginManager.setBundleEnabled 处理已安装的连接器,不需要这两项;新安装的连接器由安装对话框的立即启用开启。
把连接器加入官方按需目录。 目录能离线提供元数据、安装前的详情页和开发环境的 link: 安装;但它会让每个连接器都成为必须带图标的官方目录成员,而且除非再额外隐藏,未安装的连接器会出现在插件页自己的分组里。
在“连接器”bundle 卡片的详情页上展示。 plugins.bundle.config 页面无法安装未安装的连接器,从它打开的连接器详情页会返回主列表,而且 bundle 自己的子行和来源区块始终显示在内容下方。
后果
从标签页安装要求连接器包已按当前 DSH 版本发布;开发构建改用 dsh plugin add 安装连接器。已安装的连接器同时出现在“已安装”标签页和“连接器”标签页中;选择立即启用后,连接器提供的引导显示在“已安装”标签页中。在“连接器”标签页中用开关开启连接器时,不显示账号引导和重启提示,也不发送 plugin_toggle 事件;连接器在“已安装”标签页中卡片上的开关这三项都有。新增官方连接器时,要把包名、名称、简介和图标加入标签页;没有检查比对这些文案和连接器自身的文案。标签页不显示账号连接状态,连接状态在连接器的详情页查看。