fix: give the merged settings its own locale namespace and section id

The merged plugin reused dsh-better-display's settings.section id and locale namespace (better-display). While the standalone display plugin is still installed, both registrations collide and the later one wins, so the settings title flips between Better Display and Better Chat depending on load order.

Use better-chat for both the section id and the locale namespace; the standalone plugin can no longer overwrite the merged section. README now states the standalone plugin must be removed while updating. Version 0.4.3.
This commit is contained in:
QQ 2026-11-12 22:26:40 +08:00
parent 6ed202f029
commit 3168c2a341
7 changed files with 42 additions and 11 deletions

View File

@ -1,5 +1,10 @@
# Changelog
## 0.4.3 — 2026-11-12
- 修复设置项标题在「Better Display / Better Chat」之间来回变的问题:合并后的插件此前复用了独立 dsh-better-display 的设置节 id(`better-display`)与 locale 命名空间(`better-display`),两个插件同时安装时后注册的会覆盖前者,标题随加载顺序翻转。现在改用独立的 `better-chat` 节 id 与 locale 命名空间,互不覆盖。
- 注意:README 已写明更新时必须同时从 profile 移除独立的 dsh-better-display,否则会同时出现两个设置节(以及两套阅读页注册)。
## 0.4.2 — 2026-11-12
- 设置页的 **Better Display** 选项栏改名为 **Better Chat**(中英文案同步)。

View File

@ -19,6 +19,11 @@ dsh plugin --profile desktop add git+https://git.qyhhh.top/DeepsSeekHarness/dsh-
The compiled `lib/` is committed, so installation needs no build step. Fully
restart DSH afterwards.
> If the standalone **dsh-better-display** is installed, remove it while updating
> this plugin: the reading view is now part of this package, and installing both
> registers two reader views and two settings sections (their titles overwrite
> each other).
## Feature 1: reading view (merged from dsh-better-display 0.3.12)
Adds a **阅读 / Reading** tab to the conversation: while a turn runs you see the

View File

@ -17,6 +17,10 @@ dsh plugin --profile desktop add git+https://git.qyhhh.top/DeepsSeekHarness/dsh-
编译好的 `lib/` 已提交,安装时不需要构建。装完彻底重启 DSH。
> 如果之前装过独立的 **dsh-better-display**,请在更新本插件的同时把它从 profile
> 移除:阅读视图已经并入本插件,两个都装会同时注册两套阅读页与设置节(设置项标题
> 也会互相覆盖)。
## 功能一:阅读视图(合并自 dsh-better-display 0.3.12)
给对话加一个 **阅读** 页签:执行时能看到步骤、思考与进度;整轮成功结束后把过程

View File

@ -53383,12 +53383,20 @@ ${trimmed}
}
};
}
/**
* Own locale namespace and settings-section id. The merged plugin used to reuse
* dsh-better-display's `better-display` id; while the standalone display plugin
* is still installed, the two registrations collided and the nav label flipped
* between "Better Display" and "Better Chat" depending on load order.
*/
const SETTINGS_LOCALE_NS = "better-chat";
const SETTINGS_SECTION_ID = "better-chat";
function installBetterDisplaySettings(ctx, prefs, chat) {
const locale = ctx.get?.("locale") ?? ctx.locale;
if (locale?.register) ctx.effect(() => locale.register("better-display", {
if (locale?.register) ctx.effect(() => locale.register(SETTINGS_LOCALE_NS, {
zh,
en
}), "dsh-better-display: settings copy");
}), "dsh-better-chat: settings copy");
const checkSkill = createSkillProbe(ctx);
const injected = () => ({
prefs,
@ -53399,10 +53407,10 @@ ${trimmed}
});
ctx.slots.inject("settings.section", () => ctx.slots.register({
name: "settings.section",
id: "better-display",
id: SETTINGS_SECTION_ID,
order: 40,
label: () => locale?.bind?.("better-display")?.("nav") || settingsCopyFor(languageTag(ctx)).nav,
locale: locale?.bind ? "better-display" : void 0,
label: () => locale?.bind?.(SETTINGS_LOCALE_NS)?.("nav") || settingsCopyFor(languageTag(ctx)).nav,
locale: locale?.bind ? SETTINGS_LOCALE_NS : void 0,
inject: injected
}, SettingsSection));
}

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "dsh-better-chat",
"version": "0.4.2",
"version": "0.4.3",
"description": "DSH 聊天增强插件:审批回车批准 / Esc 拒绝、权限 UI、插件商店更新,以及 reading view(合并自 dsh-better-display)",
"type": "module",
"license": "MIT",

View File

@ -51,10 +51,19 @@ function createSkillProbe(ctx: Context): SkillStatusProbe {
};
}
/**
* Own locale namespace and settings-section id. The merged plugin used to reuse
* dsh-better-display's `better-display` id; while the standalone display plugin
* is still installed, the two registrations collided and the nav label flipped
* between "Better Display" and "Better Chat" depending on load order.
*/
const SETTINGS_LOCALE_NS = 'better-chat'
const SETTINGS_SECTION_ID = 'better-chat'
export function installBetterDisplaySettings(ctx: Context, prefs: OpenPrefs, chat?: ChatPrefs): void {
const locale = (ctx.get?.('locale') ?? (ctx as unknown as { locale?: LocaleFace }).locale) as LocaleFace | undefined;
if (locale?.register) {
ctx.effect(() => locale.register!('better-display', { zh, en }), 'dsh-better-display: settings copy');
ctx.effect(() => locale.register!(SETTINGS_LOCALE_NS, { zh, en }), 'dsh-better-chat: settings copy');
}
const checkSkill = createSkillProbe(ctx);
const injected = (): BetterDisplaySettingsInjected => ({
@ -66,10 +75,10 @@ export function installBetterDisplaySettings(ctx: Context, prefs: OpenPrefs, cha
});
ctx.slots.inject('settings.section', () => ctx.slots.register({
name: 'settings.section',
id: 'better-display',
id: SETTINGS_SECTION_ID,
order: 40,
label: () => locale?.bind?.('better-display')?.('nav') || settingsCopyFor(languageTag(ctx)).nav,
locale: locale?.bind ? 'better-display' : undefined,
label: () => locale?.bind?.(SETTINGS_LOCALE_NS)?.('nav') || settingsCopyFor(languageTag(ctx)).nav,
locale: locale?.bind ? SETTINGS_LOCALE_NS : undefined,
inject: injected,
}, SettingsSection));
}