Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Align plugin publishing controls and unify tooltips https://github.com/siyuan-note/siyuan/issues/18354

Daniel66e8e07a2f1a
diff --git a/app/src/assets/scss/business/_config.scss b/app/src/assets/scss/business/_config.scss
index 4f1bdba0f2..f33f2dc5d2 100644
--- a/app/src/assets/scss/business/_config.scss
+++ b/app/src/assets/scss/business/_config.scss
@@ -608,10 +608,13 @@
&__publish-switch {
display: inline-flex;
+ align-items: center;
}
- &__publish-data {
+ &__publish-controls {
display: inline-flex;
+ align-items: center;
+ gap: 4px;
vertical-align: middle;
}
diff --git a/app/src/assets/scss/main/_mobile.scss b/app/src/assets/scss/main/_mobile.scss
index 1f5a9369b2..f4d814aa48 100644
--- a/app/src/assets/scss/main/_mobile.scss
+++ b/app/src/assets/scss/main/_mobile.scss
@@ -1112,7 +1112,7 @@ body.mobile-topbar--merged {
padding: 4px 8px 8px 12px;
width: 100%;
- > .config-bazaar__publish-switch {
+ > .config-bazaar__publish-controls {
margin-right: auto;
}
}
diff --git a/app/src/config/bazaar.ts b/app/src/config/bazaar.ts
index b554ff33d5..ee86f318a7 100644
--- a/app/src/config/bazaar.ts
+++ b/app/src/config/bazaar.ts
@@ -823,12 +823,12 @@ ${primaryAction ? '<div class="fn__hr"></div>' : ""}
const hasSetting = plugin ? hasPluginSetting(plugin) : false;
const showPublishSwitch = bazaarType === "plugins" && window.siyuan.config.publish.enable;
const publishEnabled = isBazaarPluginEnabledInPublish(bazaarItem);
- const publishSwitchHTML = showPublishSwitch ? `<label data-type="plugin-publish-enable-label" class="config-bazaar__publish-switch" title="${escapeAttr(bazaarItem.disabledInPublish ? window.siyuan.languages.pluginDisabledInPublishTip : window.siyuan.languages.publishService)}">
+ const publishSwitchHTML = showPublishSwitch ? `<span class="config-bazaar__publish-controls"><label data-type="plugin-publish-enable-label" class="config-bazaar__publish-switch ariaLabel" data-position="north" aria-label="${escapeAttr(bazaarItem.disabledInPublish ? window.siyuan.languages.pluginDisabledInPublishTip : window.siyuan.languages.publishService)}">
<input data-type="plugin-publish-enable" data-position="north" class="b3-switch fn__flex-center" type="checkbox"${publishEnabled ? " checked" : ""}${bazaarItem.disabledInPublish ? " disabled" : ""}>
<span class="fn__space--small"></span>
<span class="fn__flex-center ft__on-surface">${window.siyuan.languages.publishService}</span>
</label>
- <button type="button" data-type="plugin-publish-data" class="block__icon block__icon--show config-bazaar__publish-data ariaLabel" data-position="north" aria-label="${escapeAttr(window.siyuan.languages.pluginPublishDataTip)}"><svg aria-hidden="true"><use xlink:href="#iconUpload"></use></svg></button>` : "";
+ ${bazaarItem.disabledInPublish ? "" : `<button type="button" data-type="plugin-publish-data" class="block__icon block__icon--show ariaLabel" data-position="north" aria-label="${escapeAttr(window.siyuan.languages.pluginPublishDataTip)}"><svg aria-hidden="true"><use xlink:href="#iconUpload"></use></svg></button>`}</span>` : "";
const available = bazaar._getUpdatedItem(bazaarType, bazaarItem.name)?.available;
const ratingKey = getRatingKey(bazaarType, bazaarItem.name);
return `<div data-name="${escapeAttr(bazaarItem.name)}" data-package-type="${bazaarType}" data-package-source="downloaded" class="b3-card${bazaarItem.current ? " b3-card--current" : ""}">
diff --git a/docs/PLUGIN-PUBLISH.md b/docs/PLUGIN-PUBLISH.md
index d654a94c05..ef2ac2e125 100644
--- a/docs/PLUGIN-PUBLISH.md
+++ b/docs/PLUGIN-PUBLISH.md
@@ -15,7 +15,7 @@ Data authorization is accessed through the upload icon button beside the plugin
| Action | Provided by | Interface and behavior |
| --- | --- | --- |
| Enable the publishing service | SiYuan | Enable the service in settings; downloaded plugin cards then show the per-plugin **Publish service** switch and **Plugin published data** button |
-| Allow plugin publishing | SiYuan | The card's **Publish service** switch controls whether the plugin can be published; the switch is disabled when the author prohibits publishing |
+| Allow plugin publishing | SiYuan | The card's **Publish service** switch controls whether the plugin can be published; when the author prohibits publishing, the switch is disabled and the data authorization icon button is hidden |
| Grant or revoke data access | SiYuan | The **Plugin published data** dialog shows the package name, declared fields, and grant or revocation information, with **Cancel** and **Confirm** buttons |
| Generate or update public data | Plugin | The plugin provides an action or documented automatic updates in the administrator environment; SiYuan has no shared generate-snapshot button |
| Display public content and read status | Plugin | The plugin displays content and handles missing authorization, missing snapshots, and read failures; SiYuan returns corresponding API errors rather than rendering a shared plugin content area |
diff --git a/docs/PLUGIN-PUBLISH.zh-CN.md b/docs/PLUGIN-PUBLISH.zh-CN.md
index 474fc6ddba..dd9e2e2879 100644
--- a/docs/PLUGIN-PUBLISH.zh-CN.md
+++ b/docs/PLUGIN-PUBLISH.zh-CN.md
@@ -15,7 +15,7 @@
| 操作 | 提供方 | 界面与行为 |
| --- | --- | --- |
| 启用发布服务 | 思源 | 在设置中开启发布服务;开启后,已下载插件卡片显示插件的「发布服务」开关和「插件发布数据」按钮 |
-| 允许插件发布 | 思源 | 插件卡片的「发布服务」开关控制该插件是否可用于发布;作者禁止发布时,开关不可操作 |
+| 允许插件发布 | 思源 | 插件卡片的「发布服务」开关控制该插件是否可用于发布;作者禁止发布时,开关不可操作,数据授权图标按钮不显示 |
| 授权或撤销数据 | 思源 | 「插件发布数据」弹窗展示插件包名、声明字段和授权或撤销说明,提供「取消」「确定」按钮 |
| 生成、更新公开数据 | 插件 | 插件提供操作入口,或在管理员环境中按其说明自动更新;思源没有统一的「生成快照」按钮 |
| 展示公开内容和读取状态 | 插件 | 插件在发布页面显示内容,并处理未授权、尚未生成和读取失败;思源接口提供对应错误,不统一绘制插件内容区 |