@brimveyn/aimux 1.22.0 → 1.22.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/package.json
CHANGED
|
@@ -13,12 +13,25 @@ export async function runCli(
|
|
|
13
13
|
timeoutMs: number = DEFAULT_TIMEOUT_MS,
|
|
14
14
|
cwd?: string
|
|
15
15
|
): Promise<CliResult> {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
let proc: Bun.Subprocess<'ignore', 'pipe', 'pipe'>
|
|
17
|
+
try {
|
|
18
|
+
proc = Bun.spawn([command, ...args], {
|
|
19
|
+
cwd,
|
|
20
|
+
stderr: 'pipe',
|
|
21
|
+
stdin: 'ignore',
|
|
22
|
+
stdout: 'pipe',
|
|
23
|
+
})
|
|
24
|
+
} catch (error) {
|
|
25
|
+
// posix_spawn throws — synchronously — for a missing binary AND for a cwd
|
|
26
|
+
// that no longer exists (a deleted project dir or a pruned worktree), and
|
|
27
|
+
// it names the binary in both. Uncaught, that took the whole app down.
|
|
28
|
+
return {
|
|
29
|
+
error: `${command}: ${String(error)}`.slice(0, 200),
|
|
30
|
+
ok: false,
|
|
31
|
+
stderr: '',
|
|
32
|
+
stdout: '',
|
|
33
|
+
}
|
|
34
|
+
}
|
|
22
35
|
|
|
23
36
|
const timeout = setTimeout(() => {
|
|
24
37
|
try {
|
|
@@ -8,7 +8,7 @@ import { selectPrRowVisible, usePrStatusStore } from '../../../../state/pr-statu
|
|
|
8
8
|
import { useTheme, useTransparent } from '../../../theme'
|
|
9
9
|
import { PrStateRow } from './pr-state-row'
|
|
10
10
|
|
|
11
|
-
export type GitPaneTab = '
|
|
11
|
+
export type GitPaneTab = 'diff' | 'github'
|
|
12
12
|
|
|
13
13
|
interface GitPaneHeaderProps {
|
|
14
14
|
gitPanel: GitPanelState
|
|
@@ -40,14 +40,14 @@ export const GitPaneHeader = memo(function GitPaneHeader({
|
|
|
40
40
|
dispatchGlobal({ type: 'git-mode-toggle-file-list-mode' })
|
|
41
41
|
runSideEffectGlobal({ mode: nextFileListMode, type: 'persist-git-file-list-mode' })
|
|
42
42
|
}, [nextFileListMode])
|
|
43
|
-
const
|
|
44
|
-
const
|
|
43
|
+
const showDiff = useCallback(() => onTabChange?.('diff'), [onTabChange])
|
|
44
|
+
const showGithub = useCallback(() => onTabChange?.('github'), [onTabChange])
|
|
45
45
|
|
|
46
46
|
const hasTabs = tab !== undefined && onTabChange !== undefined
|
|
47
47
|
const hasProject = projectPath != null && projectPath !== ''
|
|
48
48
|
if (!hasProject) return null
|
|
49
49
|
// A git error must not hide the tab row, otherwise there's no way back to
|
|
50
|
-
// `
|
|
50
|
+
// `diff` (and the PR checks are still worth showing outside a repo).
|
|
51
51
|
if (gitPanel.error !== null && !hasTabs) return null
|
|
52
52
|
|
|
53
53
|
const branch = gitPanel.branch
|
|
@@ -60,17 +60,17 @@ export const GitPaneHeader = memo(function GitPaneHeader({
|
|
|
60
60
|
const showBehind = behind > 0
|
|
61
61
|
const showTracking = showAhead || showBehind
|
|
62
62
|
|
|
63
|
-
// The PR row already carries the branch identity
|
|
64
|
-
//
|
|
63
|
+
// The PR row already carries the branch identity, so the branch row is only
|
|
64
|
+
// worth a line without a PR.
|
|
65
65
|
const showPrRow = hasTabs && prRowVisible
|
|
66
66
|
const showBranchRow = !showPrRow && gitPanel.error === null
|
|
67
|
-
const showToggle = tab !== '
|
|
67
|
+
const showToggle = tab !== 'github' && gitPanel.files.length > 0
|
|
68
68
|
const showHistorical = headOffset > 0
|
|
69
69
|
const showReviewBase = baseLabel != null && baseLabel !== ''
|
|
70
70
|
const showScope = showHistorical || showReviewBase
|
|
71
71
|
const trackingAndToggle = (
|
|
72
72
|
<box flexDirection="row" flexShrink={0} gap={2}>
|
|
73
|
-
{showTracking && tab !== '
|
|
73
|
+
{showTracking && tab !== 'github' ? (
|
|
74
74
|
<box flexDirection="row" gap={1}>
|
|
75
75
|
{showAhead ? (
|
|
76
76
|
<text selectable={false} fg={t.textMuted} wrapMode="none">
|
|
@@ -117,31 +117,31 @@ export const GitPaneHeader = memo(function GitPaneHeader({
|
|
|
117
117
|
<box
|
|
118
118
|
paddingLeft={1}
|
|
119
119
|
paddingRight={1}
|
|
120
|
-
backgroundColor={tab === '
|
|
121
|
-
onMouseDown={
|
|
120
|
+
backgroundColor={tab === 'diff' ? activeTabBg : undefined}
|
|
121
|
+
onMouseDown={showDiff}
|
|
122
122
|
>
|
|
123
123
|
<text
|
|
124
124
|
selectable={false}
|
|
125
|
-
fg={tab === '
|
|
126
|
-
bg={tab === '
|
|
125
|
+
fg={tab === 'diff' ? t.text : t.textMuted}
|
|
126
|
+
bg={tab === 'diff' ? activeTabBg : undefined}
|
|
127
127
|
wrapMode="none"
|
|
128
128
|
>
|
|
129
|
-
|
|
129
|
+
diff
|
|
130
130
|
</text>
|
|
131
131
|
</box>
|
|
132
132
|
<box
|
|
133
133
|
paddingLeft={1}
|
|
134
134
|
paddingRight={1}
|
|
135
|
-
backgroundColor={tab === '
|
|
136
|
-
onMouseDown={
|
|
135
|
+
backgroundColor={tab === 'github' ? activeTabBg : undefined}
|
|
136
|
+
onMouseDown={showGithub}
|
|
137
137
|
>
|
|
138
138
|
<text
|
|
139
139
|
selectable={false}
|
|
140
|
-
fg={tab === '
|
|
141
|
-
bg={tab === '
|
|
140
|
+
fg={tab === 'github' ? t.text : t.textMuted}
|
|
141
|
+
bg={tab === 'github' ? activeTabBg : undefined}
|
|
142
142
|
wrapMode="none"
|
|
143
143
|
>
|
|
144
|
-
|
|
144
|
+
github
|
|
145
145
|
</text>
|
|
146
146
|
</box>
|
|
147
147
|
</box>
|
|
@@ -34,7 +34,7 @@ export const GitPaneWidget = memo(function GitPaneWidget({
|
|
|
34
34
|
: undefined
|
|
35
35
|
const projectPath = getActiveWorkspacePath(currentProject)
|
|
36
36
|
|
|
37
|
-
const [tab, setTab] = useState<GitPaneTab>('
|
|
37
|
+
const [tab, setTab] = useState<GitPaneTab>('diff')
|
|
38
38
|
|
|
39
39
|
useRepoDiscovery(projectPath)
|
|
40
40
|
useGitPanelPolling({ enabled: pollingEnabled, headOffset: 0, projectPath })
|
|
@@ -56,7 +56,7 @@ export const GitPaneWidget = memo(function GitPaneWidget({
|
|
|
56
56
|
return (
|
|
57
57
|
<box flexDirection="column" flexGrow={1} flexShrink={1} flexBasis={0} overflow="hidden">
|
|
58
58
|
<GitPaneHeader gitPanel={display} onTabChange={setTab} projectPath={projectPath} tab={tab} />
|
|
59
|
-
{tab === '
|
|
59
|
+
{tab === 'github' ? (
|
|
60
60
|
<PrChecksPanel contentWidth={contentWidth} />
|
|
61
61
|
) : (
|
|
62
62
|
<GitPanel
|
|
@@ -156,9 +156,23 @@ export const PrChecksPanel = memo(function PrChecksPanel({
|
|
|
156
156
|
scrollbarOptions={HIDDEN_SCROLLBAR_OPTIONS}
|
|
157
157
|
contentOptions={AIRY_CONTENT_OPTIONS}
|
|
158
158
|
>
|
|
159
|
-
<
|
|
160
|
-
<
|
|
161
|
-
|
|
159
|
+
<box flexDirection="column">
|
|
160
|
+
<text selectable={false} fg={stale ? t.textMuted : t.text} bg={bg}>
|
|
161
|
+
<strong>{pr.title}</strong>
|
|
162
|
+
</text>
|
|
163
|
+
{/* The PR diffstat (base..head), not the working tree the files tab shows. */}
|
|
164
|
+
<box flexDirection="row" gap={1}>
|
|
165
|
+
<text selectable={false} fg={t.success} bg={bg} wrapMode="none">
|
|
166
|
+
+{pr.additions}
|
|
167
|
+
</text>
|
|
168
|
+
<text selectable={false} fg={t.error} bg={bg} wrapMode="none">
|
|
169
|
+
-{pr.deletions}
|
|
170
|
+
</text>
|
|
171
|
+
<text selectable={false} fg={t.textMuted} bg={bg} wrapMode="none">
|
|
172
|
+
{pr.changedFiles === 1 ? '1 file' : `${pr.changedFiles} files`}
|
|
173
|
+
</text>
|
|
174
|
+
</box>
|
|
175
|
+
</box>
|
|
162
176
|
{body !== '' ? (
|
|
163
177
|
<box flexDirection="column">
|
|
164
178
|
<text selectable={false} fg={t.textMuted} bg={bg}>
|