@chatcode/cco-better-sidebar 0.18.0-rc.7 → 0.18.0-rc.8
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/README.md +1 -1
- package/README_EN.md +1 -1
- package/lib/client-editor.js +264 -264
- package/lib/client-mermaid.js +264 -264
- package/lib/client-registry.js +410 -412
- package/lib/client-terminal.js +260 -260
- package/lib/client.js +412 -414
- package/package.json +1 -1
- package/src/client/ui-tweaks/branding.tsx +11 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chatcode/cco-better-sidebar",
|
|
3
|
-
"version": "0.18.0-rc.
|
|
3
|
+
"version": "0.18.0-rc.8",
|
|
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": {
|
|
@@ -173,17 +173,18 @@ function syncVersionNotice(): void {
|
|
|
173
173
|
dialog.setAttribute('aria-label', notice.title)
|
|
174
174
|
dialog.setAttribute(VERSION_NOTICE_MARKER, '')
|
|
175
175
|
dialog.dataset.dutVersionNoticeLanguage = language
|
|
176
|
-
if (heading !== null) heading.textContent = notice.title
|
|
176
|
+
if (heading !== null && heading.textContent !== notice.title) heading.textContent = notice.title
|
|
177
177
|
const paragraphs = dialog.querySelectorAll<HTMLParagraphElement>('p')
|
|
178
178
|
notice.paragraphs.forEach((text, index) => {
|
|
179
179
|
const paragraph = paragraphs.item(index)
|
|
180
|
-
if (paragraph !== null) paragraph.textContent = text
|
|
180
|
+
if (paragraph !== null && paragraph.textContent !== text) paragraph.textContent = text
|
|
181
181
|
})
|
|
182
182
|
})
|
|
183
183
|
}
|
|
184
184
|
|
|
185
185
|
function syncBranding(): void {
|
|
186
|
-
|
|
186
|
+
const title = document.title.replace(LEGACY_HOST_BRAND_TEXT, PROJECT_NAME)
|
|
187
|
+
if (title !== document.title) document.title = title
|
|
187
188
|
|
|
188
189
|
// The host deliberately renders the blank-session preview badge as a
|
|
189
190
|
// third headline column. ChatCode is the production identity here, so
|
|
@@ -208,17 +209,14 @@ function syncBranding(): void {
|
|
|
208
209
|
})
|
|
209
210
|
})
|
|
210
211
|
|
|
211
|
-
const
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
node.data = node.data.replace(LEGACY_HOST_BRAND_TEXT, PROJECT_NAME)
|
|
219
|
-
LEGACY_HOST_BRAND_TEXT.lastIndex = 0
|
|
212
|
+
for (const surface of document.querySelectorAll(BRAND_SURFACE)) {
|
|
213
|
+
const walker = document.createTreeWalker(surface, NodeFilter.SHOW_TEXT)
|
|
214
|
+
let node: Text | null
|
|
215
|
+
while ((node = walker.nextNode() as Text | null) !== null) {
|
|
216
|
+
if (node.parentElement?.closest(USER_CONTENT) !== null) continue
|
|
217
|
+
const next = node.data.replace(LEGACY_HOST_BRAND_TEXT, PROJECT_NAME).replace(HERO_HEADLINE, PROJECT_NAME)
|
|
218
|
+
if (next !== node.data) node.data = next
|
|
220
219
|
}
|
|
221
|
-
if (HERO_HEADLINE.test(node.data)) node.data = node.data.replace(HERO_HEADLINE, PROJECT_NAME)
|
|
222
220
|
}
|
|
223
221
|
|
|
224
222
|
// Keep the product name in the sidebar, but use a more expressive headline
|