@molecule/app-ide-react 1.20.1 → 1.20.3
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/dist/components/BackgroundTasksStrip.d.ts +6 -3
- package/dist/components/BackgroundTasksStrip.d.ts.map +1 -1
- package/dist/components/BackgroundTasksStrip.js +18 -10
- package/dist/components/BackgroundTasksStrip.js.map +1 -1
- package/dist/components/ChatPanel.d.ts.map +1 -1
- package/dist/components/ChatPanel.js +97 -117
- package/dist/components/ChatPanel.js.map +1 -1
- package/dist/components/DockStrip.d.ts +55 -0
- package/dist/components/DockStrip.d.ts.map +1 -0
- package/dist/components/DockStrip.js +90 -0
- package/dist/components/DockStrip.js.map +1 -0
- package/dist/components/PlanCard.d.ts +26 -0
- package/dist/components/PlanCard.d.ts.map +1 -0
- package/dist/components/PlanCard.js +58 -0
- package/dist/components/PlanCard.js.map +1 -0
- package/dist/components/TestStatusBar.d.ts.map +1 -1
- package/dist/components/TestStatusBar.js +13 -42
- package/dist/components/TestStatusBar.js.map +1 -1
- package/dist/components/ToolCallCard.d.ts.map +1 -1
- package/dist/components/ToolCallCard.js +22 -47
- package/dist/components/ToolCallCard.js.map +1 -1
- package/dist/components/WorkCard.d.ts +14 -0
- package/dist/components/WorkCard.d.ts.map +1 -0
- package/dist/components/WorkCard.js +23 -0
- package/dist/components/WorkCard.js.map +1 -0
- package/dist/components/tool-call-utilities.d.ts.map +1 -1
- package/dist/components/tool-call-utilities.js +7 -0
- package/dist/components/tool-call-utilities.js.map +1 -1
- package/package.json +2 -2
|
@@ -7,11 +7,14 @@ import type { BackgroundTaskState } from '@molecule/app-ai-chat';
|
|
|
7
7
|
* `exec_command` with `run_in_background` returns a handle immediately, so the
|
|
8
8
|
* tool call's own card goes green while the command is still running — a test
|
|
9
9
|
* suite can be four minutes from its verdict with nothing on screen saying so.
|
|
10
|
-
* This strip is the one place that state is visible: what is
|
|
11
|
-
* it has been running, and how
|
|
10
|
+
* This strip is the one place that state is visible: what each one is for, how
|
|
11
|
+
* long it has been running, and how it ended.
|
|
12
|
+
*
|
|
13
|
+
* @param props - Component props.
|
|
14
|
+
* @param props.tasks - Every background command of the current turn, newest last.
|
|
15
|
+
* @returns The strip, or nothing when no task was started.
|
|
12
16
|
*/
|
|
13
17
|
export declare function BackgroundTasksStrip({ tasks, }: {
|
|
14
|
-
/** Every background command of the current turn, newest last. */
|
|
15
18
|
tasks: BackgroundTaskState[];
|
|
16
19
|
}): JSX.Element | null;
|
|
17
20
|
//# sourceMappingURL=BackgroundTasksStrip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackgroundTasksStrip.d.ts","sourceRoot":"","sources":["../../src/components/BackgroundTasksStrip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAuB,MAAM,OAAO,CAAA;AAErD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"BackgroundTasksStrip.d.ts","sourceRoot":"","sources":["../../src/components/BackgroundTasksStrip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAuB,MAAM,OAAO,CAAA;AAErD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAMhE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,KAAK,GACN,EAAE;IACD,KAAK,EAAE,mBAAmB,EAAE,CAAA;CAC7B,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CA2FrB"}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
3
|
import { t } from '@molecule/app-i18n';
|
|
4
4
|
import { getClassMap } from '@molecule/app-ui';
|
|
5
|
-
import {
|
|
5
|
+
import { DockStrip, StatusMark } from './DockStrip.js';
|
|
6
6
|
/**
|
|
7
7
|
* The commands running in the sandbox that outlived the tool call that started
|
|
8
8
|
* them.
|
|
@@ -10,8 +10,12 @@ import { Icon } from '@molecule/app-ui-react';
|
|
|
10
10
|
* `exec_command` with `run_in_background` returns a handle immediately, so the
|
|
11
11
|
* tool call's own card goes green while the command is still running — a test
|
|
12
12
|
* suite can be four minutes from its verdict with nothing on screen saying so.
|
|
13
|
-
* This strip is the one place that state is visible: what is
|
|
14
|
-
* it has been running, and how
|
|
13
|
+
* This strip is the one place that state is visible: what each one is for, how
|
|
14
|
+
* long it has been running, and how it ended.
|
|
15
|
+
*
|
|
16
|
+
* @param props - Component props.
|
|
17
|
+
* @param props.tasks - Every background command of the current turn, newest last.
|
|
18
|
+
* @returns The strip, or nothing when no task was started.
|
|
15
19
|
*/
|
|
16
20
|
export function BackgroundTasksStrip({ tasks, }) {
|
|
17
21
|
const cm = getClassMap();
|
|
@@ -33,13 +37,17 @@ export function BackgroundTasksStrip({ tasks, }) {
|
|
|
33
37
|
: failed.length > 0
|
|
34
38
|
? t('ide.chat.backgroundFailed', { count: failed.length }, { defaultValue: '{{count}} background task failed' })
|
|
35
39
|
: t('ide.chat.backgroundDone', { count: tasks.length }, { defaultValue: '{{count}} background task finished' });
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
// Collapsed, name what the strip is about: the purpose of the task in flight.
|
|
41
|
+
const lead = running[0] ?? failed[0];
|
|
42
|
+
return (_jsx(DockStrip, { molId: "chat-background-tasks", toggleMolId: "chat-background-tasks-toggle", expanded: expanded, onToggle: () => setExpanded((open) => !open), icon: _jsx(StatusMark, { state: running.length > 0 ? 'active' : failed.length > 0 ? 'failed' : 'done', size: 14 }), label: summary, hint: !expanded && lead ? `· ${purpose(lead)}` : undefined, children: _jsx("ul", { style: { listStyle: 'none', margin: 0, padding: 0 }, children: tasks.map((task) => (_jsxs("li", { "data-mol-id": "chat-background-task", className: cm.textSize('xs'), style: { display: 'flex', alignItems: 'flex-start', gap: 8, padding: '3px 0' }, children: [_jsx("span", { style: { flexShrink: 0, display: 'inline-flex', paddingTop: 1 }, children: _jsx(StatusMark, { state: task.status === 'running'
|
|
43
|
+
? 'active'
|
|
44
|
+
: task.status === 'failed'
|
|
45
|
+
? 'failed'
|
|
46
|
+
: 'done', size: 14 }) }), _jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [_jsx("div", { children: purpose(task) }), task.description ? (_jsx("code", { className: cm.textMuted, style: { display: 'block', whiteSpace: 'pre-wrap', overflowWrap: 'anywhere' }, children: task.command })) : null] }), _jsx("span", { className: cm.textMuted, style: { flexShrink: 0, whiteSpace: 'nowrap' }, children: describe(task) })] }, task.id))) }) }));
|
|
47
|
+
}
|
|
48
|
+
/** What a task is for: the executor's own reason, else the command itself. */
|
|
49
|
+
function purpose(task) {
|
|
50
|
+
return task.description ?? task.command;
|
|
43
51
|
}
|
|
44
52
|
/** The right-hand status for one command: how long it ran, and how it ended. */
|
|
45
53
|
function describe(task) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackgroundTasksStrip.js","sourceRoot":"","sources":["../../src/components/BackgroundTasksStrip.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAY,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAGrD,OAAO,EAAE,CAAC,EAAE,MAAM,oBAAoB,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"BackgroundTasksStrip.js","sourceRoot":"","sources":["../../src/components/BackgroundTasksStrip.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAY,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAGrD,OAAO,EAAE,CAAC,EAAE,MAAM,oBAAoB,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE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B,oBAAoB,EACpB,wBAA+B,EAC/B,cAAc,EAAE,wBAAwB,EACxC,OAAO,EAAE,iBAAiB,EAC1B,gBAAgB,EAAE,0BAA0B,EAC5C,eAAe,EAAE,qBAAqB,EACtC,gBAAgB,EAAE,sBAAsB,EACxC,kBAAkB,EAAE,wBAAwB,EAC5C,oBAAoB,EACpB,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,0BAA0B,EAC1B,2BAA2B,EAC3B,cAAc,EACd,iBAAiB,EACjB,KAAK,EACL,WAAW,EACX,OAAc,EACd,QAAQ,EACR,eAAe,EACf,uBAAuB,EACvB,UAAU,EACV,SAAS,EACT,WAAW,EACX,OAAO,EACP,aAAa,EACb,WAAW,EACX,SAAS,EACT,QAAQ,EACR,WAAW,EACX,cAAc,EACd,YAAY,EACZ,SAAS,GACV,EAAE,cAAc,GAAG,GAAG,CAAC,OAAO,CAkd9B;yBAhhBe,SAAS"}
|
|
@@ -37,9 +37,11 @@ import { getChatTimestampsVisible, parseTimestampsCommand, planChatTimestamps, r
|
|
|
37
37
|
import { ENTRY_TIP, pickIdleTip, shouldShowIdleTip, TIP_IDLE_MS, TIP_MIN_MESSAGES, } from './chat-tips-utilities.js';
|
|
38
38
|
import { ChatItemBoundary } from './ChatItemBoundary.js';
|
|
39
39
|
import { ChatTimestamp } from './ChatTimestamp.js';
|
|
40
|
+
import { DockStrip } from './DockStrip.js';
|
|
40
41
|
import { HelpCard } from './HelpCard.js';
|
|
41
42
|
import { Icon } from './Icon.js';
|
|
42
43
|
import { isAllowedLinkHref, MarkdownContent } from './MarkdownContent.js';
|
|
44
|
+
import { latestPlan, PlanCard } from './PlanCard.js';
|
|
43
45
|
import { RelevantSkillSuggestion } from './RelevantSkillSuggestion.js';
|
|
44
46
|
import { ReportModal } from './ReportModal.js';
|
|
45
47
|
import { ScriptsCard } from './ScriptsCard.js';
|
|
@@ -55,6 +57,7 @@ import { TipCard } from './TipCard.js';
|
|
|
55
57
|
import { readFilePaths, str } from './tool-call-utilities.js';
|
|
56
58
|
import { ToolCallCard } from './ToolCallCard.js';
|
|
57
59
|
import { UserAvatar } from './UserAvatar.js';
|
|
60
|
+
import { WorkCard } from './WorkCard.js';
|
|
58
61
|
const logger = getLogger('chat-panel');
|
|
59
62
|
// Every region the picker can offer: the flag's country code (resolved via the
|
|
60
63
|
// bonded @molecule/app-country-flags set) + the English fallback for its i18n
|
|
@@ -5992,6 +5995,17 @@ function ChatInner({ projectId, endpoint, initialMessage, onInitialMessageSent,
|
|
|
5992
5995
|
return (_jsxs(_Fragment, { children: [_jsx(ChatTimestamp, { timestamp: slot.timestamp, variant: "line", align: slot.align }), node] }));
|
|
5993
5996
|
};
|
|
5994
5997
|
const bgCommands = useMemo(() => backgroundTaskCommands(messages), [messages]);
|
|
5998
|
+
const plan = useMemo(() => latestPlan(messages), [messages]);
|
|
5999
|
+
// Everything about the work in flight shares one card above the composer. The
|
|
6000
|
+
// tests strip also shows for a read-only viewer (watching is not editing); the
|
|
6001
|
+
// files strip does not (committing is editor work). Popups hide the card.
|
|
6002
|
+
const showTests = testsBarVisible && shouldShowTestsBar(testsRun, testsList);
|
|
6003
|
+
const showFiles = canEdit !== false && pendingFiles != null && pendingFiles.length > 0;
|
|
6004
|
+
const workVisible = !commandMenu &&
|
|
6005
|
+
!modelPicker &&
|
|
6006
|
+
!effortPicker &&
|
|
6007
|
+
!panelOverlay &&
|
|
6008
|
+
(plan.length > 0 || backgroundTasks.length > 0 || showTests || showFiles);
|
|
5995
6009
|
// ── Render ─────────────────────────────────────────────────────────────────
|
|
5996
6010
|
const root = (_jsxs("div", { style: {
|
|
5997
6011
|
display: 'flex',
|
|
@@ -6244,7 +6258,7 @@ function ChatInner({ projectId, endpoint, initialMessage, onInitialMessageSent,
|
|
|
6244
6258
|
pointerEvents: showActivity ? 'auto' : 'none',
|
|
6245
6259
|
transition: 'opacity 0.18s ease-out',
|
|
6246
6260
|
}, children: showActivity && (_jsx(StreamingIndicator, { label: label, tokens: streamingLike ? turnTokens : undefined, startedAt: streamingLike ? turnStartedAt : undefined })) }));
|
|
6247
|
-
})(), _jsx("div", { ref: messagesEndRef })] }),
|
|
6261
|
+
})(), _jsx("div", { ref: messagesEndRef })] }), autoFixCountdown && (_jsxs("div", { className: cm.cn(cm.shrink0, cm.borderT), style: {
|
|
6248
6262
|
display: 'flex',
|
|
6249
6263
|
alignItems: 'center',
|
|
6250
6264
|
gap: 8,
|
|
@@ -7528,45 +7542,11 @@ function ChatInner({ projectId, endpoint, initialMessage, onInitialMessageSent,
|
|
|
7528
7542
|
}, onMouseLeave: (e) => {
|
|
7529
7543
|
e.currentTarget.style.opacity = '0.7';
|
|
7530
7544
|
e.currentTarget.style.background = 'none';
|
|
7531
|
-
}, children: _jsx("svg", { width: "13", height: "13", viewBox: "0 0 12 12", style: { display: 'block' }, children: _jsx("path", { d: "M 2.5,6.5 L 6,3 L 9.5,6.5 M 6,3.5 L 6,10", fill: "none", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" }) }) }))] }, qm.id))) })] })),
|
|
7532
|
-
|
|
7533
|
-
|
|
7534
|
-
|
|
7535
|
-
|
|
7536
|
-
!panelOverlay && (_jsx(TestStatusBar, { run: testsRun, tests: testsList, expanded: testsBarExpanded, onToggle: () => setTestsBarExpanded((v) => !v), onOpen: () => openTestsBrowser(''), onStop: testsRun.running ? cancelTestsRun : undefined })), canEdit !== false &&
|
|
7537
|
-
pendingFiles != null &&
|
|
7538
|
-
pendingFiles.length > 0 &&
|
|
7539
|
-
!commandMenu &&
|
|
7540
|
-
!modelPicker &&
|
|
7541
|
-
!effortPicker &&
|
|
7542
|
-
!panelOverlay && (_jsxs("div", { style: {
|
|
7543
|
-
borderTop: '1px solid rgba(128,128,128,0.15)',
|
|
7544
|
-
// Equal top/right/bottom (8px) so the commit button — flush to the
|
|
7545
|
-
// right edge via the row's space-between — has the same gap on its
|
|
7546
|
-
// top, right, and bottom (P5-05). Left stays 10px so the chevron +
|
|
7547
|
-
// "N uncommitted files" text keep their indent. The green
|
|
7548
|
-
// AutoCommitBadge (inline) shares this slot + box model, so it
|
|
7549
|
-
// inherits the identical margins and sits in the same spot.
|
|
7550
|
-
padding: '8px 8px 8px 10px',
|
|
7551
|
-
}, children: [_jsxs("div", { role: "button", tabIndex: 0, onClick: () => setCommitBarExpanded((v) => !v), onKeyDown: (e) => {
|
|
7552
|
-
if (e.key === 'Enter' || e.key === ' ') {
|
|
7553
|
-
e.preventDefault();
|
|
7554
|
-
setCommitBarExpanded((v) => !v);
|
|
7555
|
-
}
|
|
7556
|
-
}, style: {
|
|
7557
|
-
display: 'flex',
|
|
7558
|
-
alignItems: 'center',
|
|
7559
|
-
justifyContent: 'space-between',
|
|
7560
|
-
cursor: 'pointer',
|
|
7561
|
-
}, children: [_jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 4 }, children: [_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 16 16", width: "12", height: "12", style: {
|
|
7562
|
-
transform: commitBarExpanded ? 'rotate(90deg)' : 'rotate(0deg)',
|
|
7563
|
-
transition: 'transform 120ms',
|
|
7564
|
-
opacity: 0.5,
|
|
7565
|
-
}, children: _jsx("path", { d: "M6 4l4 4-4 4", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }), _jsx("span", { className: cm.cn(cm.textMuted, cm.textSize('xs')), children: commitState?.status === 'committed'
|
|
7566
|
-
? stripCommitCoauthorTrailer(commitState.message ?? '')
|
|
7567
|
-
: commitState?.status === 'error'
|
|
7568
|
-
? t('ide.chat.commitFailed')
|
|
7569
|
-
: t('ide.chat.uncommittedFileCount', { count: pendingFiles.length }, { defaultValue: '{{count}} uncommitted files' }) })] }), isAutoCommitEnabled(autoCommit) &&
|
|
7545
|
+
}, children: _jsx("svg", { width: "13", height: "13", viewBox: "0 0 12 12", style: { display: 'block' }, children: _jsx("path", { d: "M 2.5,6.5 L 6,3 L 9.5,6.5 M 6,3.5 L 6,10", fill: "none", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" }) }) }))] }, qm.id))) })] })), workVisible && (_jsxs(WorkCard, { children: [_jsx(PlanCard, { todos: plan }), _jsx(BackgroundTasksStrip, { tasks: backgroundTasks }), showTests && (_jsx(TestStatusBar, { run: testsRun, tests: testsList, expanded: testsBarExpanded, onToggle: () => setTestsBarExpanded((v) => !v), onOpen: () => openTestsBrowser(''), onStop: testsRun.running ? cancelTestsRun : undefined })), showFiles && pendingFiles != null && (_jsx(DockStrip, { molId: "chat-commit-bar", toggleMolId: "chat-commit-toggle", expanded: commitBarExpanded, onToggle: () => setCommitBarExpanded((v) => !v), label: commitState?.status === 'committed'
|
|
7546
|
+
? stripCommitCoauthorTrailer(commitState.message ?? '')
|
|
7547
|
+
: commitState?.status === 'error'
|
|
7548
|
+
? t('ide.chat.commitFailed')
|
|
7549
|
+
: t('ide.chat.uncommittedFileCount', { count: pendingFiles.length }, { defaultValue: '{{count}} uncommitted files' }), actions: _jsx(_Fragment, { children: isAutoCommitEnabled(autoCommit) &&
|
|
7570
7550
|
commitState?.status !== 'committing' &&
|
|
7571
7551
|
commitState?.status !== 'committed' ? (_jsx(AutoCommitBadge, { state: autoCommit, disabled: autoCommitHeld, onCommitNow: () => {
|
|
7572
7552
|
// Pause the countdown before committing so a due auto-fire
|
|
@@ -7595,83 +7575,83 @@ function ChatInner({ projectId, endpoint, initialMessage, onInitialMessageSent,
|
|
|
7595
7575
|
className: cm.cn(cm.button({ variant: 'solid', color: 'primary', size: 'xs' }), cm.touchTargetCompact), children: commitState?.status === 'committing'
|
|
7596
7576
|
? t('ide.chat.committing')
|
|
7597
7577
|
: t('ide.chat.commit') }));
|
|
7598
|
-
})())
|
|
7599
|
-
|
|
7600
|
-
|
|
7601
|
-
|
|
7602
|
-
|
|
7603
|
-
|
|
7604
|
-
|
|
7605
|
-
|
|
7606
|
-
|
|
7607
|
-
|
|
7608
|
-
|
|
7609
|
-
|
|
7610
|
-
|
|
7611
|
-
|
|
7612
|
-
|
|
7613
|
-
|
|
7614
|
-
|
|
7615
|
-
|
|
7616
|
-
|
|
7617
|
-
|
|
7618
|
-
|
|
7619
|
-
|
|
7620
|
-
|
|
7621
|
-
|
|
7622
|
-
|
|
7623
|
-
|
|
7624
|
-
|
|
7625
|
-
|
|
7626
|
-
|
|
7627
|
-
|
|
7628
|
-
|
|
7629
|
-
|
|
7630
|
-
|
|
7631
|
-
|
|
7632
|
-
|
|
7633
|
-
|
|
7634
|
-
|
|
7635
|
-
|
|
7636
|
-
|
|
7637
|
-
|
|
7638
|
-
|
|
7639
|
-
|
|
7640
|
-
|
|
7641
|
-
|
|
7642
|
-
|
|
7643
|
-
|
|
7644
|
-
|
|
7645
|
-
|
|
7646
|
-
|
|
7647
|
-
|
|
7648
|
-
|
|
7649
|
-
|
|
7650
|
-
|
|
7651
|
-
|
|
7652
|
-
|
|
7653
|
-
|
|
7654
|
-
|
|
7655
|
-
|
|
7656
|
-
|
|
7657
|
-
|
|
7658
|
-
|
|
7659
|
-
|
|
7660
|
-
|
|
7661
|
-
|
|
7662
|
-
|
|
7663
|
-
|
|
7664
|
-
|
|
7665
|
-
|
|
7666
|
-
|
|
7667
|
-
|
|
7668
|
-
|
|
7669
|
-
|
|
7670
|
-
|
|
7671
|
-
|
|
7672
|
-
|
|
7673
|
-
|
|
7674
|
-
|
|
7578
|
+
})()) }), children: _jsx("div", { style: { maxHeight: 200, overflowY: 'auto' }, children: pendingFiles.map((f) => (_jsxs("button", { type: "button", onClick: () => onFileDiff?.(f.path), onMouseEnter: (e) => {
|
|
7579
|
+
// Theme PRIMARY token, not a literal blue — the row sits in
|
|
7580
|
+
// the same bar as the commit button, which is now primary.
|
|
7581
|
+
e.currentTarget.style.color = 'var(--mol-color-primary, #4070e0)';
|
|
7582
|
+
}, onMouseLeave: (e) => {
|
|
7583
|
+
e.currentTarget.style.color = '';
|
|
7584
|
+
}, style: {
|
|
7585
|
+
display: 'flex',
|
|
7586
|
+
alignItems: 'center',
|
|
7587
|
+
gap: 6,
|
|
7588
|
+
background: 'none',
|
|
7589
|
+
border: 'none',
|
|
7590
|
+
padding: '1px 0',
|
|
7591
|
+
// Touch: ~15px rows are untappable — 32px is the floor for
|
|
7592
|
+
// these dense file rows.
|
|
7593
|
+
...(isCoarse ? { minHeight: 32 } : {}),
|
|
7594
|
+
cursor: onFileDiff ? 'pointer' : 'default',
|
|
7595
|
+
fontFamily: "'SF Mono', 'Fira Code', monospace",
|
|
7596
|
+
fontSize: 11,
|
|
7597
|
+
color: 'inherit',
|
|
7598
|
+
opacity: 0.7,
|
|
7599
|
+
textAlign: 'left',
|
|
7600
|
+
width: '100%',
|
|
7601
|
+
overflow: 'hidden',
|
|
7602
|
+
whiteSpace: 'nowrap',
|
|
7603
|
+
}, className: cm.textMuted, children: [_jsx("span", { style: { overflow: 'hidden', textOverflow: 'ellipsis' }, children: f.path }), (!!f.additions || !!f.deletions) && (_jsxs("span", { style: { marginLeft: 'auto', flexShrink: 0, fontSize: 10, opacity: 0.8 }, children: [!!f.additions && (_jsxs("span", { style: { color: '#3fb950' }, children: ["+", f.additions] })), !!f.additions && !!f.deletions && ' ', !!f.deletions && (_jsxs("span", { style: { color: '#f85149' }, children: ["-", f.deletions] }))] })), onFileRevert && (_jsx("span", {
|
|
7604
|
+
/* mol-bespoke-button: icon-only per-file revert affordance — 18px (32px coarse) hit box on a dense file row */
|
|
7605
|
+
role: "button", tabIndex: 0, title: t('ide.chat.revertFile', undefined, {
|
|
7606
|
+
defaultValue: 'Revert to last commit',
|
|
7607
|
+
}), onClick: (e) => {
|
|
7608
|
+
e.stopPropagation();
|
|
7609
|
+
// Revert file to last committed state (handles modified, new, and deleted files)
|
|
7610
|
+
http
|
|
7611
|
+
.post(`/projects/${projectId}/git-revert`, { path: f.path })
|
|
7612
|
+
.then(() => {
|
|
7613
|
+
refreshGitStatus();
|
|
7614
|
+
// Refresh editor if the file is open — fetch fresh content for modified/restored,
|
|
7615
|
+
// or close if it was a new file that got deleted
|
|
7616
|
+
if (f.status === 'untracked' || f.status === 'added') {
|
|
7617
|
+
onFileDeleted?.(f.path);
|
|
7618
|
+
}
|
|
7619
|
+
else {
|
|
7620
|
+
// Re-fetch file content from sandbox to update editor
|
|
7621
|
+
http
|
|
7622
|
+
.get(`/projects/${projectId}/files/${f.path}`)
|
|
7623
|
+
.then((res) => onFileChange?.(f.path, res.data.content))
|
|
7624
|
+
.catch(() => {
|
|
7625
|
+
/* ignore */
|
|
7626
|
+
});
|
|
7627
|
+
}
|
|
7628
|
+
})
|
|
7629
|
+
.catch(() => {
|
|
7630
|
+
/* ignore */
|
|
7631
|
+
});
|
|
7632
|
+
}, onKeyDown: (e) => {
|
|
7633
|
+
if (e.key === 'Enter' || e.key === ' ')
|
|
7634
|
+
e.currentTarget.click();
|
|
7635
|
+
}, onMouseEnter: (e) => {
|
|
7636
|
+
e.currentTarget.style.background = 'rgba(128,128,128,0.2)';
|
|
7637
|
+
e.currentTarget.style.opacity = '1';
|
|
7638
|
+
}, onMouseLeave: (e) => {
|
|
7639
|
+
e.currentTarget.style.background = 'transparent';
|
|
7640
|
+
e.currentTarget.style.opacity = '0.5';
|
|
7641
|
+
}, style: {
|
|
7642
|
+
display: 'inline-flex',
|
|
7643
|
+
alignItems: 'center',
|
|
7644
|
+
justifyContent: 'center',
|
|
7645
|
+
// Touch: 32px hit box (dense-row floor); glyph unchanged.
|
|
7646
|
+
width: isCoarse ? 32 : 18,
|
|
7647
|
+
height: isCoarse ? 32 : 18,
|
|
7648
|
+
borderRadius: 3,
|
|
7649
|
+
flexShrink: 0,
|
|
7650
|
+
cursor: 'pointer',
|
|
7651
|
+
opacity: 0.5,
|
|
7652
|
+
transition: 'opacity 100ms, background 100ms',
|
|
7653
|
+
...(!(f.additions || f.deletions) ? { marginLeft: 'auto' } : {}),
|
|
7654
|
+
}, children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 16 16", width: "12", height: "12", fill: "currentColor", children: _jsx("path", { d: "M1.22 6.28a.749.749 0 0 1 0-1.06l3.5-3.5a.749.749 0 1 1 1.06 1.06L3.561 5h7.188l.001.007L10.749 5c.058 0 .116.007.171.019A4.501 4.501 0 0 1 10.5 14H8.796a.75.75 0 0 1 0-1.5H10.5a3 3 0 1 0 0-6H3.561L5.78 8.72a.749.749 0 1 1-1.06 1.06l-3.5-3.5Z" }) }) }))] }, f.path))) }) }))] })), _jsxs("div", { className: cm.surfaceSecondary, ...(canEdit === false ? { 'data-mol-viewer': '' } : {}), style: {
|
|
7675
7655
|
// Round the TOP corners only (8px) so the composer reads as a self-contained
|
|
7676
7656
|
// input with its own border on all sides, flush at the bottom-left/right with
|
|
7677
7657
|
// the panel's bottom edge. Discovery rounds ALL FOUR corners (the centered
|