@chatcode/cco-better-sidebar 0.18.0-rc.12 → 0.18.0-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.
- package/README.md +8 -2
- package/README_EN.md +8 -2
- package/lib/client-editor.js +267 -268
- package/lib/client-mermaid.js +266 -267
- package/lib/client-registry.js +1803 -1772
- package/lib/client-terminal.js +264 -265
- package/lib/client.js +1631 -1600
- package/lib/index.js +10 -6
- package/lib/types/client/AccountMenu.d.ts +4 -1
- package/lib/types/client/ContextMenu.d.ts +15 -0
- package/lib/types/client/service.d.ts +1 -1
- package/lib/types/client/ui-tweaks/index.d.ts +2 -0
- package/lib/types/client/ui-tweaks/notifier.d.ts +4 -2
- package/lib/types/client/useChatcodeAccount.d.ts +1 -0
- package/lib/types/ui-tweaks/turn-outcome.d.ts +1 -1
- package/package.json +59 -59
- package/src/client/AccountMenu.tsx +13 -17
- package/src/client/ContextMenu.tsx +22 -0
- package/src/client/FileTree.tsx +6 -13
- package/src/client/FreeWindow.tsx +4 -3
- package/src/client/GitView.tsx +8 -5
- package/src/client/Sidebar.tsx +0 -3
- package/src/client/TabBar.tsx +5 -4
- package/src/client/index.tsx +18 -40
- package/src/client/service.ts +1 -1
- package/src/client/shell-presets.ts +1 -1
- package/src/client/sidebar.module.css +23 -13
- package/src/client/ui-tweaks/index.tsx +45 -22
- package/src/client/ui-tweaks/notifier.ts +13 -12
- package/src/client/ui-tweaks/whale.tsx +1 -1
- package/src/client/useChatcodeAccount.ts +12 -2
- package/src/index.ts +6 -2
- package/src/ui-tweaks/git.ts +1 -1
- package/src/ui-tweaks/turn-outcome.ts +3 -3
- package/src/ui-tweaks/web.ts +1 -0
package/lib/index.js
CHANGED
|
@@ -3436,8 +3436,8 @@ const turnOutcomeProjectionDefinition = {
|
|
|
3436
3436
|
* @param ctx - plugin context owning the registration effect.
|
|
3437
3437
|
*/
|
|
3438
3438
|
function installTurnOutcomeProjection(ctx) {
|
|
3439
|
-
ctx.inject(["sessionProjections"], (projectionCtx) => {
|
|
3440
|
-
projectionCtx.sessionProjections.register(turnOutcomeProjectionDefinition);
|
|
3439
|
+
ctx.inject(["sessionProjections"], async (projectionCtx) => {
|
|
3440
|
+
await projectionCtx.sessionProjections.register(turnOutcomeProjectionDefinition);
|
|
3441
3441
|
});
|
|
3442
3442
|
}
|
|
3443
3443
|
//#endregion
|
|
@@ -3601,7 +3601,7 @@ var UITweaksWebBackend = class {
|
|
|
3601
3601
|
value: this.snapshot()
|
|
3602
3602
|
});
|
|
3603
3603
|
} catch (error) {
|
|
3604
|
-
const conflict = error instanceof SettingsConflictError;
|
|
3604
|
+
const conflict = error instanceof SettingsConflictError || error instanceof Error && Reflect.get(error, "code") === "SETTINGS_CONFLICT";
|
|
3605
3605
|
requestError(res, conflict ? 409 : 400, conflict ? "settings-conflict" : "settings-rejected", messageOf$2(error));
|
|
3606
3606
|
}
|
|
3607
3607
|
}
|
|
@@ -4495,7 +4495,7 @@ var GitBackend = class {
|
|
|
4495
4495
|
};
|
|
4496
4496
|
} catch {}
|
|
4497
4497
|
try {
|
|
4498
|
-
const stored = this.ctx.settings?.
|
|
4498
|
+
const stored = this.ctx.settings?.describe().find((item) => item.ns === AGENT_DEFAULT_MODEL_NAMESPACE)?.value;
|
|
4499
4499
|
const provider = stored?.provider;
|
|
4500
4500
|
const model = stored?.model;
|
|
4501
4501
|
if (typeof provider === "string" && provider !== "" && typeof model === "string" && model !== "" && registered.has(provider)) return {
|
|
@@ -6116,7 +6116,7 @@ const name = "dsh-better-sidebar";
|
|
|
6116
6116
|
const inject = [
|
|
6117
6117
|
"webServer",
|
|
6118
6118
|
"sessions",
|
|
6119
|
-
"
|
|
6119
|
+
"connection",
|
|
6120
6120
|
"tools",
|
|
6121
6121
|
"settings"
|
|
6122
6122
|
];
|
|
@@ -6668,7 +6668,11 @@ function apply(ctx, config) {
|
|
|
6668
6668
|
ensureSpawnHelper();
|
|
6669
6669
|
const resolved = resolveSidebarConfig(config);
|
|
6670
6670
|
const terminalShell = defaultShell({ explicit: resolved.shell });
|
|
6671
|
-
const fence = (req) =>
|
|
6671
|
+
const fence = (req) => {
|
|
6672
|
+
const connection = ctx.get("connection");
|
|
6673
|
+
if (typeof connection?.requestRejection === "function") return connection.requestRejection(req) === void 0;
|
|
6674
|
+
return ctx.webRuntime !== void 0 && isTrustedApiRequest(req, ctx.webRuntime.trustedHosts);
|
|
6675
|
+
};
|
|
6672
6676
|
const nodePty = loadNodePty$1();
|
|
6673
6677
|
if (nodePty === null) {
|
|
6674
6678
|
const status = depsStatus();
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
|
+
import { Menu as HostMenu } from '@deepseek-ai/dsh-client-ui-primitives';
|
|
3
|
+
type Props = Omit<ComponentProps<typeof HostMenu>, 'anchorPoint' | 'getAnchorRect' | 'contextual'> & {
|
|
4
|
+
contextual?: boolean | undefined;
|
|
5
|
+
anchorPoint?: {
|
|
6
|
+
readonly x: number;
|
|
7
|
+
readonly y: number;
|
|
8
|
+
} | undefined;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Place menus at viewport coordinates: published hosts consume getAnchorRect,
|
|
12
|
+
* while the bundled host consumes anchorPoint.
|
|
13
|
+
*/
|
|
14
|
+
export declare function ContextMenu({ anchorPoint, contextual, ...props }: Props): import("react").JSX.Element;
|
|
15
|
+
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-
|
|
421
|
+
export declare const SIDEBAR_SERVICE_VERSION = "0.18.0-rc.13.022-rc1";
|
|
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:
|
|
@@ -273,6 +273,7 @@ export declare class SettingsClient {
|
|
|
273
273
|
private state;
|
|
274
274
|
private listeners;
|
|
275
275
|
private generation;
|
|
276
|
+
private writes;
|
|
276
277
|
subscribe: (listener: () => void) => (() => void);
|
|
277
278
|
getSnapshot: () => SettingsState;
|
|
278
279
|
private publish;
|
|
@@ -280,6 +281,7 @@ export declare class SettingsClient {
|
|
|
280
281
|
private post;
|
|
281
282
|
set(field: string, value: unknown): Promise<void>;
|
|
282
283
|
unset(field: string): Promise<void>;
|
|
284
|
+
step(field: 'fontSize' | 'lineHeight' | 'codeFontSize', delta: number, minimum: number, maximum: number): Promise<void>;
|
|
283
285
|
}
|
|
284
286
|
/** Required client services: slots (settings.section), locale, sessions (git bar, whale, archive, notifier), the slash-command registry, and the scope-addressed conversation face. */
|
|
285
287
|
export declare const inject: string[];
|
|
@@ -39,8 +39,9 @@
|
|
|
39
39
|
* @module dsh-ui-tweaks/client/notifier
|
|
40
40
|
*/
|
|
41
41
|
import type { ISessions } from '@deepseek-ai/dsh-api-session-controller/client';
|
|
42
|
-
import type {
|
|
42
|
+
import type { SessionStatusSnapshot } from '@deepseek-ai/dsh-client-ui-session/client';
|
|
43
43
|
import type { HostObservable } from '@deepseek-ai/dsh-client-ui-slots';
|
|
44
|
+
import type { SessionId } from '@deepseek-ai/dsh-session/types';
|
|
44
45
|
import type { TurnOutcomeValue } from '../../ui-tweaks/turn-outcome.ts';
|
|
45
46
|
declare module '@deepseek-ai/dsh-session-projection/types' {
|
|
46
47
|
interface SessionProjectionMap {
|
|
@@ -95,7 +96,8 @@ export interface TaskNotifierInput {
|
|
|
95
96
|
/** The client sessions service whose list feed carries the watch states. */
|
|
96
97
|
sessionsService: ISessions;
|
|
97
98
|
/** Current Session-scoped interactions, published separately from list rows. */
|
|
98
|
-
|
|
99
|
+
sessionStatus: HostObservable<SessionStatusSnapshot>;
|
|
100
|
+
openSession(sessionId: SessionId): void;
|
|
99
101
|
/** Localized copy snapshot used across the notifier's lifetime. */
|
|
100
102
|
text: NotifierText;
|
|
101
103
|
/** Fresh behavior switches + channel toggles, read on every tick. */
|
|
@@ -21,7 +21,7 @@ import type { ProjectionDefinition } from '@deepseek-ai/dsh-session-projection';
|
|
|
21
21
|
/** Projection key the browser notifier reads through list-row `projectionValues`. */
|
|
22
22
|
export declare const TURN_OUTCOME_PROJECTION_KEY = "dshTurnOutcome";
|
|
23
23
|
/** The stock `TurnEndReason` kinds (the map is merge-extensible upstream). */
|
|
24
|
-
export type TurnOutcomeKind = 'completed' | 'aborted' | 'blocked' | 'error' | 'max-tokens' | 'interrupted';
|
|
24
|
+
export type TurnOutcomeKind = 'completed' | 'aborted' | 'blocked' | 'error' | 'max-tokens' | 'interrupted' | 'forked';
|
|
25
25
|
/** Whole projection value: why the latest turn ended. */
|
|
26
26
|
export interface TurnOutcomeValue {
|
|
27
27
|
kind: TurnOutcomeKind;
|
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.13.022-rc1",
|
|
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": {
|
|
@@ -81,32 +81,32 @@
|
|
|
81
81
|
],
|
|
82
82
|
"license": "MIT",
|
|
83
83
|
"peerDependencies": {
|
|
84
|
-
"@deepseek-ai/cordis": "^4.0
|
|
85
|
-
"@deepseek-ai/dsh-agent": "
|
|
86
|
-
"@deepseek-ai/dsh-api-session-controller": "
|
|
87
|
-
"@deepseek-ai/dsh-api-workspace-controller": "
|
|
88
|
-
"@deepseek-ai/dsh-client-locale": "
|
|
89
|
-
"@deepseek-ai/dsh-client-ui-commands": "
|
|
90
|
-
"@deepseek-ai/dsh-client-ui-conversation": "
|
|
91
|
-
"@deepseek-ai/dsh-client-ui-primitives": "
|
|
92
|
-
"@deepseek-ai/dsh-client-ui-session": "
|
|
93
|
-
"@deepseek-ai/dsh-client-ui-settings": "
|
|
94
|
-
"@deepseek-ai/dsh-client-ui-slots": "
|
|
95
|
-
"@deepseek-ai/dsh-client-ui-workspace": "
|
|
96
|
-
"@deepseek-ai/dsh-host-webserver": "
|
|
97
|
-
"@deepseek-ai/dsh-
|
|
98
|
-
"@deepseek-ai/dsh-
|
|
99
|
-
"@deepseek-ai/dsh-session": "
|
|
100
|
-
"@deepseek-ai/dsh-
|
|
101
|
-
"@deepseek-ai/dsh-
|
|
102
|
-
"@deepseek-ai/dsh-
|
|
103
|
-
"@deepseek-ai/dsh-
|
|
104
|
-
"@deepseek-ai/dsh-
|
|
105
|
-
"@deepseek-ai/
|
|
106
|
-
"@deepseek-ai/schemastery": "^3.18.0",
|
|
84
|
+
"@deepseek-ai/cordis": "^4.1.0",
|
|
85
|
+
"@deepseek-ai/dsh-agent": "0.2.2-rc.1",
|
|
86
|
+
"@deepseek-ai/dsh-api-session-controller": "0.2.2-rc.1",
|
|
87
|
+
"@deepseek-ai/dsh-api-workspace-controller": "0.2.2-rc.1",
|
|
88
|
+
"@deepseek-ai/dsh-client-locale": "0.2.2-rc.1",
|
|
89
|
+
"@deepseek-ai/dsh-client-ui-commands": "0.2.2-rc.1",
|
|
90
|
+
"@deepseek-ai/dsh-client-ui-conversation": "0.2.2-rc.1",
|
|
91
|
+
"@deepseek-ai/dsh-client-ui-primitives": "0.2.2-rc.1",
|
|
92
|
+
"@deepseek-ai/dsh-client-ui-session": "0.2.2-rc.1",
|
|
93
|
+
"@deepseek-ai/dsh-client-ui-settings": "0.2.2-rc.1",
|
|
94
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.2.2-rc.1",
|
|
95
|
+
"@deepseek-ai/dsh-client-ui-workspace": "0.2.2-rc.1",
|
|
96
|
+
"@deepseek-ai/dsh-host-webserver": "0.2.2-rc.1",
|
|
97
|
+
"@deepseek-ai/dsh-llm": "0.2.2-rc.1",
|
|
98
|
+
"@deepseek-ai/dsh-session": "0.2.2-rc.1",
|
|
99
|
+
"@deepseek-ai/dsh-session-projection": "0.2.2-rc.1",
|
|
100
|
+
"@deepseek-ai/dsh-settings": "0.2.2-rc.1",
|
|
101
|
+
"@deepseek-ai/dsh-storage-domain": "0.2.2-rc.1",
|
|
102
|
+
"@deepseek-ai/dsh-subagent": "0.2.2-rc.1",
|
|
103
|
+
"@deepseek-ai/dsh-tools": "0.2.2-rc.1",
|
|
104
|
+
"@deepseek-ai/dsh-workspace": "0.2.2-rc.1",
|
|
105
|
+
"@deepseek-ai/schemastery": "^3.19.0",
|
|
107
106
|
"@huanlin/dsh-plugin-better-locale": "^0.1.0",
|
|
108
107
|
"react": "^18.2.0",
|
|
109
|
-
"react-dom": "^18.2.0"
|
|
108
|
+
"react-dom": "^18.2.0",
|
|
109
|
+
"@deepseek-ai/dsh-client-connection": "0.2.2-rc.1"
|
|
110
110
|
},
|
|
111
111
|
"peerDependenciesMeta": {
|
|
112
112
|
"@huanlin/dsh-plugin-better-locale": {
|
|
@@ -138,49 +138,48 @@
|
|
|
138
138
|
"@lezer/highlight": "^1.2.3",
|
|
139
139
|
"clsx": "^2.1.1",
|
|
140
140
|
"dompurify": "^3.4.14",
|
|
141
|
+
"@chatcode/cco-builtin-browser": "0.1.21",
|
|
141
142
|
"mermaid": "^11.16.1",
|
|
142
143
|
"node-pty": "1.2.0-beta.15",
|
|
143
144
|
"react-icons": "5.7.0",
|
|
144
145
|
"rxjs": "^7.8.2",
|
|
145
146
|
"schemastery": "^3.18.0",
|
|
146
147
|
"ws": "^8.18.0",
|
|
147
|
-
"yaml": "2.9.0"
|
|
148
|
-
"@chatcode/cco-builtin-browser": "0.1.21"
|
|
148
|
+
"yaml": "2.9.0"
|
|
149
149
|
},
|
|
150
150
|
"devDependencies": {
|
|
151
151
|
"@cordisjs/plugin-loader": "^1.0.0-rc.5",
|
|
152
|
-
"@deepseek-ai/cordis": "4.0
|
|
153
|
-
"@deepseek-ai/dsh-agent": "0.
|
|
154
|
-
"@deepseek-ai/dsh-attachment": "0.
|
|
155
|
-
"@deepseek-ai/dsh-api-session-controller": "0.
|
|
156
|
-
"@deepseek-ai/dsh-api-workspace-controller": "0.
|
|
157
|
-
"@deepseek-ai/dsh-client-locale": "0.
|
|
158
|
-
"@deepseek-ai/dsh-client-store": "0.
|
|
159
|
-
"@deepseek-ai/dsh-client-ui-commands": "
|
|
160
|
-
"@deepseek-ai/dsh-client-ui-conversation": "0.
|
|
161
|
-
"@deepseek-ai/dsh-client-ui-primitives": "0.
|
|
162
|
-
"@deepseek-ai/dsh-client-ui-session": "0.
|
|
163
|
-
"@deepseek-ai/dsh-client-ui-settings": "0.
|
|
164
|
-
"@deepseek-ai/dsh-client-ui-slots": "0.
|
|
165
|
-
"@deepseek-ai/dsh-client-ui-workspace": "0.
|
|
152
|
+
"@deepseek-ai/cordis": "4.1.0",
|
|
153
|
+
"@deepseek-ai/dsh-agent": "0.2.2-rc.1",
|
|
154
|
+
"@deepseek-ai/dsh-attachment": "0.2.2-rc.1",
|
|
155
|
+
"@deepseek-ai/dsh-api-session-controller": "0.2.2-rc.1",
|
|
156
|
+
"@deepseek-ai/dsh-api-workspace-controller": "0.2.2-rc.1",
|
|
157
|
+
"@deepseek-ai/dsh-client-locale": "0.2.2-rc.1",
|
|
158
|
+
"@deepseek-ai/dsh-client-store": "0.2.2-rc.1",
|
|
159
|
+
"@deepseek-ai/dsh-client-ui-commands": "0.2.2-rc.1",
|
|
160
|
+
"@deepseek-ai/dsh-client-ui-conversation": "0.2.2-rc.1",
|
|
161
|
+
"@deepseek-ai/dsh-client-ui-primitives": "0.2.2-rc.1",
|
|
162
|
+
"@deepseek-ai/dsh-client-ui-session": "0.2.2-rc.1",
|
|
163
|
+
"@deepseek-ai/dsh-client-ui-settings": "0.2.2-rc.1",
|
|
164
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.2.2-rc.1",
|
|
165
|
+
"@deepseek-ai/dsh-client-ui-workspace": "0.2.2-rc.1",
|
|
166
166
|
"@deepseek-ai/dsh-code-runtime": "0.1.1-rc.1",
|
|
167
|
-
"@deepseek-ai/dsh-host-webserver": "0.
|
|
168
|
-
"@deepseek-ai/dsh-
|
|
169
|
-
"@deepseek-ai/dsh-
|
|
170
|
-
"@deepseek-ai/dsh-
|
|
171
|
-
"@deepseek-ai/dsh-session": "0.
|
|
172
|
-
"@deepseek-ai/dsh-session-
|
|
173
|
-
"@deepseek-ai/dsh-
|
|
174
|
-
"@deepseek-ai/dsh-
|
|
175
|
-
"@deepseek-ai/dsh-storage": "
|
|
176
|
-
"@deepseek-ai/dsh-
|
|
177
|
-
"@deepseek-ai/dsh-
|
|
178
|
-
"@deepseek-ai/dsh-
|
|
179
|
-
"@deepseek-ai/dsh-
|
|
180
|
-
"@deepseek-ai/dsh-
|
|
181
|
-
"@deepseek-ai/dsh-
|
|
182
|
-
"@deepseek-ai/
|
|
183
|
-
"@deepseek-ai/schemastery": "^3.18.0",
|
|
167
|
+
"@deepseek-ai/dsh-host-webserver": "0.2.2-rc.1",
|
|
168
|
+
"@deepseek-ai/dsh-llm": "0.2.2-rc.1",
|
|
169
|
+
"@deepseek-ai/dsh-scope": "0.2.2-rc.1",
|
|
170
|
+
"@deepseek-ai/dsh-session": "0.2.2-rc.1",
|
|
171
|
+
"@deepseek-ai/dsh-session-persistence": "0.2.2-rc.1",
|
|
172
|
+
"@deepseek-ai/dsh-session-projection": "0.2.2-rc.1",
|
|
173
|
+
"@deepseek-ai/dsh-settings": "0.2.2-rc.1",
|
|
174
|
+
"@deepseek-ai/dsh-storage": "0.2.2-rc.1",
|
|
175
|
+
"@deepseek-ai/dsh-storage-domain": "0.2.2-rc.1",
|
|
176
|
+
"@deepseek-ai/dsh-subagent": "0.2.2-rc.1",
|
|
177
|
+
"@deepseek-ai/dsh-system-prompt": "0.2.2-rc.1",
|
|
178
|
+
"@deepseek-ai/dsh-tools": "0.2.2-rc.1",
|
|
179
|
+
"@deepseek-ai/dsh-user-approval": "0.2.2-rc.1",
|
|
180
|
+
"@deepseek-ai/dsh-util-time": "0.2.2-rc.1",
|
|
181
|
+
"@deepseek-ai/dsh-workspace": "0.2.2-rc.1",
|
|
182
|
+
"@deepseek-ai/schemastery": "3.19.0",
|
|
184
183
|
"@huanlin/dsh-plugin-better-locale": "^0.1.0",
|
|
185
184
|
"@playwright/test": "^1.62.1",
|
|
186
185
|
"@types/node": "^24.0.0",
|
|
@@ -198,7 +197,8 @@
|
|
|
198
197
|
"typescript": "^5.6.0",
|
|
199
198
|
"unrun": "^0.2.39",
|
|
200
199
|
"vitest": "^4.1.8",
|
|
201
|
-
"zod": "^4.4.3"
|
|
200
|
+
"zod": "^4.4.3",
|
|
201
|
+
"@deepseek-ai/dsh-client-connection": "0.2.2-rc.1"
|
|
202
202
|
},
|
|
203
203
|
"scripts": {
|
|
204
204
|
"build": "node -e \"require('node:fs').rmSync('lib',{recursive:true,force:true})\" && tsc -p tsconfig.build.json && tsdown",
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Bottom-left account control.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
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
|
-
|
|
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
|
-
{
|
|
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
|
+
}
|
package/src/client/FileTree.tsx
CHANGED
|
@@ -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 {
|
|
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
|
-
|
|
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
|
-
<
|
|
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
|
-
|
|
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
|
-
<
|
|
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
|
-
|
|
284
|
+
contextual
|
|
285
|
+
anchorPoint={menu ?? undefined}
|
|
285
286
|
anchor={<span />}
|
|
286
287
|
/>
|
|
287
288
|
</div>
|
package/src/client/GitView.tsx
CHANGED
|
@@ -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,
|
|
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
|
-
<
|
|
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
|
-
|
|
636
|
+
contextual
|
|
637
|
+
anchorPoint={fileMenu ?? undefined}
|
|
636
638
|
anchor={<span />}
|
|
637
639
|
/>
|
|
638
640
|
|
|
639
641
|
{/* The shared history-row context menu. */}
|
|
640
|
-
<
|
|
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
|
-
|
|
694
|
+
contextual
|
|
695
|
+
anchorPoint={historyMenu ?? undefined}
|
|
693
696
|
anchor={<span />}
|
|
694
697
|
/>
|
|
695
698
|
|
package/src/client/Sidebar.tsx
CHANGED
|
@@ -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
|
package/src/client/TabBar.tsx
CHANGED
|
@@ -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
|
-
<
|
|
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
|
-
<
|
|
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
|
-
|
|
357
|
+
contextual
|
|
358
|
+
anchorPoint={tabMenu ?? undefined}
|
|
358
359
|
anchor={<span />}
|
|
359
360
|
/>
|
|
360
361
|
</div>
|