@chatcode/cco-better-sidebar 0.18.0-alpha.3 → 0.18.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chatcode/cco-better-sidebar",
3
- "version": "0.18.0-alpha.3",
3
+ "version": "0.18.0-alpha.4",
4
4
  "description": "ChatCode CLI Web plugin: a VS Code-like right sidebar (explorer / editor / terminal / git / browser), isolated per conversation session. Exposes a service for other plugins to register sidebar tabs and file viewers.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -8,7 +8,8 @@
8
8
  "url": "https://github.com/omdsh-dev/DSH-better-sidebar"
9
9
  },
10
10
  "publishConfig": {
11
- "access": "public"
11
+ "access": "public",
12
+ "registry": "https://registry.npmjs.org/"
12
13
  },
13
14
  "main": "lib/index.js",
14
15
  "types": "lib/types/index.d.ts",
@@ -28,12 +28,31 @@ declare module '@deepseek-ai/dsh-client-ui-slots' {
28
28
  export const PROJECT_LOGO_URL = '/_dsh/ui-tweaks/assets/logo.svg'
29
29
  const PROJECT_NAME = 'ChatCode CLI'
30
30
  const HERO_TITLE = '与世界,深一度对话'
31
- const LEGACY_HOST_BRAND_TEXT = /DSH\s*(?:Local\s*Build|本地构建)|ChatCode\s*CLI/giu
31
+ const LEGACY_HOST_BRAND_TEXT = /DSH\s*(?:Local\s*Build|本地构建)|DeepSeek\s*Harness|ChatCode\s*CLI/giu
32
32
  const HOST_BRAND_LABEL_TEXT = /^(?:DSH\s*(?:Local\s*Build|本地构建)|ChatCode\s*CLI)$/iu
33
33
  const HOST_BUILD_VERSION_TEXT = /^v?\d+\.\d+\.\d+(?:[-+][0-9a-z.-]+)*$/iu
34
34
  const HERO_HEADLINE = /探索未至之境/u
35
35
  const HERO_PREVIEW_TEXT = /^(?:预览版|Preview)$/iu
36
36
  const FAVICON_MARKER = 'data-dut-project-favicon'
37
+ const VERSION_NOTICE_MARKER = 'data-dut-version-notice'
38
+ const VERSION_NOTICE = {
39
+ en: {
40
+ legacyTitle: 'Internal Testing Notice',
41
+ title: 'Version Usage Notice',
42
+ paragraphs: [
43
+ 'ChatCode CLI is currently evolving rapidly, and its features and user experience will continue to improve. If you encounter any issues or have feedback or suggestions, please join our DingTalk group to share them.',
44
+ 'DingTalk group ID: 178730000511',
45
+ ],
46
+ },
47
+ zh: {
48
+ legacyTitle: '内测声明',
49
+ title: '版本使用声明',
50
+ paragraphs: [
51
+ 'ChatCode CLI 当前版本处于快速迭代阶段,相关功能与使用体验将持续优化。如您在使用过程中遇到问题,或有任何意见与建议,欢迎加入钉钉交流群反馈。',
52
+ '钉钉群号:178730000511',
53
+ ],
54
+ },
55
+ } as const
37
56
 
38
57
  /** Reusable rendering of the packaged project logo. */
39
58
  export function ProjectLogoIcon({ className = '' }: { className?: string }): ReactNode {
@@ -135,6 +154,30 @@ function hideVersionBesideBrandLabel(label: HTMLElement): void {
135
154
  }
136
155
  }
137
156
 
157
+ /** Replace the registry build's older upstream notice with ChatCode product copy. */
158
+ function syncVersionNotice(): void {
159
+ document.querySelectorAll<HTMLElement>(
160
+ `[role="dialog"][aria-label="${VERSION_NOTICE.zh.legacyTitle}"],`
161
+ + `[role="dialog"][aria-label="${VERSION_NOTICE.en.legacyTitle}"],`
162
+ + `[role="dialog"][${VERSION_NOTICE_MARKER}]`,
163
+ ).forEach((dialog) => {
164
+ const heading = dialog.querySelector<HTMLElement>('h1,h2,h3')
165
+ const legacyTitle = dialog.getAttribute('aria-label') ?? heading?.textContent?.trim()
166
+ const language = dialog.dataset.dutVersionNoticeLanguage === 'zh'
167
+ || legacyTitle === VERSION_NOTICE.zh.legacyTitle ? 'zh' : 'en'
168
+ const notice = VERSION_NOTICE[language]
169
+ dialog.setAttribute('aria-label', notice.title)
170
+ dialog.setAttribute(VERSION_NOTICE_MARKER, '')
171
+ dialog.dataset.dutVersionNoticeLanguage = language
172
+ if (heading !== null) heading.textContent = notice.title
173
+ const paragraphs = dialog.querySelectorAll<HTMLParagraphElement>('p')
174
+ notice.paragraphs.forEach((text, index) => {
175
+ const paragraph = paragraphs.item(index)
176
+ if (paragraph !== null) paragraph.textContent = text
177
+ })
178
+ })
179
+ }
180
+
138
181
  function syncBranding(): void {
139
182
  document.title = document.title.replace(LEGACY_HOST_BRAND_TEXT, PROJECT_NAME)
140
183
 
@@ -182,6 +225,8 @@ function syncBranding(): void {
182
225
  title.classList.add('dut-hero-title')
183
226
  })
184
227
 
228
+ syncVersionNotice()
229
+
185
230
  // Older host builds expose a brand-mark wrapper but no text-bearing sibling.
186
231
  document.querySelectorAll<HTMLElement>('[class*="brandMark"]').forEach((host) => {
187
232
  const svg = host.matches('svg') ? host : host.querySelector('svg')
@@ -1487,7 +1487,7 @@ export function apply(ctx: UITweaksClientContext): void {
1487
1487
  // packaged logo there rather than restyling the host's fallback FishLogo.
1488
1488
  ctx.slots.inject('conversation.hero.brand.mark', () => ctx.slots.register({
1489
1489
  name: 'conversation.hero.brand.mark',
1490
- priority: 10,
1490
+ priority: -10,
1491
1491
  }, HeroProjectLogo))
1492
1492
 
1493
1493
  // The sidebar renders this same slot in its expanded header and collapsed
@@ -1495,7 +1495,7 @@ export function apply(ctx: UITweaksClientContext): void {
1495
1495
  // from falling back to the host FishLogo after the sidebar is collapsed.
1496
1496
  ctx.slots.inject('sidebar.brand.mark', () => ctx.slots.register({
1497
1497
  name: 'sidebar.brand.mark',
1498
- priority: 10,
1498
+ priority: -10,
1499
1499
  }, SidebarProjectLogo))
1500
1500
 
1501
1501
  // Newer DSH hosts expose the expanded wordmark as its own slot. Owning it
@@ -1504,7 +1504,7 @@ export function apply(ctx: UITweaksClientContext): void {
1504
1504
  // path above.
1505
1505
  ctx.slots.inject('sidebar.brand.name', () => ctx.slots.register({
1506
1506
  name: 'sidebar.brand.name',
1507
- priority: 10,
1507
+ priority: -10,
1508
1508
  }, SidebarProjectName))
1509
1509
 
1510
1510
  // GitBar v3: the branch chip lives in the session header's action row