@chatcode/cco-better-sidebar 0.18.0-alpha.3 → 0.18.0-rc.11
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 +24 -5
- package/README_EN.md +24 -5
- package/cordis.patch.yml +6 -5
- package/lib/client-editor.js +10919 -362
- package/lib/client-mermaid.js +10810 -275
- package/lib/client-registry.js +3760 -2145
- package/lib/client-terminal.js +402 -261
- package/lib/client.js +3758 -2143
- package/lib/index.js +264 -46
- package/lib/types/client/LogoutConfirmDialog.d.ts +5 -0
- package/lib/types/client/PluginMarketSettingsSection.d.ts +7 -0
- package/lib/types/client/PluginMarketView.d.ts +7 -0
- package/lib/types/client/PluginProjectPicker.d.ts +13 -0
- package/lib/types/client/api.d.ts +17 -0
- package/lib/types/client/builtins/tabs.d.ts +13 -1
- package/lib/types/client/icons.d.ts +26 -8
- package/lib/types/client/locales.d.ts +39 -0
- package/lib/types/client/plugin-market-catalog.d.ts +25 -0
- package/lib/types/client/service.d.ts +1 -1
- package/lib/types/client/ui-tweaks/archive.d.ts +3 -7
- package/lib/types/client/ui-tweaks/branding.d.ts +1 -1
- package/lib/types/client/ui-tweaks/index.d.ts +3 -3
- package/lib/types/client/ui-tweaks/sidebar-header.d.ts +6 -0
- package/lib/types/client/ui-tweaks/typography.d.ts +9 -0
- package/lib/types/config.d.ts +4 -3
- package/lib/types/context-types.d.ts +12 -14
- package/lib/types/login-page-script.d.ts +2 -0
- package/lib/types/login-route.d.ts +2 -0
- package/lib/types/plugin-market-api.d.ts +5 -0
- package/lib/types/plugin-market-shared.d.ts +59 -0
- package/lib/types/prefs-shared.d.ts +1 -1
- package/lib/types/pty-deps.d.ts +1 -1
- package/lib/types/ui-tweaks/config.d.ts +6 -7
- package/lib/types/ui-tweaks/index.d.ts +2 -3
- package/package.json +4 -3
- package/src/client/AccountMenu.tsx +12 -2
- package/src/client/BrowserView.tsx +1 -1
- package/src/client/DiffTab.tsx +1 -1
- package/src/client/EditorHost.tsx +1 -1
- package/src/client/FileTree.tsx +10 -5
- package/src/client/FreeWindow.tsx +2 -1
- package/src/client/GitView.tsx +7 -3
- package/src/client/LogoutConfirmDialog.tsx +39 -0
- package/src/client/PluginMarketSettingsSection.tsx +55 -0
- package/src/client/PluginMarketView.module.css +50 -0
- package/src/client/PluginMarketView.tsx +243 -0
- package/src/client/PluginProjectPicker.tsx +73 -0
- package/src/client/SideCardSection.tsx +2 -23
- package/src/client/Sidebar.tsx +2 -2
- package/src/client/TabBar.tsx +2 -4
- package/src/client/TextEditor.tsx +2 -1
- package/src/client/TreePanel.tsx +1 -2
- package/src/client/UsageHeatmapSection.tsx +1 -1
- package/src/client/api.ts +9 -0
- package/src/client/builtins/tabs.tsx +25 -5
- package/src/client/builtins/viewers.tsx +2 -1
- package/src/client/icons.tsx +57 -4
- package/src/client/index.tsx +10 -1
- package/src/client/intercept.tsx +1 -1
- package/src/client/locales-ja.ts +39 -0
- package/src/client/locales.ts +118 -1
- package/src/client/md-toc.tsx +1 -1
- package/src/client/mermaid.tsx +2 -1
- package/src/client/open-with-settings.tsx +1 -1
- package/src/client/plugin-market-catalog.ts +90 -0
- package/src/client/service.ts +1 -1
- package/src/client/sidebar.module.css +81 -19
- package/src/client/ui-tweaks/archive.tsx +6 -56
- package/src/client/ui-tweaks/branding.tsx +80 -28
- package/src/client/ui-tweaks/index.tsx +45 -108
- package/src/client/ui-tweaks/sidebar-header.ts +73 -0
- package/src/client/ui-tweaks/typography.ts +38 -0
- package/src/config.ts +22 -2
- package/src/context-types.ts +5 -15
- package/src/index.ts +24 -20
- package/src/login-page-script.ts +107 -0
- package/src/login-route.ts +7 -4
- package/src/plugin-market-api.ts +88 -0
- package/src/plugin-market-shared.ts +30 -0
- package/src/prefs-shared.ts +1 -1
- package/src/pty-deps.ts +2 -2
- package/src/ui-tweaks/config.ts +12 -12
- package/src/ui-tweaks/index.ts +7 -13
package/src/ui-tweaks/config.ts
CHANGED
|
@@ -14,7 +14,7 @@ import type { SettingsNamespace } from '@deepseek-ai/dsh-settings'
|
|
|
14
14
|
// `settingsNamespace()` was removed in DSH 0.1.2-alpha.2. Keep the opaque
|
|
15
15
|
// namespace type for source compatibility with older DSH declarations, while
|
|
16
16
|
// emitting the plain validated literal required by the current runtime.
|
|
17
|
-
export const UI_TWEAKS_SETTINGS_NAMESPACE = '
|
|
17
|
+
export const UI_TWEAKS_SETTINGS_NAMESPACE = 'better-sidebar' as SettingsNamespace
|
|
18
18
|
|
|
19
19
|
/** Raw user-facing configuration (partial inputs receive schema defaults). */
|
|
20
20
|
export interface UITweaksConfig {
|
|
@@ -29,10 +29,9 @@ export interface UITweaksConfig {
|
|
|
29
29
|
*/
|
|
30
30
|
codeFontScale?: number
|
|
31
31
|
/**
|
|
32
|
-
* Absolute code font size in px (8–32)
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* `codeFontScale` percentage, then to the stock default.
|
|
32
|
+
* Absolute code font size in px (8–32), default 13. Drives code blocks;
|
|
33
|
+
* inline code and small code follow proportionally. When unset, uses a non-default legacy
|
|
34
|
+
* `codeFontScale` percentage, otherwise 13px.
|
|
36
35
|
*/
|
|
37
36
|
codeFontSize?: number
|
|
38
37
|
/**
|
|
@@ -54,7 +53,7 @@ export interface UITweaksConfig {
|
|
|
54
53
|
gitBarEnabled?: boolean
|
|
55
54
|
/**
|
|
56
55
|
* Whether the Archive manager is shown: the "归档" Settings page that lists
|
|
57
|
-
* archived sessions and can restore
|
|
56
|
+
* archived sessions and can restore them. Off by
|
|
58
57
|
* default; users turn it on in Settings.
|
|
59
58
|
*/
|
|
60
59
|
archiveManagerEnabled?: boolean
|
|
@@ -114,7 +113,7 @@ export interface UITweaksConfig {
|
|
|
114
113
|
|
|
115
114
|
export const MIN_FONT_SIZE = 10
|
|
116
115
|
export const MAX_FONT_SIZE = 32
|
|
117
|
-
export const DEFAULT_FONT_SIZE =
|
|
116
|
+
export const DEFAULT_FONT_SIZE = 14
|
|
118
117
|
|
|
119
118
|
/** 16px matches the stock DSH vertical rhythm (message/block gaps, etc.). */
|
|
120
119
|
export const MIN_LINE_HEIGHT = 0
|
|
@@ -126,7 +125,7 @@ export const MIN_CODE_FONT_SCALE = 50
|
|
|
126
125
|
export const MAX_CODE_FONT_SCALE = 150
|
|
127
126
|
export const DEFAULT_CODE_FONT_SCALE = 81
|
|
128
127
|
|
|
129
|
-
/**
|
|
128
|
+
/** Default absolute code-block size, paired with 14px prose. */
|
|
130
129
|
export const MIN_CODE_FONT_SIZE = 8
|
|
131
130
|
export const MAX_CODE_FONT_SIZE = 32
|
|
132
131
|
export const DEFAULT_CODE_FONT_SIZE = 13
|
|
@@ -164,7 +163,7 @@ export const DEFAULT_NOTIFY_SOUND = false
|
|
|
164
163
|
|
|
165
164
|
/** Configuration schema with documented defaults. */
|
|
166
165
|
export const Config: Schema<UITweaksConfig> = z.object({
|
|
167
|
-
fontSize: z.number().min(10).max(32).default(
|
|
166
|
+
fontSize: z.number().min(10).max(32).default(DEFAULT_FONT_SIZE),
|
|
168
167
|
codeFontScale: z.number().min(MIN_CODE_FONT_SCALE).max(MAX_CODE_FONT_SCALE).default(DEFAULT_CODE_FONT_SCALE),
|
|
169
168
|
codeFontSize: z.number().min(MIN_CODE_FONT_SIZE).max(MAX_CODE_FONT_SIZE),
|
|
170
169
|
lineHeight: z.number().min(MIN_LINE_HEIGHT).max(MAX_LINE_HEIGHT).default(DEFAULT_LINE_HEIGHT),
|
|
@@ -229,11 +228,12 @@ export interface ResolvedUITweaksConfig {
|
|
|
229
228
|
export function resolveConfig(config: UITweaksConfig = {}): ResolvedUITweaksConfig {
|
|
230
229
|
const fontSize = config.fontSize ?? DEFAULT_FONT_SIZE
|
|
231
230
|
const codeFontScale = config.codeFontScale ?? DEFAULT_CODE_FONT_SCALE
|
|
232
|
-
//
|
|
233
|
-
// the legacy percentage at the resolved body size; otherwise stock.
|
|
231
|
+
// Explicit code sizing wins; the stock preference keeps readable 13px code.
|
|
234
232
|
const codeFontSize = typeof config.codeFontSize === 'number'
|
|
235
233
|
? Math.min(MAX_CODE_FONT_SIZE, Math.max(MIN_CODE_FONT_SIZE, config.codeFontSize))
|
|
236
|
-
:
|
|
234
|
+
: codeFontScale === DEFAULT_CODE_FONT_SCALE
|
|
235
|
+
? DEFAULT_CODE_FONT_SIZE
|
|
236
|
+
: Math.max(8, Math.round(fontSize * (13 / 16) * (codeFontScale / DEFAULT_CODE_FONT_SCALE)))
|
|
237
237
|
const lineHeight = config.lineHeight ?? DEFAULT_LINE_HEIGHT
|
|
238
238
|
const tableStyle = config.tableStyle ?? 'default'
|
|
239
239
|
const gitBarEnabled = config.gitBarEnabled ?? DEFAULT_GITBAR_ENABLED
|
package/src/ui-tweaks/index.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dsh-ui-tweaks — server half.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* conversation UI
|
|
6
|
-
* document directly (settings.yaml `ui-tweaks:` section). All rendering work
|
|
4
|
+
* Uses the owning sidebar entry's live settings so users can tune the
|
|
5
|
+
* conversation UI from the Settings panel. All rendering work
|
|
7
6
|
* happens in the browser bundle (`src/client`), which reads and writes this
|
|
8
7
|
* namespace through the same-origin route mounted here — the Web settings RPC
|
|
9
8
|
* only exposes a fixed allowlist of namespaces since rc.6, so a custom route is
|
|
@@ -12,11 +11,7 @@
|
|
|
12
11
|
*/
|
|
13
12
|
|
|
14
13
|
import type { Context } from '@deepseek-ai/cordis'
|
|
15
|
-
import {
|
|
16
|
-
UI_TWEAKS_SETTINGS_NAMESPACE,
|
|
17
|
-
Config,
|
|
18
|
-
type UITweaksConfig,
|
|
19
|
-
} from './config.ts'
|
|
14
|
+
import { UI_TWEAKS_SETTINGS_NAMESPACE, type UITweaksConfig } from './config.ts'
|
|
20
15
|
import { installTurnOutcomeProjection } from './turn-outcome.ts'
|
|
21
16
|
import { UITweaksWebBackend, installUITweaksWeb } from './web.ts'
|
|
22
17
|
import { GitBackend } from './git.ts'
|
|
@@ -30,10 +25,6 @@ export const name = 'dsh-ui-tweaks'
|
|
|
30
25
|
export const inject = ['settings']
|
|
31
26
|
|
|
32
27
|
export function apply(ctx: Context): void {
|
|
33
|
-
ctx.settings.register(UI_TWEAKS_SETTINGS_NAMESPACE, Config, {
|
|
34
|
-
applies: 'live',
|
|
35
|
-
})
|
|
36
|
-
|
|
37
28
|
// The task notifier classifies turn endings (completed / aborted / failed)
|
|
38
29
|
// through this session projection (same registration pattern as above).
|
|
39
30
|
installTurnOutcomeProjection(ctx)
|
|
@@ -44,7 +35,10 @@ export function apply(ctx: Context): void {
|
|
|
44
35
|
|
|
45
36
|
// The GitBar runs git in the session's working directory through these
|
|
46
37
|
// same-origin routes (sessions/llm are optional services, duck-typed).
|
|
47
|
-
const readConfig = (): UITweaksConfig =>
|
|
38
|
+
const readConfig = (): UITweaksConfig => {
|
|
39
|
+
const descriptor = ctx.settings.describe().find(candidate => candidate.ns === UI_TWEAKS_SETTINGS_NAMESPACE)
|
|
40
|
+
return descriptor?.value as UITweaksConfig | undefined ?? {}
|
|
41
|
+
}
|
|
48
42
|
installGitWeb(ctx, new GitBackend(ctx, readConfig))
|
|
49
43
|
|
|
50
44
|
// The Archive panel lists archived sessions and restores ("deletes") them
|