@chatcode/cco-better-sidebar 0.18.0-alpha.4 → 0.18.0-rc.12
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 +30 -9
- package/README_EN.md +30 -9
- package/cordis.patch.yml +6 -5
- package/lib/client-editor.js +10954 -395
- package/lib/client-mermaid.js +10835 -300
- package/lib/client-registry.js +4035 -2215
- package/lib/client-terminal.js +435 -292
- package/lib/client.js +4035 -2215
- package/lib/index.js +282 -47
- 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 +21 -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-ja.d.ts +25 -0
- 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 +9 -28
- package/lib/types/client/ui-tweaks/branding.d.ts +1 -1
- package/lib/types/client/ui-tweaks/dom-text.d.ts +2 -0
- package/lib/types/client/ui-tweaks/index.d.ts +9 -1
- 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 +2 -2
- 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 +12 -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 +65 -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 +118 -140
- package/src/client/ui-tweaks/branding.tsx +117 -49
- package/src/client/ui-tweaks/cachehit.tsx +24 -14
- package/src/client/ui-tweaks/dom-text.ts +12 -0
- package/src/client/ui-tweaks/index.tsx +75 -103
- 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 +28 -21
- 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
|
@@ -22,8 +22,47 @@
|
|
|
22
22
|
*/
|
|
23
23
|
/** The zh dictionary (also registered into the ChatCode CLI locale registry under {@link LOCALE_NS}). */
|
|
24
24
|
export declare const zh: {
|
|
25
|
+
pluginMarketTitle: string;
|
|
26
|
+
pluginMarketProjectDirectory: string;
|
|
27
|
+
pluginMarketInstalledTab: string;
|
|
28
|
+
pluginMarketRefresh: string;
|
|
29
|
+
pluginMarketLoading: string;
|
|
30
|
+
pluginMarketRefreshing: string;
|
|
31
|
+
pluginMarketEmpty: string;
|
|
32
|
+
pluginMarketBack: string;
|
|
33
|
+
pluginMarketInstall: string;
|
|
34
|
+
pluginMarketUninstall: string;
|
|
35
|
+
pluginMarketProject: string;
|
|
36
|
+
pluginMarketUser: string;
|
|
37
|
+
pluginMarketInstalled: string;
|
|
38
|
+
pluginMarketUninstalled: string;
|
|
39
|
+
pluginMarketSubtitle: string;
|
|
40
|
+
pluginMarketChooseProject: string;
|
|
41
|
+
pluginMarketProjectHint: string;
|
|
42
|
+
pluginMarketChoosingDirectory: string;
|
|
43
|
+
pluginMarketAwaitingConfirmation: string;
|
|
44
|
+
pluginMarketConfirmProjectInstall: string;
|
|
45
|
+
pluginMarketConfirmProjectDescription: string;
|
|
46
|
+
pluginMarketConfirmInstall: string;
|
|
47
|
+
pluginMarketInstalledAt: string;
|
|
48
|
+
pluginMarketInstallPath: string;
|
|
49
|
+
pluginMarketDirectoryPath: string;
|
|
50
|
+
pluginMarketOpenDirectory: string;
|
|
51
|
+
pluginMarketSelectDirectory: string;
|
|
52
|
+
pluginMarketHomeDirectory: string;
|
|
53
|
+
pluginMarketDirectoryTruncated: string;
|
|
54
|
+
pluginMarketSearch: string;
|
|
55
|
+
pluginMarketDefault: string;
|
|
56
|
+
pluginMarketBrowse: string;
|
|
57
|
+
pluginMarketNoDescription: string;
|
|
58
|
+
pluginMarketInstalling: string;
|
|
59
|
+
pluginMarketUninstalling: string;
|
|
60
|
+
pluginMarketInstallProgress: string;
|
|
61
|
+
pluginMarketUninstallProgress: string;
|
|
25
62
|
accountMenuSettings: string;
|
|
26
63
|
accountMenuLogout: string;
|
|
64
|
+
accountMenuLogoutConfirmTitle: string;
|
|
65
|
+
accountMenuLogoutConfirmDescription: string;
|
|
27
66
|
accountMenuLabel: string;
|
|
28
67
|
updateMenu: string;
|
|
29
68
|
updateNav: string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { MarketplaceCatalog, MarketplacePlugin } from '../plugin-market-shared.ts';
|
|
2
|
+
interface Entry<T> {
|
|
3
|
+
readonly status: 'loading' | 'ready' | 'error';
|
|
4
|
+
readonly data?: T;
|
|
5
|
+
readonly error?: string;
|
|
6
|
+
readonly warning?: string;
|
|
7
|
+
}
|
|
8
|
+
interface Snapshot {
|
|
9
|
+
readonly markets?: Entry<MarketplaceCatalog>;
|
|
10
|
+
readonly plugins: Readonly<Record<string, Entry<MarketplacePlugin[]>>>;
|
|
11
|
+
readonly refresh?: {
|
|
12
|
+
readonly status: 'loading' | 'ready' | 'error';
|
|
13
|
+
readonly error?: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export interface PluginMarketCatalog {
|
|
17
|
+
subscribe(listener: () => void): () => void;
|
|
18
|
+
getSnapshot(): Snapshot;
|
|
19
|
+
start(): void;
|
|
20
|
+
ensure(marketplaceId: string): void;
|
|
21
|
+
refresh(marketplaceId?: string): void;
|
|
22
|
+
dispose(): void;
|
|
23
|
+
}
|
|
24
|
+
export declare function createPluginMarketCatalog(): PluginMarketCatalog;
|
|
25
|
+
export {};
|
|
@@ -418,7 +418,7 @@ export declare function matchUrlTarget(tabs: readonly TabDescriptor[], url: URL)
|
|
|
418
418
|
* The plugin version this service instance reports. Keep in lockstep with
|
|
419
419
|
* `package.json`'s version — `tests/service.spec.ts` asserts the pair.
|
|
420
420
|
*/
|
|
421
|
-
export declare const SIDEBAR_SERVICE_VERSION = "0.18.0-alpha.
|
|
421
|
+
export declare const SIDEBAR_SERVICE_VERSION = "0.18.0-alpha.4";
|
|
422
422
|
/**
|
|
423
423
|
* Monotonic capability list consumers use to gate new API usage (features
|
|
424
424
|
* are never removed). Each string names a v0.12.0+ capability:
|
|
@@ -1,42 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
* dsh-ui-tweaks — Archive manager (browser half).
|
|
3
|
-
*
|
|
4
|
-
* Renders the "归档" settings section (shown in the Settings dialog; usable
|
|
5
|
-
* when the `archiveManagerEnabled` toggle in 界面调整 is on — otherwise it
|
|
6
|
-
* shows an invite card with a one-click enable). The section lists every
|
|
7
|
-
* archived session — enriched from the framework `useSessions` /
|
|
8
|
-
* `useWorkspaces` feeds — with per-row actions and batch actions that go
|
|
9
|
-
* through the same-origin archive route (`/_dsh/ui-tweaks/archive`):
|
|
10
|
-
*
|
|
11
|
-
* - **恢复** (Restore): remove the session from the archive set — its log and
|
|
12
|
-
* workspace slot are kept, so the conversation reappears in the normal
|
|
13
|
-
* sidebar list.
|
|
14
|
-
* - **删除** (Delete): PERMANENTLY delete the session — the server removes its
|
|
15
|
-
* durable log, workspace accounting, archive-set entry and caches; the list
|
|
16
|
-
* then refreshes so the row (and the session itself) disappear.
|
|
17
|
-
* - **全部恢复 / 全部删除**: the same actions for every archived session.
|
|
18
|
-
*
|
|
19
|
-
* Live (open/running) sessions are refused by the server; the client maps the
|
|
20
|
-
* `session-live` error code to localized copy.
|
|
21
|
-
* @module dsh-ui-tweaks/client/archive
|
|
22
|
-
*/
|
|
23
|
-
import type { ISessions, SessionListState } from '@deepseek-ai/dsh-api-session-controller/client';
|
|
1
|
+
import type { SessionListState } from '@deepseek-ai/dsh-api-session-controller/client';
|
|
24
2
|
import type { WorkspaceSnapshot } from '@deepseek-ai/dsh-api-workspace-controller/client';
|
|
25
3
|
import type { SnapshotSelectorHook } from '@deepseek-ai/dsh-client-ui-slots';
|
|
26
4
|
import type { SettingsClient } from './index.tsx';
|
|
27
|
-
/** Locale keys
|
|
28
|
-
type ArchiveLabelKey = '
|
|
5
|
+
/** Locale keys read by archive management. */
|
|
6
|
+
type ArchiveLabelKey = 'archiveTitle' | 'archiveEmpty' | 'archiveRestore' | 'archiveRestoring' | 'archiveDelete' | 'archiveDeleteAll' | 'archiveRestoreAll' | 'archiveCount' | 'archiveDisabledHint' | 'archiveEnable' | 'unavailable' | 'archiveConfirmTitle' | 'archiveConfirmDescription' | 'archiveCancel' | 'archiveSelectAll' | 'archiveSelectedCount' | 'archiveClearSelection' | 'archiveDeleteSelected' | 'archiveDeleteFailed';
|
|
29
7
|
type Translate = (key: ArchiveLabelKey) => string;
|
|
30
|
-
export declare const ARCHIVE_CSS = "\n.dut-arc{display:grid;gap:12px;max-width:680px;padding:6px 2px 36px}\n.dut-arc-head{display:flex;align-items:center;gap:10px;padding:14px 16px 0}\n.dut-arc-head h2{margin:0;font-size:15px;font-weight:600;letter-spacing:-.01em;color:var(--dsw-alias-label-primary)}\n.dut-arc-count{font-size:11.5px;color:var(--dsw-alias-label-secondary);padding:2px 8px;border-radius:999px;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l1)}\n.dut-arc-spacer{flex:1}\n.dut-arc-btn{display:inline-flex;align-items:center;height:28px;padding:0 12px;border-radius:999px;border:1px solid var(--dsw-alias-border-l1);background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:12px;cursor:pointer;transition:background .15s ease,color .15s ease,border-color .15s ease}\n.dut-arc-btn:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}\n.dut-arc-btn:disabled{opacity:.5;cursor:default}\n.dut-arc-btn.dut-arc-del:hover{border-color:color-mix(in srgb,var(--dsw-alias-state-error-primary) 55%,transparent);color:var(--dsw-alias-state-error-primary);background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 10%,transparent)}\n.dut-arc-btn.dut-arc-confirm{border-color:color-mix(in srgb,var(--dsw-alias-state-error-primary) 55%,transparent);color:var(--dsw-alias-state-error-primary);font-weight:600}\n.dut-arc-body{display:grid;gap:2px;margin-top:4px}\n.dut-arc-row{display:flex;align-items:center;gap:8px;padding:10px 16px;border-radius:12px}\n.dut-arc-row:hover{background:var(--dsw-alias-interactive-bg-hover)}\n.dut-arc-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;text-align:left;background:transparent;border:none;padding:0;
|
|
8
|
+
export declare const ARCHIVE_CSS = "\n.dut-arc{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;max-width:680px;padding:6px 2px 36px}\n.dut-arc-head{display:flex;align-items:center;flex-wrap:wrap;gap:10px;padding:14px 16px 0}\n.dut-arc-head h2{margin:0;font-size:15px;font-weight:600;letter-spacing:-.01em;color:var(--dsw-alias-label-primary)}\n.dut-arc-count{font-size:11.5px;color:var(--dsw-alias-label-secondary);padding:2px 8px;border-radius:999px;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l1)}\n.dut-arc-spacer{flex:1}\n.dut-arc-btn{display:inline-flex;align-items:center;height:28px;padding:0 12px;border-radius:999px;border:1px solid var(--dsw-alias-border-l1);background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:12px;cursor:pointer;transition:background .15s ease,color .15s ease,border-color .15s ease}\n.dut-arc-btn:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}\n.dut-arc-btn:disabled{opacity:.5;cursor:default}\n.dut-arc-btn.dut-arc-del:hover{border-color:color-mix(in srgb,var(--dsw-alias-state-error-primary) 55%,transparent);color:var(--dsw-alias-state-error-primary);background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 10%,transparent)}\n.dut-arc-btn.dut-arc-confirm{border-color:color-mix(in srgb,var(--dsw-alias-state-error-primary) 55%,transparent);color:var(--dsw-alias-state-error-primary);font-weight:600}\n.dut-arc-body{display:grid;grid-template-columns:minmax(0,1fr);gap:2px;margin-top:4px}\n.dut-arc-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:10px;padding:12px 16px 0;font-size:12px;color:var(--dsw-alias-label-secondary)}\n.dut-arc-select{display:flex;align-items:center;gap:10px;cursor:pointer}\n.dut-arc-select input{flex-shrink:0;width:14px;height:14px;margin:0;accent-color:var(--dsw-alias-label-primary);cursor:inherit}\n.dut-arc-session{flex:1;min-width:0}\n.dut-arc-row{display:flex;align-items:center;gap:8px;padding:10px 16px;border-radius:12px}\n.dut-arc-row:hover{background:var(--dsw-alias-interactive-bg-hover)}\n.dut-arc-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;text-align:left;background:transparent;border:none;padding:0;color:var(--dsw-alias-label-primary);font:inherit}\n.dut-arc-title{font-size:13.5px;font-weight:600;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}\n.dut-arc-sub{font-size:11.5px;color:var(--dsw-alias-label-secondary);white-space:nowrap;text-overflow:ellipsis;overflow:hidden}\n.dut-arc-empty{padding:32px 16px;text-align:center;font-size:12.5px;color:var(--dsw-alias-label-secondary)}\n.dut-arc-alert{margin:8px 16px 0;padding:8px 12px;border-radius:10px;font-size:12px;line-height:1.5;white-space:pre-line;background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 10%,transparent);color:var(--dsw-alias-state-error-primary)}\n.dut-arc-targets{max-height:240px;overflow:auto;padding-inline-start:20px;overflow-wrap:anywhere}\n.dut-arc-off{padding:20px 16px;display:grid;gap:12px}\n.dut-arc-off p{margin:0;font-size:12.5px;line-height:1.6;color:var(--dsw-alias-label-secondary)}\n";
|
|
31
9
|
/** Install the Archive stylesheet once (idempotent); returns the disposer. */
|
|
32
10
|
export declare function installArchiveStyles(): () => void;
|
|
33
11
|
export interface ArchiveSectionProps {
|
|
34
12
|
controller: SettingsClient;
|
|
35
13
|
t: Translate;
|
|
36
|
-
|
|
14
|
+
restoreSession: (id: string) => Promise<void>;
|
|
15
|
+
previewDeletion: (id: string) => Promise<readonly string[]>;
|
|
16
|
+
deleteSession: (id: string, scope: readonly string[]) => Promise<void>;
|
|
37
17
|
/** Framework standard feeds: session list + workspace archive set. */
|
|
38
18
|
useSessions: SnapshotSelectorHook<SessionListState>;
|
|
39
19
|
useWorkspaces: SnapshotSelectorHook<WorkspaceSnapshot>;
|
|
40
20
|
}
|
|
41
|
-
|
|
21
|
+
/** Select archived sessions for confirmed deletion, retaining failed targets for retry. */
|
|
22
|
+
export declare function ArchiveSection({ controller, t, restoreSession, previewDeletion, deleteSession, useSessions, useWorkspaces }: ArchiveSectionProps): import("react").JSX.Element;
|
|
42
23
|
export {};
|
|
@@ -40,6 +40,6 @@ export declare function SidebarProjectLogo({ size }: {
|
|
|
40
40
|
}): ReactNode;
|
|
41
41
|
/** Expanded-sidebar wordmark supplied through the host's dedicated slot. */
|
|
42
42
|
export declare function SidebarProjectName(): ReactNode;
|
|
43
|
-
export declare const BRANDING_CSS = "\n/*
|
|
43
|
+
export declare const BRANDING_CSS = "\n/* Solid branding is limited to primary actions. Question choices only get a\n faint token-derived tint; other surfaces remain owned by the host theme. */\nbody:not([data-ds-dark-theme]) .dut-unicom-primary-action{background:linear-gradient(135deg,#9B0B09,#b71916) !important;border-color:#9B0B09 !important;color:#fff !important;box-shadow:0 7px 18px rgba(155,11,9,.24) !important}\nbody:not([data-ds-dark-theme]) .dut-unicom-primary-action:hover{background:linear-gradient(135deg,#b71916,#cf302c) !important;border-color:#b71916 !important;color:#fff !important;box-shadow:0 10px 24px rgba(155,11,9,.30) !important}\nbody:not([data-ds-dark-theme]) .dut-unicom-primary-action:active{transform:translateY(1px);box-shadow:0 4px 11px rgba(155,11,9,.22) !important}\n/* In dark mode, alter only the resting background of primary buttons. Once\n hovered, the host owns the complete interaction treatment again. */\nbody[data-ds-dark-theme] .dut-unicom-primary-action:not(:hover){background:#9B0B09 !important}\n/* Only the host's question composer, never global radio/checkbox controls.\n Keep normal text, focus rings and disabled behavior; no gradient or shadow. */\n[data-question-key] button:is([role=\"radio\"],[role=\"checkbox\"]):hover:not(:disabled){background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 5%,transparent)}\n[data-question-key] button:is([role=\"radio\"],[role=\"checkbox\"])[aria-checked=\"true\"]{background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 8%,transparent);border-color:color-mix(in srgb,var(--dsw-alias-state-error-primary) 18%,transparent)}\n[data-question-key] button:is([role=\"radio\"],[role=\"checkbox\"])[aria-checked=\"true\"]:hover:not(:disabled){background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 10%,transparent)}\n.dut-project-logo{display:block;object-fit:contain}\n.dut-left-logo{width:24px !important;height:24px !important}\n/* Legacy host marks remain in React's tree; only their painted appearance changes. */\nsvg.dut-project-logo{background:url(\"/_dsh/ui-tweaks/assets/logo.svg\") center/contain no-repeat}\nsvg.dut-project-logo>*{visibility:hidden}\n.dut-brand-title{font:var(--dsw-font-s-strong-14) !important}\n.dut-sidebar-logo{width:24px !important;height:24px !important}\n.dut-sidebar-brand-name{font:var(--dsw-font-s-strong-14) !important;letter-spacing:-.01em !important;white-space:nowrap}\n/* The version the plugin injects beside the sidebar wordmark. */\n.dut-sidebar-version{margin-left:8px;font-size:12px !important;font-weight:500 !important;line-height:22px !important;color:var(--dsw-alias-label-secondary) !important;letter-spacing:0 !important;white-space:nowrap}\n.dut-version-row-hidden{display:none !important}\n\n.dut-sidebar-header{height:44px !important;padding:0 4px !important;margin-bottom:8px !important;gap:8px !important}\n.dut-sidebar-brand{min-width:0 !important;background:transparent !important;box-shadow:none !important}\n.dut-sidebar-identity{height:24px !important;gap:8px !important}\n.dut-sidebar-wordmark{font:var(--dsw-font-s-strong-14) !important;letter-spacing:-.01em !important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n.dut-sidebar-toggle{width:28px !important;height:28px !important;border-radius:8px !important;color:var(--dsw-alias-label-secondary) !important}\n.dut-sidebar-toggle:hover{background:var(--dsw-alias-interactive-bg-hover) !important}\n/* Reuse the original ChatCode primary-action red, scoped to this marked CTA. */\n.dut-sidebar-new-session{height:40px !important;justify-content:flex-start !important;gap:8px !important;margin:0 0 10px !important;padding:8px 10px !important;border:1px solid #9B0B09 !important;border-radius:10px !important;background:linear-gradient(135deg,#9B0B09,#b71916) !important;color:#fff !important;font:var(--dsw-font-s-strong-14) !important;font-weight:600 !important;box-shadow:none !important;transform:none !important}\n.dut-sidebar-new-session:hover{background:linear-gradient(135deg,#b71916,#cf302c) !important}\n.dut-sidebar-new-session:active{background:#9B0B09 !important}\n.dut-sidebar-new-session:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}\n.dut-sidebar-new-session > span:first-child{flex:1;min-width:0;overflow:hidden;mask-image:none !important}\n.dut-sidebar-new-session > span:first-child > span{width:auto !important;justify-content:flex-start !important;gap:8px !important;min-width:0}\n.dut-sidebar-new-session > span:first-child > span > svg{width:16px;height:16px;flex:none;color:inherit}\n.dut-sidebar-new-session > span:first-child > span > span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n.dut-sidebar-new-session > span + span{opacity:1 !important;flex:none;color:color-mix(in srgb,currentColor 75%,transparent);font:var(--dsw-font-xxs-12)}\n/* Temporary navigation-only hide. Remove this block to restore Plugins;\n registrations, settings, installed plugins and other panel entries stay intact. */\nnav:is([aria-label=\"\u5168\u5C40\u9762\u677F\"],[aria-label=\"Global panels\"]) > button:is([aria-label=\"\u63D2\u4EF6\"],[aria-label=\"Plugins\"]),\nnav:is([aria-label=\"\u5168\u5C40\u9762\u677F\"],[aria-label=\"Global panels\"]):has(> button:is([aria-label=\"\u63D2\u4EF6\"],[aria-label=\"Plugins\"]):only-child){display:none !important}\n\n.dut-brand-version{display:none !important}\n.dut-hero-preview{display:none !important}\n.dut-hero-logo{width:60px !important;height:60px !important}\n.dut-hero-title{font-size:30px !important;line-height:40px !important;font-weight:600 !important;letter-spacing:.06em !important;white-space:nowrap}\n[class*=\"headline\"]:has(.dut-hero-logo){grid-template-columns:60px auto !important;font-size:30px !important;line-height:40px !important}\n.dut-settings-logo{width:19px;height:19px;object-fit:contain}\n";
|
|
44
44
|
/** Install the brand theme and retain it across host navigation/rerenders. */
|
|
45
45
|
export declare function installBranding(): () => void;
|
|
@@ -58,7 +58,7 @@ declare const en: {
|
|
|
58
58
|
readonly fontSize: "Message font size";
|
|
59
59
|
readonly fontSizeHint: "Number between 10 and 32; applies to message text, headings, tables and code.";
|
|
60
60
|
readonly codeFontSize: "Code font size";
|
|
61
|
-
readonly codeFontSizeHint: "Absolute code size in px (8–32); 13px is ChatCode CLI's default at a
|
|
61
|
+
readonly codeFontSizeHint: "Absolute code size in px (8–32); 13px is ChatCode CLI's default at a 14px body. Applies to code blocks; inline code follows proportionally.";
|
|
62
62
|
readonly lineHeight: "Line spacing";
|
|
63
63
|
readonly lineHeightHint: "Base vertical spacing in px: gaps between message rows (Think ↔ tool cards) and blocks inside one reply, plus text line-height, paragraph and list margins, all scale from it; 16 is ChatCode CLI's default.";
|
|
64
64
|
readonly tableStyle: "Table style";
|
|
@@ -169,8 +169,16 @@ declare const en: {
|
|
|
169
169
|
readonly archiveEmpty: "No archived sessions.";
|
|
170
170
|
readonly archiveRestore: "Restore";
|
|
171
171
|
readonly archiveRestoring: "Working…";
|
|
172
|
+
readonly archiveConfirmTitle: "Permanently delete sessions?";
|
|
173
|
+
readonly archiveConfirmDescription: "Delete {count} session records including owned subagents? This cannot be undone. Independent forks, workspace files and Git data are retained.";
|
|
174
|
+
readonly archiveCancel: "Cancel";
|
|
172
175
|
readonly archiveDelete: "Delete";
|
|
173
176
|
readonly archiveDeleteAll: "Delete all";
|
|
177
|
+
readonly archiveSelectAll: "Select all";
|
|
178
|
+
readonly archiveSelectedCount: "{count} sessions selected";
|
|
179
|
+
readonly archiveClearSelection: "Clear selection";
|
|
180
|
+
readonly archiveDeleteSelected: "Delete selected ({count})";
|
|
181
|
+
readonly archiveDeleteFailed: "{title}: {error}";
|
|
174
182
|
readonly archiveRestoreAll: "Restore all";
|
|
175
183
|
readonly archiveCount: "sessions";
|
|
176
184
|
readonly archiveUnavailable: "Archive unavailable.";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Compact sidebar chrome; the host retains every button, shortcut and drag surface. */
|
|
2
|
+
export declare const SIDEBAR_HEADER_CSS = "\n.dut-sidebar-header{height:44px !important;padding:0 4px !important;margin-bottom:8px !important;gap:8px !important}\n.dut-sidebar-brand{min-width:0 !important;background:transparent !important;box-shadow:none !important}\n.dut-sidebar-identity{height:24px !important;gap:8px !important}\n.dut-sidebar-wordmark{font:var(--dsw-font-s-strong-14) !important;letter-spacing:-.01em !important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n.dut-sidebar-toggle{width:28px !important;height:28px !important;border-radius:8px !important;color:var(--dsw-alias-label-secondary) !important}\n.dut-sidebar-toggle:hover{background:var(--dsw-alias-interactive-bg-hover) !important}\n/* Reuse the original ChatCode primary-action red, scoped to this marked CTA. */\n.dut-sidebar-new-session{height:40px !important;justify-content:flex-start !important;gap:8px !important;margin:0 0 10px !important;padding:8px 10px !important;border:1px solid #9B0B09 !important;border-radius:10px !important;background:linear-gradient(135deg,#9B0B09,#b71916) !important;color:#fff !important;font:var(--dsw-font-s-strong-14) !important;font-weight:600 !important;box-shadow:none !important;transform:none !important}\n.dut-sidebar-new-session:hover{background:linear-gradient(135deg,#b71916,#cf302c) !important}\n.dut-sidebar-new-session:active{background:#9B0B09 !important}\n.dut-sidebar-new-session:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}\n.dut-sidebar-new-session > span:first-child{flex:1;min-width:0;overflow:hidden;mask-image:none !important}\n.dut-sidebar-new-session > span:first-child > span{width:auto !important;justify-content:flex-start !important;gap:8px !important;min-width:0}\n.dut-sidebar-new-session > span:first-child > span > svg{width:16px;height:16px;flex:none;color:inherit}\n.dut-sidebar-new-session > span:first-child > span > span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n.dut-sidebar-new-session > span + span{opacity:1 !important;flex:none;color:color-mix(in srgb,currentColor 75%,transparent);font:var(--dsw-font-xxs-12)}\n/* Temporary navigation-only hide. Remove this block to restore Plugins;\n registrations, settings, installed plugins and other panel entries stay intact. */\nnav:is([aria-label=\"\u5168\u5C40\u9762\u677F\"],[aria-label=\"Global panels\"]) > button:is([aria-label=\"\u63D2\u4EF6\"],[aria-label=\"Plugins\"]),\nnav:is([aria-label=\"\u5168\u5C40\u9762\u677F\"],[aria-label=\"Global panels\"]):has(> button:is([aria-label=\"\u63D2\u4EF6\"],[aria-label=\"Plugins\"]):only-child){display:none !important}\n";
|
|
3
|
+
/** Mark only the expanded brand row and its adjacent native New Session button. */
|
|
4
|
+
export declare function syncSidebarHeader(): void;
|
|
5
|
+
/** Restore native header styling when the branding effect is disposed. */
|
|
6
|
+
export declare function clearSidebarHeader(): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Font overrides for the conversation, preserving the live theme families. */
|
|
2
|
+
/**
|
|
3
|
+
* Apply the UI Tweaks size and spacing preferences to the host's prose tokens.
|
|
4
|
+
* @param fontSize - Selected body size in pixels.
|
|
5
|
+
* @param lineHeight - Vertical-spacing unit; 16 retains the normal rhythm.
|
|
6
|
+
* @param codeFontSize - Selected code-block size in pixels.
|
|
7
|
+
* @returns Theme-token overrides for a runtime stylesheet.
|
|
8
|
+
*/
|
|
9
|
+
export declare function buildFontCss(fontSize: number, lineHeight: number, codeFontSize: number): string;
|
package/lib/types/config.d.ts
CHANGED
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
* @module dsh-better-sidebar/config
|
|
6
6
|
*/
|
|
7
7
|
import z from 'schemastery';
|
|
8
|
+
import { type UITweaksConfig } from './ui-tweaks/config.ts';
|
|
8
9
|
import { type SidebarPrefs } from './prefs-shared.ts';
|
|
9
10
|
export { SIDEBAR_PREFS_DEFAULTS, SIDEBAR_PREFS_NS, TERMINAL_FONT_SIZE_DEFAULT, TERMINAL_FONT_SIZE_MAX, TERMINAL_FONT_SIZE_MIN, TITLE_BAR_STRIP_DEFAULT, TITLE_BAR_STRIP_MAX, TITLE_BAR_STRIP_MIN, WIDTH_PERCENT_DEFAULT, WIDTH_PERCENT_MAX, WIDTH_PERCENT_MIN, type SidebarPrefs, } from './prefs-shared.ts';
|
|
10
11
|
/** Tunable sidebar host limits (every field optional; defaults fill in). */
|
|
11
|
-
export interface SidebarConfig {
|
|
12
|
+
export interface SidebarConfig extends Partial<SidebarPrefs>, UITweaksConfig {
|
|
12
13
|
/** Read cap of one text file (bytes); larger files return truncated. */
|
|
13
14
|
readLimit?: number;
|
|
14
15
|
/** Media route cap (bytes); larger binaries are refused. */
|
|
@@ -56,8 +57,6 @@ export interface CodingPlanConfig {
|
|
|
56
57
|
/** Catalogue request timeout in milliseconds. */
|
|
57
58
|
requestTimeoutMs?: number;
|
|
58
59
|
}
|
|
59
|
-
/** Schemastery schema for the plugin configuration. */
|
|
60
|
-
export declare const Config: z<SidebarConfig>;
|
|
61
60
|
/** Fully defaulted sidebar host settings. */
|
|
62
61
|
export interface ResolvedSidebarConfig {
|
|
63
62
|
readLimit: number;
|
|
@@ -93,3 +92,5 @@ export interface ResolvedCodingPlanConfig {
|
|
|
93
92
|
export declare function resolveSidebarConfig(config: SidebarConfig | undefined): ResolvedSidebarConfig;
|
|
94
93
|
/** Schemastery schema for the user-facing preferences (validated by the settings service). */
|
|
95
94
|
export declare const PrefsSchema: z<SidebarPrefs>;
|
|
95
|
+
/** One entry schema: deployment fields stay fixed while sidebar and UI preferences are live-editable. */
|
|
96
|
+
export declare const Config: z<SidebarConfig>;
|
|
@@ -427,21 +427,10 @@ export interface SidebarInvariantsService {
|
|
|
427
427
|
/** Reserve one package's checks and install them in the service's child fiber. */
|
|
428
428
|
register(packageName: string, installer: (ctx: Context, fail: (message: string) => never) => void | Promise<void>): () => void;
|
|
429
429
|
}
|
|
430
|
-
/** The settings service face (mirror of @deepseek-ai/dsh-settings'
|
|
430
|
+
/** The settings service face (mirror of @deepseek-ai/dsh-settings' SettingsForms). */
|
|
431
431
|
export interface SidebarSettingsService {
|
|
432
|
-
/**
|
|
433
|
-
|
|
434
|
-
* then the composition base, then the user document).
|
|
435
|
-
*/
|
|
436
|
-
register<T>(ns: string, schema: unknown, options?: {
|
|
437
|
-
base?: Partial<T>;
|
|
438
|
-
applies?: 'live' | 'restart';
|
|
439
|
-
}): {
|
|
440
|
-
get(): T;
|
|
441
|
-
watch(callback: (next: T, prev: T) => void | Promise<void>): () => void;
|
|
442
|
-
update(patch: object): Promise<void>;
|
|
443
|
-
replace(section: object): Promise<void>;
|
|
444
|
-
};
|
|
432
|
+
/** Whether the active profile accepts form edits. */
|
|
433
|
+
readonly writable: boolean;
|
|
445
434
|
/** Redacted descriptors of every registered namespace (secrets stripped). */
|
|
446
435
|
describe(options?: {
|
|
447
436
|
redactSecrets?: boolean;
|
|
@@ -455,6 +444,15 @@ export interface SidebarSettingsService {
|
|
|
455
444
|
}>;
|
|
456
445
|
/** Service-level merge write with the revision guard (a stale writer is refused). */
|
|
457
446
|
update(ns: string, patch: object, expectedRevision?: number): Promise<void>;
|
|
447
|
+
/** Apply path edits without restating fields hidden from the caller. */
|
|
448
|
+
mutate(ns: string, ops: readonly ({
|
|
449
|
+
op: 'set';
|
|
450
|
+
path: readonly string[];
|
|
451
|
+
value: unknown;
|
|
452
|
+
} | {
|
|
453
|
+
op: 'unset';
|
|
454
|
+
path: readonly string[];
|
|
455
|
+
})[], expectedRevision?: number): Promise<void>;
|
|
458
456
|
}
|
|
459
457
|
/**
|
|
460
458
|
* The tools service face (mirror of @deepseek-ai/dsh-tools' ToolRuntime).
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import type { Context, SidebarHttpRequest } from './context-types.ts';
|
|
2
|
+
/** Render the standalone login gate with one automatic attempt and persistent manual recovery. */
|
|
3
|
+
export declare function renderChatcodeLoginPage(logo: string): string;
|
|
2
4
|
export declare function registerLoginRoute(ctx: Context, fence: (req: SidebarHttpRequest) => boolean): () => void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Shared config plugin routes inside the sidebar's existing trust fence. */
|
|
2
|
+
import type { Context } from './context-types.ts';
|
|
3
|
+
export declare function buildPluginMarketApi(ctx: Pick<Context, 'get'>, cwdOf: (payload: unknown) => Promise<{
|
|
4
|
+
cwd: string;
|
|
5
|
+
}>): Record<string, (payload: unknown) => Promise<unknown>>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/** Credential-free structural contract of the config plugin's host service. */
|
|
2
|
+
export type PluginMarketScope = 'project' | 'user';
|
|
3
|
+
export interface PluginMarketplace {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
official: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface MarketplacePlugin {
|
|
10
|
+
id: string;
|
|
11
|
+
marketplaceId: string;
|
|
12
|
+
name: string;
|
|
13
|
+
description: string;
|
|
14
|
+
}
|
|
15
|
+
export interface InstalledMarketplacePlugin extends MarketplacePlugin {
|
|
16
|
+
scope: PluginMarketScope;
|
|
17
|
+
projectPath: string;
|
|
18
|
+
installPath: string;
|
|
19
|
+
version: string;
|
|
20
|
+
installedAt: string;
|
|
21
|
+
}
|
|
22
|
+
export interface MarketplaceCatalog {
|
|
23
|
+
marketplaces: PluginMarketplace[];
|
|
24
|
+
warning: string;
|
|
25
|
+
}
|
|
26
|
+
export interface PluginCatalog {
|
|
27
|
+
plugins: MarketplacePlugin[];
|
|
28
|
+
warning: string;
|
|
29
|
+
}
|
|
30
|
+
/** Host-owned paths for the remote Web directory browser. */
|
|
31
|
+
export interface PluginProjectDirectories {
|
|
32
|
+
path: string;
|
|
33
|
+
home: string;
|
|
34
|
+
crumbs: Array<{
|
|
35
|
+
name: string;
|
|
36
|
+
path: string;
|
|
37
|
+
hidden: boolean;
|
|
38
|
+
}>;
|
|
39
|
+
entries: Array<{
|
|
40
|
+
name: string;
|
|
41
|
+
path: string;
|
|
42
|
+
hidden: boolean;
|
|
43
|
+
}>;
|
|
44
|
+
truncated: boolean;
|
|
45
|
+
}
|
|
46
|
+
export type PluginProjectPick = {
|
|
47
|
+
kind: 'native';
|
|
48
|
+
path: string | null;
|
|
49
|
+
} | {
|
|
50
|
+
kind: 'browse';
|
|
51
|
+
};
|
|
52
|
+
export interface PluginMarketService {
|
|
53
|
+
marketplaces(): Promise<MarketplaceCatalog>;
|
|
54
|
+
plugins(marketplaceId: string): Promise<MarketplacePlugin[]>;
|
|
55
|
+
catalog?(marketplaceId: string): Promise<PluginCatalog>;
|
|
56
|
+
installed(cwd: string): Promise<InstalledMarketplacePlugin[]>;
|
|
57
|
+
install(cwd: string, pluginId: string, scope: PluginMarketScope): Promise<InstalledMarketplacePlugin>;
|
|
58
|
+
uninstall(cwd: string, pluginId: string, scope: PluginMarketScope): Promise<void>;
|
|
59
|
+
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* the browser bundle never pulls the schema runtime in.
|
|
7
7
|
*/
|
|
8
8
|
/** The user-settings namespace holding the side card preferences. */
|
|
9
|
-
export declare const SIDEBAR_PREFS_NS = "
|
|
9
|
+
export declare const SIDEBAR_PREFS_NS = "better-sidebar";
|
|
10
10
|
/** User-facing side card preferences (new-conversation defaults). */
|
|
11
11
|
export interface SidebarPrefs {
|
|
12
12
|
/** Whether a brand-new conversation opens the side card by default. */
|
package/lib/types/pty-deps.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export type NodePtyModule = typeof nodePtyNs;
|
|
|
6
6
|
* range DSH core declares (`@deepseek-ai/dsh-subprocess-local`): the same
|
|
7
7
|
* range keeps pnpm resolving both to one physical package.
|
|
8
8
|
*/
|
|
9
|
-
export declare const DSH_NODE_PTY_RANGE = "
|
|
9
|
+
export declare const DSH_NODE_PTY_RANGE = "1.2.0-beta.15";
|
|
10
10
|
/**
|
|
11
11
|
* The WebSocket close-code-1011 reason the host sends when node-pty is
|
|
12
12
|
* unavailable. The client recognizes this exact marker and fetches the full
|
|
@@ -22,10 +22,9 @@ export interface UITweaksConfig {
|
|
|
22
22
|
*/
|
|
23
23
|
codeFontScale?: number;
|
|
24
24
|
/**
|
|
25
|
-
* Absolute code font size in px (8–32)
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* `codeFontScale` percentage, then to the stock default.
|
|
25
|
+
* Absolute code font size in px (8–32), default 13. Drives code blocks;
|
|
26
|
+
* inline code and small code follow proportionally. When unset, uses a non-default legacy
|
|
27
|
+
* `codeFontScale` percentage, otherwise 13px.
|
|
29
28
|
*/
|
|
30
29
|
codeFontSize?: number;
|
|
31
30
|
/**
|
|
@@ -47,7 +46,7 @@ export interface UITweaksConfig {
|
|
|
47
46
|
gitBarEnabled?: boolean;
|
|
48
47
|
/**
|
|
49
48
|
* Whether the Archive manager is shown: the "归档" Settings page that lists
|
|
50
|
-
* archived sessions and can restore or
|
|
49
|
+
* archived sessions and can restore or confirm permanent deletion through the shared Host. Off by
|
|
51
50
|
* default; users turn it on in Settings.
|
|
52
51
|
*/
|
|
53
52
|
archiveManagerEnabled?: boolean;
|
|
@@ -106,7 +105,7 @@ export interface UITweaksConfig {
|
|
|
106
105
|
}
|
|
107
106
|
export declare const MIN_FONT_SIZE = 10;
|
|
108
107
|
export declare const MAX_FONT_SIZE = 32;
|
|
109
|
-
export declare const DEFAULT_FONT_SIZE =
|
|
108
|
+
export declare const DEFAULT_FONT_SIZE = 14;
|
|
110
109
|
/** 16px matches the stock DSH vertical rhythm (message/block gaps, etc.). */
|
|
111
110
|
export declare const MIN_LINE_HEIGHT = 0;
|
|
112
111
|
export declare const MAX_LINE_HEIGHT = 64;
|
|
@@ -115,7 +114,7 @@ export declare const DEFAULT_LINE_HEIGHT = 16;
|
|
|
115
114
|
export declare const MIN_CODE_FONT_SCALE = 50;
|
|
116
115
|
export declare const MAX_CODE_FONT_SCALE = 150;
|
|
117
116
|
export declare const DEFAULT_CODE_FONT_SCALE = 81;
|
|
118
|
-
/**
|
|
117
|
+
/** Default absolute code-block size, paired with 14px prose. */
|
|
119
118
|
export declare const MIN_CODE_FONT_SIZE = 8;
|
|
120
119
|
export declare const MAX_CODE_FONT_SIZE = 32;
|
|
121
120
|
export declare const DEFAULT_CODE_FONT_SIZE = 13;
|
|
@@ -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
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chatcode/cco-better-sidebar",
|
|
3
|
-
"version": "0.18.0-
|
|
3
|
+
"version": "0.18.0-rc.12",
|
|
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": {
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
"clsx": "^2.1.1",
|
|
140
140
|
"dompurify": "^3.4.14",
|
|
141
141
|
"mermaid": "^11.16.1",
|
|
142
|
-
"node-pty": "
|
|
142
|
+
"node-pty": "1.2.0-beta.15",
|
|
143
143
|
"react-icons": "5.7.0",
|
|
144
144
|
"rxjs": "^7.8.2",
|
|
145
145
|
"schemastery": "^3.18.0",
|
|
@@ -11,6 +11,7 @@ import { useEffect, useRef, useState } from 'react'
|
|
|
11
11
|
import { api } from './api.ts'
|
|
12
12
|
import { useChatcodeAccount } from './useChatcodeAccount.ts'
|
|
13
13
|
import { redirectToChatcodeLogin } from './chatcode-login-route.ts'
|
|
14
|
+
import { LogoutConfirmDialog } from './LogoutConfirmDialog.tsx'
|
|
14
15
|
import { t } from './locales.ts'
|
|
15
16
|
import css from './sidebar.module.css'
|
|
16
17
|
|
|
@@ -75,6 +76,7 @@ function logout(): void {
|
|
|
75
76
|
export function AccountMenu(): JSX.Element {
|
|
76
77
|
const rootRef = useRef<HTMLDivElement>(null)
|
|
77
78
|
const [open, setOpen] = useState(false)
|
|
79
|
+
const [logoutTarget, setLogoutTarget] = useState<'chatcode' | 'browser'>()
|
|
78
80
|
const [userName, setUserName] = useState('User')
|
|
79
81
|
const { chatcode, busy, error, loginUrl, startLogin, logout: logoutChatcode } = useChatcodeAccount()
|
|
80
82
|
|
|
@@ -157,11 +159,11 @@ export function AccountMenu(): JSX.Element {
|
|
|
157
159
|
{canStartChatcodeLogin && <button type="button" role="menuitem" className={css.accountItem} disabled={busy} onClick={startLogin}>
|
|
158
160
|
<LogoutIcon />{busy ? t('accountMenuChatcodeStarting') : t('accountMenuChatcodeLogin')}
|
|
159
161
|
</button>}
|
|
160
|
-
{hasChatcodeAccount && <button type="button" role="menuitem" className={css.accountItem} disabled={busy} onClick={
|
|
162
|
+
{hasChatcodeAccount && <button type="button" role="menuitem" className={css.accountItem} disabled={busy} onClick={() => { setLogoutTarget('chatcode') }}>
|
|
161
163
|
<LogoutIcon />{t('accountMenuLogout')}
|
|
162
164
|
</button>}
|
|
163
165
|
</>}
|
|
164
|
-
{chatcode?.available === false && <button type="button" role="menuitem" className={css.accountItem} onClick={
|
|
166
|
+
{chatcode?.available === false && <button type="button" role="menuitem" className={css.accountItem} onClick={() => { setLogoutTarget('browser') }}>
|
|
165
167
|
<LogoutIcon />{t('accountMenuLogout')}
|
|
166
168
|
</button>}
|
|
167
169
|
</div>
|
|
@@ -178,6 +180,14 @@ export function AccountMenu(): JSX.Element {
|
|
|
178
180
|
<span className={css.accountName}>{chatcodeName}</span>
|
|
179
181
|
<span className={css.accountPresence} style={{ opacity: signedIn ? 1 : 0.25 }} aria-hidden="true" />
|
|
180
182
|
</button>
|
|
183
|
+
{logoutTarget !== undefined && <LogoutConfirmDialog
|
|
184
|
+
onCancel={() => { setLogoutTarget(undefined) }}
|
|
185
|
+
onConfirm={() => {
|
|
186
|
+
setLogoutTarget(undefined)
|
|
187
|
+
if (logoutTarget === 'chatcode') logoutChatcode()
|
|
188
|
+
else logout()
|
|
189
|
+
}}
|
|
190
|
+
/>}
|
|
181
191
|
</div>
|
|
182
192
|
)
|
|
183
193
|
}
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
IconLinkOutline14,
|
|
24
24
|
IconRefreshOutline14,
|
|
25
25
|
IconWarningOutline16,
|
|
26
|
-
} from '
|
|
26
|
+
} from './icons.tsx'
|
|
27
27
|
import { VscLinkExternal } from 'react-icons/vsc'
|
|
28
28
|
import { api } from './api.ts'
|
|
29
29
|
import { embeddabilityOf, isAllowedLoopbackUrl, normalizeBrowserUrl } from './browser.ts'
|
package/src/client/DiffTab.tsx
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* very content it shows.
|
|
9
9
|
*/
|
|
10
10
|
import { useCallback, useEffect, useState } from 'react'
|
|
11
|
-
import { IconRefreshOutline16 } from '
|
|
11
|
+
import { IconRefreshOutline16 } from './icons.tsx'
|
|
12
12
|
import type { SessionScope } from './api.ts'
|
|
13
13
|
import { api } from './api.ts'
|
|
14
14
|
import type { SidebarDiffRef } from './state.ts'
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
import { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from 'react'
|
|
26
26
|
import { createElement } from 'react'
|
|
27
27
|
import clsx from 'clsx'
|
|
28
|
-
import { IconCheckOutline16, IconFolderOpen16, IconRefreshOutline14 } from '
|
|
28
|
+
import { IconCheckOutline16, IconFolderOpen16, IconRefreshOutline14 } from './icons.tsx'
|
|
29
29
|
import type { Context } from '../context-types.ts'
|
|
30
30
|
import { api, isOutsideWorkspaceMessage, mediaUrl, type SessionScope } from './api.ts'
|
|
31
31
|
import { BinaryDownload } from './binary-download.tsx'
|
package/src/client/FileTree.tsx
CHANGED
|
@@ -23,15 +23,20 @@
|
|
|
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 {
|
|
27
|
-
IconChevronRightOutline14, IconCodeOutline16, IconCopyOutline16, IconDownloadOutline16,
|
|
28
|
-
IconLinkOutline16, Menu, type MenuEntry, type MenuItem, writeClipboard,
|
|
29
|
-
} from '@deepseek-ai/dsh-client-ui-primitives'
|
|
26
|
+
import { Menu, type MenuEntry, type MenuItem, writeClipboard } from '@deepseek-ai/dsh-client-ui-primitives'
|
|
30
27
|
import { SiCursor, SiZedindustries } from 'react-icons/si'
|
|
31
28
|
import { VscFile, VscFolder, VscFolderOpened, VscLinkExternal, VscPin, VscPinned } from 'react-icons/vsc'
|
|
32
29
|
import { api, downloadUrl, isOutsideWorkspaceMessage, type FsEntry } from './api.ts'
|
|
33
30
|
import { FenceErrorNotice } from './FenceErrorNotice.tsx'
|
|
34
|
-
import {
|
|
31
|
+
import {
|
|
32
|
+
IconChevronRightOutline14,
|
|
33
|
+
IconCodeOutline16,
|
|
34
|
+
IconCopyOutline16,
|
|
35
|
+
IconDownloadOutline16,
|
|
36
|
+
IconLinkOutline16,
|
|
37
|
+
IconUploadOutline16,
|
|
38
|
+
IconVscode16,
|
|
39
|
+
} from './icons.tsx'
|
|
35
40
|
import type { OpenWithTarget } from './open-with.ts'
|
|
36
41
|
import { relativeTo } from './paths.ts'
|
|
37
42
|
import { t } from './locales.ts'
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { useEffect, useRef, useState, type ReactNode } from 'react'
|
|
18
18
|
import clsx from 'clsx'
|
|
19
|
-
import {
|
|
19
|
+
import { Menu } from '@deepseek-ai/dsh-client-ui-primitives'
|
|
20
|
+
import { IconCloseFill14 } from './icons.tsx'
|
|
20
21
|
import type { FloatWindow, SidebarTab } from './state.ts'
|
|
21
22
|
import { FLOAT_MIN_H, FLOAT_MIN_W } from './state.ts'
|
|
22
23
|
import { t } from './locales.ts'
|
package/src/client/GitView.tsx
CHANGED
|
@@ -10,10 +10,14 @@
|
|
|
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
14
|
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
IconBranchOutline16,
|
|
16
|
+
IconCodeOutline16,
|
|
17
|
+
IconCopyOutline16,
|
|
18
|
+
IconRefreshOutline16,
|
|
19
|
+
IconTrashOutline16,
|
|
20
|
+
} from './icons.tsx'
|
|
17
21
|
import type { GitLogEntry, GitStatusEntry, GitStatusResult, GitWorktree, SessionScope } from './api.ts'
|
|
18
22
|
import { api } from './api.ts'
|
|
19
23
|
import { isWithinWorkspace, relativeTo } from './paths.ts'
|