@chatcode/cco-better-sidebar 0.18.0-rc.7 → 0.18.1-rc.13.022-rc1

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.
Files changed (49) hide show
  1. package/README.md +20 -10
  2. package/README_EN.md +20 -10
  3. package/lib/client-editor.js +300 -299
  4. package/lib/client-mermaid.js +295 -296
  5. package/lib/client-registry.js +2124 -2086
  6. package/lib/client-terminal.js +298 -297
  7. package/lib/client.js +2124 -2086
  8. package/lib/index.js +28 -7
  9. package/lib/types/client/AccountMenu.d.ts +4 -1
  10. package/lib/types/client/ContextMenu.d.ts +15 -0
  11. package/lib/types/client/api.d.ts +4 -0
  12. package/lib/types/client/locales-ja.d.ts +25 -0
  13. package/lib/types/client/service.d.ts +1 -1
  14. package/lib/types/client/ui-tweaks/archive.d.ts +9 -28
  15. package/lib/types/client/ui-tweaks/branding.d.ts +1 -1
  16. package/lib/types/client/ui-tweaks/dom-text.d.ts +2 -0
  17. package/lib/types/client/ui-tweaks/index.d.ts +10 -0
  18. package/lib/types/client/ui-tweaks/notifier.d.ts +4 -2
  19. package/lib/types/client/useChatcodeAccount.d.ts +1 -0
  20. package/lib/types/ui-tweaks/config.d.ts +1 -1
  21. package/lib/types/ui-tweaks/turn-outcome.d.ts +1 -1
  22. package/package.json +84 -86
  23. package/src/client/AccountMenu.tsx +13 -17
  24. package/src/client/ContextMenu.tsx +22 -0
  25. package/src/client/FileTree.tsx +6 -13
  26. package/src/client/FreeWindow.tsx +4 -3
  27. package/src/client/GitView.tsx +8 -5
  28. package/src/client/SideCardSection.tsx +0 -15
  29. package/src/client/Sidebar.tsx +0 -3
  30. package/src/client/TabBar.tsx +5 -4
  31. package/src/client/api.ts +3 -0
  32. package/src/client/index.tsx +18 -40
  33. package/src/client/locales-ja.ts +26 -0
  34. package/src/client/service.ts +1 -1
  35. package/src/client/shell-presets.ts +1 -1
  36. package/src/client/sidebar.module.css +23 -13
  37. package/src/client/ui-tweaks/archive.tsx +118 -140
  38. package/src/client/ui-tweaks/branding.tsx +94 -35
  39. package/src/client/ui-tweaks/cachehit.tsx +24 -14
  40. package/src/client/ui-tweaks/dom-text.ts +12 -0
  41. package/src/client/ui-tweaks/index.tsx +84 -26
  42. package/src/client/ui-tweaks/notifier.ts +13 -12
  43. package/src/client/ui-tweaks/whale.tsx +1 -1
  44. package/src/client/useChatcodeAccount.ts +12 -2
  45. package/src/index.ts +10 -3
  46. package/src/ui-tweaks/config.ts +1 -1
  47. package/src/ui-tweaks/git.ts +1 -1
  48. package/src/ui-tweaks/turn-outcome.ts +3 -3
  49. package/src/ui-tweaks/web.ts +1 -0
@@ -1,16 +1,12 @@
1
1
  /**
2
2
  * Bottom-left account control.
3
3
  *
4
- * DSH's settings launcher is currently a closed host-shell surface, so this
5
- * component intentionally leaves its structure alone: it hides only the
6
- * lower-left launcher while mounted and invokes that exact native button for
7
- * the Settings menu item. This keeps the existing settings dialog and all
8
- * host-owned navigation behavior intact.
4
+ * The settings.launcher slot supplies the shell-owned open callback. The
5
+ * legacy DOM fallback is retained only for older embedders without that seat.
9
6
  */
10
7
  import { useEffect, useRef, useState } from 'react'
11
8
  import { api } from './api.ts'
12
9
  import { useChatcodeAccount } from './useChatcodeAccount.ts'
13
- import { redirectToChatcodeLogin } from './chatcode-login-route.ts'
14
10
  import { LogoutConfirmDialog } from './LogoutConfirmDialog.tsx'
15
11
  import { t } from './locales.ts'
16
12
  import css from './sidebar.module.css'
@@ -73,12 +69,12 @@ function logout(): void {
73
69
  window.location.assign('/')
74
70
  }
75
71
 
76
- export function AccountMenu(): JSX.Element {
72
+ export function AccountMenu({ openSettings: launchSettings, wide }: { openSettings?: () => void; wide?: boolean }): JSX.Element {
77
73
  const rootRef = useRef<HTMLDivElement>(null)
78
74
  const [open, setOpen] = useState(false)
79
75
  const [logoutTarget, setLogoutTarget] = useState<'chatcode' | 'browser'>()
80
76
  const [userName, setUserName] = useState('User')
81
- const { chatcode, busy, error, loginUrl, startLogin, logout: logoutChatcode } = useChatcodeAccount()
77
+ const { chatcode, busy, error, loginUrl, startLogin, logout: logoutChatcode, refresh } = useChatcodeAccount()
82
78
 
83
79
  useEffect(() => {
84
80
  let active = true
@@ -96,14 +92,11 @@ export function AccountMenu(): JSX.Element {
96
92
  return () => { document.removeEventListener('pointerdown', onPointerDown) }
97
93
  }, [])
98
94
 
99
- useEffect(() => {
100
- if (error === 'status') redirectToChatcodeLogin()
101
- }, [error])
102
-
103
95
  // The host has no slot for replacing this one closed-shell control. Keep
104
96
  // the original fully recoverable: its inline style is restored on disposal
105
97
  // and it remains the target invoked by our Settings menu item.
106
98
  useEffect(() => {
99
+ if (launchSettings !== undefined) return
107
100
  let current: HTMLButtonElement | undefined
108
101
  let originalStyle: string | undefined
109
102
  const sync = (): void => {
@@ -123,15 +116,18 @@ export function AccountMenu(): JSX.Element {
123
116
  observer.disconnect()
124
117
  if (current !== undefined && originalStyle !== undefined) current.style.cssText = originalStyle
125
118
  }
126
- }, [])
119
+ }, [launchSettings])
127
120
 
128
121
  const openSettings = (): void => {
129
122
  setOpen(false)
130
- nativeSettingsButton(rootRef.current)?.click()
123
+ if (launchSettings !== undefined) launchSettings()
124
+ else nativeSettingsButton(rootRef.current)?.click()
131
125
  }
132
126
 
133
127
  const chatcodeName = chatcode?.userName?.trim() || chatcode?.emailAddress?.trim() || userName
134
128
  const signedIn = chatcode?.validation === 'valid' && chatcode.expired !== true
129
+ // A persisted login attempt can have failed before this account validated successfully.
130
+ const showLoginFailure = !signedIn && (chatcode?.login?.state === 'failed' || chatcode?.login?.state === 'timed-out')
135
131
  // A saved credential remains usable for the next check when the company
136
132
  // network is unavailable. Do not turn that transient state into a login CTA.
137
133
  const hasChatcodeAccount = chatcode?.available === true && chatcode.configured === true
@@ -139,7 +135,7 @@ export function AccountMenu(): JSX.Element {
139
135
  && !(chatcode.configured === true && chatcode.validation === 'unavailable')
140
136
 
141
137
  return (
142
- <div ref={rootRef} className={css.accountMenu}>
138
+ <div ref={rootRef} className={css.accountMenu} data-settings-launcher={launchSettings === undefined ? undefined : ""} data-rail={wide === false ? "" : undefined}>
143
139
  {open && (
144
140
  <div className={css.accountDropdown} role="menu" aria-label={t('accountMenuLabel')}>
145
141
  <div className={css.accountDropdownHeader}>
@@ -153,7 +149,7 @@ export function AccountMenu(): JSX.Element {
153
149
  {t('accountMenuSettings')}
154
150
  </button>
155
151
  {error === 'operation' && <div role="alert" className={css.accountItem}>{t('accountMenuChatcodeError')}</div>}
156
- {(chatcode?.login?.state === 'failed' || chatcode?.login?.state === 'timed-out') && <div role="alert" className={css.accountItem}>{t('accountMenuChatcodeRetry')}</div>}
152
+ {showLoginFailure && <div role="alert" className={css.accountItem}>{t('accountMenuChatcodeRetry')}</div>}
157
153
  {loginUrl && <a data-dsh-external="true" className={css.accountItem} href={loginUrl} target="_blank" rel="noopener noreferrer" onClick={event => { event.stopPropagation() }}>{t('accountMenuChatcodeOpen')}</a>}
158
154
  {chatcode?.available === true && <>
159
155
  {canStartChatcodeLogin && <button type="button" role="menuitem" className={css.accountItem} disabled={busy} onClick={startLogin}>
@@ -174,7 +170,7 @@ export function AccountMenu(): JSX.Element {
174
170
  aria-expanded={open}
175
171
  aria-haspopup="menu"
176
172
  aria-label={t('accountMenuLabel')}
177
- onClick={() => { setOpen(value => !value) }}
173
+ onClick={() => { if (!open) refresh(); setOpen(value => !value) }}
178
174
  >
179
175
  <span className={css.accountAvatar}>{chatcodeName.slice(0, 1).toUpperCase()}</span>
180
176
  <span className={css.accountName}>{chatcodeName}</span>
@@ -0,0 +1,22 @@
1
+ import type { ComponentProps } from 'react'
2
+ import { Menu as HostMenu } from '@deepseek-ai/dsh-client-ui-primitives'
3
+
4
+ type Props = Omit<ComponentProps<typeof HostMenu>, 'anchorPoint' | 'getAnchorRect' | 'contextual'> & {
5
+ contextual?: boolean | undefined
6
+ anchorPoint?: { readonly x: number; readonly y: number } | undefined
7
+ }
8
+
9
+ /**
10
+ * Place menus at viewport coordinates: published hosts consume getAnchorRect,
11
+ * while the bundled host consumes anchorPoint.
12
+ */
13
+ export function ContextMenu({ anchorPoint, contextual, ...props }: Props) {
14
+ const positioning = {
15
+ anchorPoint,
16
+ contextual,
17
+ getAnchorRect: anchorPoint === undefined
18
+ ? undefined
19
+ : () => new DOMRect(anchorPoint.x, anchorPoint.y, 0, 0),
20
+ }
21
+ return <HostMenu {...props} {...positioning} />
22
+ }
@@ -23,13 +23,12 @@
23
23
  import { useCallback, useEffect, useRef, useState, type DragEvent, type MouseEvent, type ReactNode } from 'react'
24
24
  import { createPortal } from 'react-dom'
25
25
  import clsx from 'clsx'
26
- import { Menu, type MenuEntry, type MenuItem, writeClipboard } from '@deepseek-ai/dsh-client-ui-primitives'
26
+ import { type MenuEntry, type MenuItem, writeClipboard } from '@deepseek-ai/dsh-client-ui-primitives'
27
27
  import { SiCursor, SiZedindustries } from 'react-icons/si'
28
28
  import { VscFile, VscFolder, VscFolderOpened, VscLinkExternal, VscPin, VscPinned } from 'react-icons/vsc'
29
29
  import { api, downloadUrl, isOutsideWorkspaceMessage, type FsEntry } from './api.ts'
30
30
  import { FenceErrorNotice } from './FenceErrorNotice.tsx'
31
31
  import {
32
- IconChevronRightOutline14,
33
32
  IconCodeOutline16,
34
33
  IconCopyOutline16,
35
34
  IconDownloadOutline16,
@@ -42,6 +41,7 @@ import { relativeTo } from './paths.ts'
42
41
  import { t } from './locales.ts'
43
42
  import type { SidebarStore } from './state.ts'
44
43
  import { uploadItemsFromDrop, uploadItemsFromFiles, type UploadItem } from './upload.ts'
44
+ import { ContextMenu } from './ContextMenu.tsx'
45
45
  import css from './sidebar.module.css'
46
46
 
47
47
  interface LevelData {
@@ -429,15 +429,7 @@ export function FileTree(props: {
429
429
  ...(pinned.length > 0 ? [{ id: 'open-with-sep', type: 'separator' } as MenuEntry] : []),
430
430
  {
431
431
  id: 'open-with-menu',
432
- // The primitives Menu renders no chevron for submenu parents — the
433
- // trailing arrow is supplied inside the label (full-width flex row,
434
- // right-aligned), matching how the submenu rows right-align the pin.
435
- label: (
436
- <span className={css.openWithLabel}>
437
- <span className={css.openWithName}>{t('openWithMenu')}</span>
438
- <IconChevronRightOutline14 size={14} className={css.openWithChevron} aria-hidden />
439
- </span>
440
- ),
432
+ label: t('openWithMenu'),
441
433
  icon: <VscLinkExternal size={16} />,
442
434
  submenu,
443
435
  },
@@ -643,7 +635,7 @@ export function FileTree(props: {
643
635
  event.target.value = ''
644
636
  }}
645
637
  />
646
- <Menu
638
+ <ContextMenu
647
639
  open={rowMenu !== null}
648
640
  onClose={() => { setRowMenu(null) }}
649
641
  items={[
@@ -698,7 +690,8 @@ export function FileTree(props: {
698
690
  }}
699
691
  portal
700
692
  align="start"
701
- getAnchorRect={() => (rowMenu === null ? null : new DOMRect(rowMenu.x, rowMenu.y, 0, 0))}
693
+ contextual
694
+ anchorPoint={rowMenu ?? undefined}
702
695
  anchor={<span />}
703
696
  />
704
697
  </div>
@@ -16,11 +16,11 @@
16
16
  */
17
17
  import { useEffect, useRef, useState, type ReactNode } from 'react'
18
18
  import clsx from 'clsx'
19
- import { Menu } from '@deepseek-ai/dsh-client-ui-primitives'
20
19
  import { IconCloseFill14 } from './icons.tsx'
21
20
  import type { FloatWindow, SidebarTab } from './state.ts'
22
21
  import { FLOAT_MIN_H, FLOAT_MIN_W } from './state.ts'
23
22
  import { t } from './locales.ts'
23
+ import { ContextMenu } from './ContextMenu.tsx'
24
24
  import css from './sidebar.module.css'
25
25
 
26
26
  /** A drag's mutable bookkeeping (start geometry + the last applied values). */
@@ -267,7 +267,7 @@ export function FreeWindow(props: {
267
267
  >
268
268
  <IconCloseFill14 />
269
269
  </button>
270
- <Menu
270
+ <ContextMenu
271
271
  open={menu !== null}
272
272
  onClose={() => { setMenu(null) }}
273
273
  items={[
@@ -281,7 +281,8 @@ export function FreeWindow(props: {
281
281
  }}
282
282
  portal
283
283
  align="start"
284
- getAnchorRect={() => (menu === null ? null : new DOMRect(menu.x, menu.y, 0, 0))}
284
+ contextual
285
+ anchorPoint={menu ?? undefined}
285
286
  anchor={<span />}
286
287
  />
287
288
  </div>
@@ -10,7 +10,7 @@
10
10
  * file changes appear without a manual refresh.
11
11
  */
12
12
  import { useCallback, useEffect, useRef, useState, type MouseEvent, type ReactNode } from 'react'
13
- import { Button, Input, Menu, Modal, writeClipboard } from '@deepseek-ai/dsh-client-ui-primitives'
13
+ import { Button, Input, Modal, writeClipboard } from '@deepseek-ai/dsh-client-ui-primitives'
14
14
  import {
15
15
  IconBranchOutline16,
16
16
  IconCodeOutline16,
@@ -24,6 +24,7 @@ import { isWithinWorkspace, relativeTo } from './paths.ts'
24
24
  import { resolveSidebarPath } from './produced-files.ts'
25
25
  import { relativeTime, t } from './locales.ts'
26
26
  import type { SidebarStore, SidebarTab } from './state.ts'
27
+ import { ContextMenu } from './ContextMenu.tsx'
27
28
  import css from './sidebar.module.css'
28
29
 
29
30
  /** The XY status letters a row badge shows (X = index, Y = worktree). */
@@ -573,7 +574,7 @@ export function GitView(props: {
573
574
  The one shared file-row context menu, positioned at the right-click
574
575
  cursor (portal so the panel's overflow clip cannot crop it).
575
576
  */}
576
- <Menu
577
+ <ContextMenu
577
578
  open={fileMenu !== null}
578
579
  onClose={() => { setFileMenu(null) }}
579
580
  items={[
@@ -632,12 +633,13 @@ export function GitView(props: {
632
633
  }}
633
634
  portal
634
635
  align="start"
635
- getAnchorRect={() => (fileMenu === null ? null : new DOMRect(fileMenu.x, fileMenu.y, 0, 0))}
636
+ contextual
637
+ anchorPoint={fileMenu ?? undefined}
636
638
  anchor={<span />}
637
639
  />
638
640
 
639
641
  {/* The shared history-row context menu. */}
640
- <Menu
642
+ <ContextMenu
641
643
  open={historyMenu !== null}
642
644
  onClose={() => { setHistoryMenu(null) }}
643
645
  items={[
@@ -689,7 +691,8 @@ export function GitView(props: {
689
691
  }}
690
692
  portal
691
693
  align="start"
692
- getAnchorRect={() => (historyMenu === null ? null : new DOMRect(historyMenu.x, historyMenu.y, 0, 0))}
694
+ contextual
695
+ anchorPoint={historyMenu ?? undefined}
693
696
  anchor={<span />}
694
697
  />
695
698
 
@@ -59,11 +59,6 @@ import { api } from './api.ts'
59
59
  import { IconChevronDownOutline14, IconPlusOutline16, IconSettingsOutline16 } from './icons.tsx'
60
60
  import { parsePrefs } from './prefs.ts'
61
61
  import { AddPluginModal, type PluginKind } from './add-plugin-modal.tsx'
62
- import {
63
- CODING_PLAN_SELECTED_MODEL_KEY,
64
- CODING_PLAN_SETTINGS_ID,
65
- CodingPlanModelsSettings,
66
- } from './CodingPlanModelsSettings.tsx'
67
62
  import { t } from './locales.ts'
68
63
  import { parseDesktopEnv } from './desktop-env.ts'
69
64
  import { getShellPreset, getShellPresets } from './shell-presets.ts'
@@ -960,16 +955,6 @@ export function SideCardSection({ store, service }: SideCardSectionProps) {
960
955
  </div>
961
956
  </div>
962
957
 
963
- {/* CodingPlan lives in the established settings page rather than a
964
- separate sidebar tab. The catalogue itself is fetched/cached by the
965
- host, and its selected logical id persists in pluginSettings. */}
966
- <CodingPlanModelsSettings
967
- selectedModelId={typeof prefs.pluginSettings[CODING_PLAN_SETTINGS_ID]?.[CODING_PLAN_SELECTED_MODEL_KEY] === 'string'
968
- ? prefs.pluginSettings[CODING_PLAN_SETTINGS_ID]?.[CODING_PLAN_SELECTED_MODEL_KEY] as string
969
- : undefined}
970
- onSelect={(modelId) => { applyPluginSetting(CODING_PLAN_SETTINGS_ID, CODING_PLAN_SELECTED_MODEL_KEY, modelId) }}
971
- />
972
-
973
958
  {/* 侧边栏内容: one small card per registered tab type in a responsive
974
959
  grid; features declaring `settings.toggles` open their settings in
975
960
  the popup (gear corner button) instead of nested inline rows. */}
@@ -66,7 +66,6 @@ import { tabContentCompare, type TabContentMemoKey } from './tab-content-memo.ts
66
66
  import { t } from './locales.ts'
67
67
  import { useCurrentSessionId } from './current-session.ts'
68
68
  import { api, type SessionScope } from './api.ts'
69
- import { AccountMenu } from './AccountMenu.tsx'
70
69
  import css from './sidebar.module.css'
71
70
 
72
71
  /** How many consecutive reconnect failures stop the agent-terminals push loop
@@ -1386,7 +1385,6 @@ export function Sidebar(props: { ctx: Context; store: SidebarStore }) {
1386
1385
  // focus is the only way the existing Tooltip can explain what is missing.
1387
1386
  return (
1388
1387
  <div data-dsh-panel-host {...osFileDragShield}>
1389
- <AccountMenu />
1390
1388
  {nativeToolbarHost !== null ? createPortal(
1391
1389
  <div className={clsx(css.toggleCluster, css.toggleClusterNative)} data-dsh-toggle-cluster data-dsh-native-toolbar-cluster>
1392
1390
  {!narrow && (
@@ -1528,7 +1526,6 @@ export function Sidebar(props: { ctx: Context; store: SidebarStore }) {
1528
1526
 
1529
1527
  return (
1530
1528
  <div data-dsh-panel-host {...osFileDragShield}>
1531
- <AccountMenu />
1532
1529
  {/*
1533
1530
  Current DSH: all three controls live in the Session utilities row; the
1534
1531
  intercepted native rightbar glyph is hidden to leave one sidebar
@@ -10,12 +10,12 @@
10
10
  */
11
11
  import { useEffect, useRef, useState, type ReactNode } from 'react'
12
12
  import clsx from 'clsx'
13
- import { Menu } from '@deepseek-ai/dsh-client-ui-primitives'
14
13
  import type { SidebarTab } from './state.ts'
15
14
  import { isAgentTabId } from './state.ts'
16
15
  import { isPinnedVirtualTab } from './pinned.ts'
17
16
  import { IconCloseFill14, IconPinOutline16, IconPlusOutline16 } from './icons.tsx'
18
17
  import { t } from './locales.ts'
18
+ import { ContextMenu } from './ContextMenu.tsx'
19
19
  import css from './sidebar.module.css'
20
20
 
21
21
  /** One + menu option. */
@@ -249,7 +249,7 @@ export function TabBar(props: {
249
249
  right edge of the scrollport when the tabs overflow, so it stays
250
250
  reachable no matter how many tabs are open).
251
251
  */}
252
- <Menu
252
+ <ContextMenu
253
253
  open={menuOpen}
254
254
  onClose={() => { setMenuOpen(false) }}
255
255
  items={newTabOptions.map(option => ({
@@ -284,7 +284,7 @@ export function TabBar(props: {
284
284
  through the service and releases terminals), so the target tab is
285
285
  never closed and the pane never empties mid-loop.
286
286
  */}
287
- <Menu
287
+ <ContextMenu
288
288
  open={tabMenu !== null && tabMenuIndex >= 0}
289
289
  onClose={() => { setTabMenu(null) }}
290
290
  items={(() => {
@@ -354,7 +354,8 @@ export function TabBar(props: {
354
354
  }}
355
355
  portal
356
356
  align="start"
357
- getAnchorRect={() => (tabMenu === null ? null : new DOMRect(tabMenu.x, tabMenu.y, 0, 0))}
357
+ contextual
358
+ anchorPoint={tabMenu ?? undefined}
358
359
  anchor={<span />}
359
360
  />
360
361
  </div>
package/src/client/api.ts CHANGED
@@ -300,6 +300,9 @@ export const api = {
300
300
  chatcodeStart: () => call<{ sessionId: string; url: string }>('chatcode.start', {}),
301
301
  chatcodeCancel: (sessionId: string) => call<{ ok: true }>('chatcode.cancel', { sessionId }),
302
302
  chatcodeLogout: () => call<{ ok: true }>('chatcode.logout', {}),
303
+ /** The globally installed CLI version, read from npm global modules. */
304
+ chatcodeInstalledVersion: (signal?: AbortSignal) =>
305
+ call<{ version: string | null }>('chatcode.installed-version', {}, signal),
303
306
  /** Check both ChatCode packages (web + CLI) against the npm registry. */
304
307
  chatcodeUpdateCheck: (signal?: AbortSignal) =>
305
308
  call<{ packages: ChatCodeUpdateCheck[] }>('chatcode.update.check', {}, signal),
@@ -16,6 +16,7 @@ import { createBetterSidebarService, matchUrlTarget, SIDEBAR_SERVICE_VERSION } f
16
16
  import { revalidateChunksOnReactivate, setChunkModuleSystem } from './chunk-loader.ts'
17
17
  import { registerBuiltins } from './builtins/index.ts'
18
18
  import { Sidebar } from './Sidebar.tsx'
19
+ import { AccountMenu } from './AccountMenu.tsx'
19
20
  import { ChatcodeGate } from './ChatcodeGate.tsx'
20
21
  import { hasPriorSidebarInstall, ReleaseNotesDialog } from './ReleaseNotesDialog.tsx'
21
22
  import { RenderBoundary } from './RenderBoundary.tsx'
@@ -26,7 +27,7 @@ import {
26
27
  AI_RATIO_NAV_MARKER,
27
28
  GENERAL_NAV_MARKER,
28
29
  PLUGIN_MARKET_NAV_MARKER,
29
- registerSettingsNavIcon,
30
+ SETTINGS_NAV_MARKER,
30
31
  SKILL_MARKET_NAV_MARKER,
31
32
  UI_TWEAKS_NAV_MARKER,
32
33
  UPDATE_NAV_MARKER,
@@ -143,6 +144,10 @@ export function apply(ctx: Context): void {
143
144
  // then hands it to the mounted panel and closes over it in the slot
144
145
  // registrations (the official createXXXStore() factory rule — no
145
146
  // module-level singleton).
147
+ ctx.slots.inject('settings.launcher', () => ctx.slots.register({
148
+ name: 'settings.launcher', priority: -10,
149
+ }, AccountMenu))
150
+
146
151
  const sidebarStore = createSidebarStore()
147
152
  const pluginMarketCatalog = createPluginMarketCatalog()
148
153
  ctx.effect(() => {
@@ -448,45 +453,18 @@ export function apply(ctx: Context): void {
448
453
  'dsh-better-sidebar: IME composition guard',
449
454
  )
450
455
 
451
- // DSH 0.1.x does not yet carry an icon through the settings.section
452
- // registration contract: its shell renders a generic gear for every
453
- // external section. Mark only this plugin's localized nav row so
454
- // layout.css can paint the requested Side card SVG; the disposer clears
455
- // the marker for HMR / plugin disable.
456
- ctx.effect(
457
- () => registerSettingsNavIcon(() => t('settingsNav')),
458
- 'dsh-better-sidebar: settings navigation icon',
459
- )
460
- // Same adaptation for the "Token 用量" heatmap row, under its own marker
461
- // so the two registrations never strip each other's rows.
462
- ctx.effect(
463
- () => registerSettingsNavIcon(() => t('usageNav'), USAGE_NAV_MARKER),
464
- 'dsh-better-sidebar: usage settings navigation icon',
465
- )
466
- ctx.effect(
467
- () => registerSettingsNavIcon(() => t('aiRatioNav'), AI_RATIO_NAV_MARKER),
468
- 'dsh-better-sidebar: AI ratio settings navigation icon',
469
- )
470
- ctx.effect(
471
- () => registerSettingsNavIcon(() => t('updateNav'), UPDATE_NAV_MARKER),
472
- 'dsh-better-sidebar: update settings navigation icon',
473
- )
474
- ctx.effect(
475
- () => registerSettingsNavIcon(() => ['通用设置', 'General'], GENERAL_NAV_MARKER),
476
- 'dsh-better-sidebar: general settings navigation icon fallback',
477
- )
478
- ctx.effect(
479
- () => registerSettingsNavIcon(() => ['插件市场', 'Plugin marketplace', 'Plugin Market'], PLUGIN_MARKET_NAV_MARKER),
480
- 'dsh-better-sidebar: plugin market navigation icon fallback',
481
- )
482
- ctx.effect(
483
- () => registerSettingsNavIcon(() => ['界面调整', 'UI Tweaks'], UI_TWEAKS_NAV_MARKER),
484
- 'dsh-better-sidebar: UI tweaks navigation icon fallback',
485
- )
486
- ctx.effect(
487
- () => registerSettingsNavIcon(() => ['技能市场', 'Skill marketplace', 'Skill Market'], SKILL_MARKET_NAV_MARKER),
488
- 'dsh-better-sidebar: skill market navigation icon fallback',
489
- )
456
+ // The host owns navigation geometry; icons use the public section seat.
457
+ for (const [id, marker] of [
458
+ ['better-sidebar', SETTINGS_NAV_MARKER], ['better-sidebar-usage', USAGE_NAV_MARKER],
459
+ ['better-sidebar-ai-ratio', AI_RATIO_NAV_MARKER], ['better-sidebar-update', UPDATE_NAV_MARKER],
460
+ ['general', GENERAL_NAV_MARKER], ['market', PLUGIN_MARKET_NAV_MARKER],
461
+ ['ui-tweaks', UI_TWEAKS_NAV_MARKER], ['skill-market', SKILL_MARKET_NAV_MARKER],
462
+ ] as const) {
463
+ ctx.slots.inject('settings.section.icon', () => ctx.slots.register({
464
+ name: 'settings.section.icon', id, priority: -10,
465
+ }, () => createElement('span', { [marker]: '', 'aria-hidden': true,
466
+ style: { display: 'flex', width: 16, height: 16, flex: 'none' } })))
467
+ }
490
468
 
491
469
  registerPluginMarketSettings(ctx, pluginMarketCatalog)
492
470
 
@@ -14,6 +14,32 @@
14
14
  * - English brand names (VS Code, Cursor, Zed, SSH) stay as-is.
15
15
  */
16
16
 
17
+ /** Japanese archive-management copy registered under the ui-tweaks namespace. */
18
+ export const uiTweaksArchiveJa = {
19
+ archiveNav: 'アーカイブ',
20
+ archiveTitle: 'アーカイブ済みセッション',
21
+ archiveEmpty: 'アーカイブ済みセッションはありません。',
22
+ archiveRestore: '復元',
23
+ archiveRestoring: '処理中…',
24
+ archiveConfirmTitle: 'セッションを完全に削除しますか?',
25
+ archiveConfirmDescription: '所有するサブエージェントを含む {count} 件のセッション記録を完全に削除します。この操作は取り消せません。独立した分岐、ワークスペースのファイル、Git データは保持されます。',
26
+ archiveCancel: 'キャンセル',
27
+ archiveDelete: '削除',
28
+ archiveDeleteAll: 'すべて削除',
29
+ archiveSelectAll: 'すべて選択',
30
+ archiveSelectedCount: '{count} 件のセッションを選択中',
31
+ archiveClearSelection: '選択を解除',
32
+ archiveDeleteSelected: '選択したセッションを削除({count})',
33
+ archiveDeleteFailed: '「{title}」:{error}',
34
+ archiveRestoreAll: 'すべて復元',
35
+ archiveCount: '件のセッション',
36
+ archiveUnavailable: 'アーカイブを利用できません。',
37
+ archiveLiveError: 'このセッションは実行中です。完全に削除する前に閉じてください。',
38
+ archiveDisabledHint: 'アーカイブ管理は無効です。「UI 調整」で有効にすると、ここでアーカイブ済みセッションを復元または完全に削除できます。',
39
+ archiveEnable: 'アーカイブ管理を有効にする',
40
+ archiveRestored: '復元しました。',
41
+ } as const
42
+
17
43
  /** The ja dictionary (key-set-equal to zh, enforced by the type annotation in locales.ts). */
18
44
  export const ja: Record<string, string> = {
19
45
  pluginMarketTitle: 'プラグインマーケット',
@@ -472,7 +472,7 @@ export function matchUrlTarget(tabs: readonly TabDescriptor[], url: URL): TabDes
472
472
  * The plugin version this service instance reports. Keep in lockstep with
473
473
  * `package.json`'s version — `tests/service.spec.ts` asserts the pair.
474
474
  */
475
- export const SIDEBAR_SERVICE_VERSION = '0.18.0-alpha.4'
475
+ export const SIDEBAR_SERVICE_VERSION = '0.18.0-rc.13.022-rc1'
476
476
 
477
477
  /**
478
478
  * Monotonic capability list consumers use to gate new API usage (features
@@ -52,7 +52,7 @@ export interface ShellPreset {
52
52
  */
53
53
  const DSH_DESKTOP: ShellPreset = {
54
54
  id: 'dsh-desktop',
55
- title: 'DeepSeek Harness Desktop',
55
+ title: 'ChatCode CLI Desktop',
56
56
  desc: 'Electron 高级模式(无边框):macOS 顶栏 20px、Windows 无 WCO 时 32px 标题栏让位',
57
57
  stripFor: (env) => {
58
58
  if (env.mode !== 'advanced') return undefined
@@ -470,11 +470,12 @@
470
470
  flex: none;
471
471
  place-items: center;
472
472
  border-radius: 50%;
473
- background: var(--dsw-alias-bg-layer-3);
473
+ corner-shape: round;
474
+ background: var(--dsw-alias-bg-layer-2);
474
475
  border: 1px solid var(--dsw-alias-border-l2);
475
- color: var(--dsw-alias-fg-accent);
476
+ color: var(--dsw-alias-fg-base);
476
477
  font: var(--dsw-font-xxs-12);
477
- font-weight: 600;
478
+ font-weight: 400;
478
479
  }
479
480
 
480
481
  .accountName {
@@ -543,7 +544,7 @@
543
544
  }
544
545
 
545
546
  .accountTrigger .accountPresence {
546
- border-color: var(--dsw-alias-bg-layer-1);
547
+ display: none;
547
548
  }
548
549
 
549
550
  /* The native top layer is viewport-centered even though the account rail is positioned. */
@@ -3365,8 +3366,7 @@ body[data-dsh-sidebar-dragging] .bottomPanel {
3365
3366
 
3366
3367
  /* The file tree "open with" menu rows: the label area is a BLOCK-level flex
3367
3368
  row that fills the primitives `.itemLabel` span (which is itself `flex: 1`
3368
- inside the row), so the trailing control — the pushpin on submenu rows,
3369
- the chevron on the submenu parent — docks at the row's far right, exactly
3369
+ inside the row), so the pushpin on submenu rows docks at the far right, exactly
3370
3370
  like the trailing check on selected rows of every other menu. */
3371
3371
  .openWithLabel {
3372
3372
  display: flex;
@@ -3384,13 +3384,6 @@ body[data-dsh-sidebar-dragging] .bottomPanel {
3384
3384
  white-space: nowrap;
3385
3385
  }
3386
3386
 
3387
- /* The trailing "expands into a submenu" chevron on the open-with parent row
3388
- (the primitives Menu renders no arrow for submenu parents). */
3389
- .openWithChevron {
3390
- flex: none;
3391
- color: var(--dsw-alias-label-tertiary);
3392
- }
3393
-
3394
3387
  /* The pushpin toggle on an "open with" submenu row: brand ink once the
3395
3388
  target is pinned to the menu's top level. */
3396
3389
  .openWithPin {
@@ -3667,3 +3660,20 @@ body[data-dsh-sidebar-dragging] .bottomPanel {
3667
3660
  .chatcodeGateActions { align-items: stretch; flex-direction: column; }
3668
3661
  .chatcodeGateActions button, .chatcodeGateCard a { justify-content: center; }
3669
3662
  }
3663
+
3664
+ /* Native settings seat owns the rail geometry and the Settings callback. */
3665
+ .accountMenu[data-settings-launcher] {
3666
+ position: relative;
3667
+ width: 100%;
3668
+ border: 0;
3669
+ }
3670
+ .accountMenu[data-settings-launcher]:not([data-rail]) {
3671
+ /* Continue through the rail's side inset, 6px bottom padding and 4px launcher margin. */
3672
+ width: calc(100% + 2 * var(--dsh-sidebar-inline-padding, 8px));
3673
+ margin-inline: calc(-1 * var(--dsh-sidebar-inline-padding, 8px));
3674
+ margin-bottom: -10px;
3675
+ border-top: 1px solid var(--dsw-alias-border-l2);
3676
+ }
3677
+ .accountMenu[data-settings-launcher][data-rail] .accountName {
3678
+ display: none;
3679
+ }