@akiojin/gwt 2.2.0 → 2.3.0
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.ja.md +4 -4
- package/README.md +4 -4
- package/dist/cli/ui/components/App.d.ts +4 -4
- package/dist/cli/ui/components/App.d.ts.map +1 -1
- package/dist/cli/ui/components/App.js +144 -105
- package/dist/cli/ui/components/App.js.map +1 -1
- package/dist/cli/ui/components/common/Confirm.d.ts +1 -1
- package/dist/cli/ui/components/common/Confirm.d.ts.map +1 -1
- package/dist/cli/ui/components/common/Confirm.js +7 -7
- package/dist/cli/ui/components/common/Confirm.js.map +1 -1
- package/dist/cli/ui/components/common/ErrorBoundary.d.ts +1 -1
- package/dist/cli/ui/components/common/ErrorBoundary.d.ts.map +1 -1
- package/dist/cli/ui/components/common/ErrorBoundary.js +4 -4
- package/dist/cli/ui/components/common/ErrorBoundary.js.map +1 -1
- package/dist/cli/ui/components/common/Input.d.ts +2 -2
- package/dist/cli/ui/components/common/Input.d.ts.map +1 -1
- package/dist/cli/ui/components/common/Input.js +4 -4
- package/dist/cli/ui/components/common/Input.js.map +1 -1
- package/dist/cli/ui/components/common/LoadingIndicator.d.ts +1 -1
- package/dist/cli/ui/components/common/LoadingIndicator.d.ts.map +1 -1
- package/dist/cli/ui/components/common/LoadingIndicator.js +4 -4
- package/dist/cli/ui/components/common/LoadingIndicator.js.map +1 -1
- package/dist/cli/ui/components/common/Select.d.ts +1 -1
- package/dist/cli/ui/components/common/Select.d.ts.map +1 -1
- package/dist/cli/ui/components/common/Select.js +11 -12
- package/dist/cli/ui/components/common/Select.js.map +1 -1
- package/dist/cli/ui/components/screens/AIToolSelectorScreen.d.ts +2 -2
- package/dist/cli/ui/components/screens/AIToolSelectorScreen.d.ts.map +1 -1
- package/dist/cli/ui/components/screens/AIToolSelectorScreen.js +11 -11
- package/dist/cli/ui/components/screens/AIToolSelectorScreen.js.map +1 -1
- package/dist/cli/ui/components/screens/BranchCreatorScreen.d.ts +1 -1
- package/dist/cli/ui/components/screens/BranchCreatorScreen.d.ts.map +1 -1
- package/dist/cli/ui/components/screens/BranchCreatorScreen.js +39 -36
- package/dist/cli/ui/components/screens/BranchCreatorScreen.js.map +1 -1
- package/dist/cli/ui/components/screens/BranchListScreen.d.ts +3 -3
- package/dist/cli/ui/components/screens/BranchListScreen.d.ts.map +1 -1
- package/dist/cli/ui/components/screens/BranchListScreen.js +55 -50
- package/dist/cli/ui/components/screens/BranchListScreen.js.map +1 -1
- package/dist/cli/ui/components/screens/ExecutionModeSelectorScreen.d.ts +2 -2
- package/dist/cli/ui/components/screens/ExecutionModeSelectorScreen.d.ts.map +1 -1
- package/dist/cli/ui/components/screens/ExecutionModeSelectorScreen.js +25 -25
- package/dist/cli/ui/components/screens/ExecutionModeSelectorScreen.js.map +1 -1
- package/dist/cli/ui/components/screens/PRCleanupScreen.d.ts +2 -2
- package/dist/cli/ui/components/screens/PRCleanupScreen.js +21 -21
- package/dist/cli/ui/components/screens/SessionSelectorScreen.d.ts +1 -1
- package/dist/cli/ui/components/screens/SessionSelectorScreen.js +8 -8
- package/dist/cli/ui/components/screens/WorktreeManagerScreen.d.ts +1 -1
- package/dist/cli/ui/components/screens/WorktreeManagerScreen.js +8 -8
- package/dist/cli/ui/screens/BranchActionSelectorScreen.d.ts.map +1 -1
- package/dist/cli/ui/screens/BranchActionSelectorScreen.js +7 -4
- package/dist/cli/ui/screens/BranchActionSelectorScreen.js.map +1 -1
- package/dist/cli/ui/types.d.ts.map +1 -1
- package/dist/client/assets/{index-V6hDu9KS.js → index-Difv1Hwu.js} +2 -2
- package/dist/client/index.html +1 -1
- package/dist/config/builtin-tools.d.ts +10 -2
- package/dist/config/builtin-tools.d.ts.map +1 -1
- package/dist/config/builtin-tools.js +40 -4
- package/dist/config/builtin-tools.js.map +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js.map +1 -1
- package/dist/config/tools.d.ts.map +1 -1
- package/dist/config/tools.js +4 -3
- package/dist/config/tools.js.map +1 -1
- package/dist/gemini.d.ts +12 -0
- package/dist/gemini.d.ts.map +1 -0
- package/dist/gemini.js +154 -0
- package/dist/gemini.js.map +1 -0
- package/dist/git.d.ts.map +1 -1
- package/dist/git.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +30 -0
- package/dist/index.js.map +1 -1
- package/dist/qwen.d.ts +12 -0
- package/dist/qwen.d.ts.map +1 -0
- package/dist/qwen.js +154 -0
- package/dist/qwen.js.map +1 -0
- package/dist/services/git.service.d.ts.map +1 -1
- package/dist/services/git.service.js.map +1 -1
- package/dist/web/client/src/components/BranchGraph.d.ts.map +1 -1
- package/dist/web/client/src/components/BranchGraph.js +1 -1
- package/dist/web/client/src/components/BranchGraph.js.map +1 -1
- package/dist/web/client/src/components/EnvEditor.d.ts.map +1 -1
- package/dist/web/client/src/components/EnvEditor.js +7 -4
- package/dist/web/client/src/components/EnvEditor.js.map +1 -1
- package/dist/web/client/src/pages/BranchDetailPage.d.ts.map +1 -1
- package/dist/web/client/src/pages/BranchDetailPage.js +55 -18
- package/dist/web/client/src/pages/BranchDetailPage.js.map +1 -1
- package/dist/web/client/src/pages/BranchListPage.d.ts.map +1 -1
- package/dist/web/client/src/pages/BranchListPage.js +10 -4
- package/dist/web/client/src/pages/BranchListPage.js.map +1 -1
- package/dist/web/client/src/pages/ConfigManagementPage.d.ts.map +1 -1
- package/dist/web/client/src/pages/ConfigManagementPage.js +4 -2
- package/dist/web/client/src/pages/ConfigManagementPage.js.map +1 -1
- package/package.json +2 -1
- package/src/cli/ui/__tests__/acceptance/navigation.acceptance.test.tsx +69 -50
- package/src/cli/ui/__tests__/components/App.protected-branch.test.tsx +67 -45
- package/src/cli/ui/__tests__/components/App.shortcuts.test.tsx +117 -75
- package/src/cli/ui/__tests__/components/App.test.tsx +45 -37
- package/src/cli/ui/__tests__/components/common/Confirm.test.tsx +35 -22
- package/src/cli/ui/__tests__/components/common/ErrorBoundary.test.tsx +22 -22
- package/src/cli/ui/__tests__/components/common/Input.test.tsx +29 -22
- package/src/cli/ui/__tests__/components/common/LoadingIndicator.test.tsx +40 -34
- package/src/cli/ui/__tests__/components/common/Select.memo.test.tsx +57 -66
- package/src/cli/ui/__tests__/components/common/Select.test.tsx +121 -91
- package/src/cli/ui/__tests__/components/parts/Footer.test.tsx +18 -16
- package/src/cli/ui/__tests__/components/parts/Header.test.tsx +13 -13
- package/src/cli/ui/__tests__/components/parts/ScrollableList.test.tsx +20 -20
- package/src/cli/ui/__tests__/components/parts/Stats.test.tsx +38 -26
- package/src/cli/ui/__tests__/components/screens/AIToolSelectorScreen.test.tsx +31 -31
- package/src/cli/ui/__tests__/components/screens/BranchCreatorScreen.test.tsx +73 -37
- package/src/cli/ui/__tests__/components/screens/BranchListScreen.test.tsx +261 -153
- package/src/cli/ui/__tests__/components/screens/ExecutionModeSelectorScreen.test.tsx +38 -32
- package/src/cli/ui/__tests__/components/screens/PRCleanupScreen.test.tsx +39 -39
- package/src/cli/ui/__tests__/components/screens/SessionSelectorScreen.test.tsx +49 -21
- package/src/cli/ui/__tests__/components/screens/WorktreeManagerScreen.test.tsx +52 -28
- package/src/cli/ui/__tests__/integration/edgeCases.test.tsx +84 -48
- package/src/cli/ui/__tests__/integration/navigation.test.tsx +111 -83
- package/src/cli/ui/__tests__/integration/realtimeUpdate.test.tsx +111 -108
- package/src/cli/ui/__tests__/performance/branchList.performance.test.tsx +50 -37
- package/src/cli/ui/__tests__/performance/useMemoOptimization.test.tsx +75 -76
- package/src/cli/ui/components/App.tsx +247 -150
- package/src/cli/ui/components/common/Confirm.tsx +13 -9
- package/src/cli/ui/components/common/ErrorBoundary.tsx +8 -5
- package/src/cli/ui/components/common/Input.tsx +12 -4
- package/src/cli/ui/components/common/LoadingIndicator.tsx +8 -5
- package/src/cli/ui/components/common/Select.tsx +28 -17
- package/src/cli/ui/components/parts/Header.test.tsx +5 -15
- package/src/cli/ui/components/screens/AIToolSelectorScreen.tsx +19 -13
- package/src/cli/ui/components/screens/BranchCreatorScreen.tsx +74 -54
- package/src/cli/ui/components/screens/BranchListScreen.tsx +92 -75
- package/src/cli/ui/components/screens/ExecutionModeSelectorScreen.tsx +35 -28
- package/src/cli/ui/components/screens/PRCleanupScreen.tsx +22 -22
- package/src/cli/ui/components/screens/SessionSelectorScreen.tsx +8 -8
- package/src/cli/ui/components/screens/WorktreeManagerScreen.tsx +8 -8
- package/src/cli/ui/screens/BranchActionSelectorScreen.tsx +9 -4
- package/src/cli/ui/types.ts +8 -1
- package/src/config/builtin-tools.ts +42 -4
- package/src/config/index.ts +2 -12
- package/src/config/tools.ts +16 -6
- package/src/gemini.ts +202 -0
- package/src/git.ts +2 -1
- package/src/index.ts +30 -0
- package/src/qwen.ts +208 -0
- package/src/services/git.service.ts +2 -1
- package/src/web/client/src/components/BranchGraph.tsx +3 -2
- package/src/web/client/src/components/EnvEditor.tsx +44 -11
- package/src/web/client/src/pages/BranchDetailPage.tsx +165 -54
- package/src/web/client/src/pages/BranchListPage.tsx +37 -13
- package/src/web/client/src/pages/ConfigManagementPage.tsx +28 -9
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @vitest-environment happy-dom
|
|
3
3
|
*/
|
|
4
|
-
import { describe, it, expect, beforeEach, afterEach, vi } from
|
|
5
|
-
import { render as rtlRender, act } from
|
|
6
|
-
import React from
|
|
7
|
-
import { BranchCreatorScreen } from
|
|
8
|
-
import { Window } from
|
|
9
|
-
import { render as inkRender } from
|
|
10
|
-
|
|
11
|
-
describe(
|
|
4
|
+
import { describe, it, expect, beforeEach, afterEach, vi } from "vitest";
|
|
5
|
+
import { render as rtlRender, act } from "@testing-library/react";
|
|
6
|
+
import React from "react";
|
|
7
|
+
import { BranchCreatorScreen } from "../../../components/screens/BranchCreatorScreen.js";
|
|
8
|
+
import { Window } from "happy-dom";
|
|
9
|
+
import { render as inkRender } from "ink-testing-library";
|
|
10
|
+
|
|
11
|
+
describe("BranchCreatorScreen", () => {
|
|
12
12
|
beforeEach(() => {
|
|
13
13
|
vi.useFakeTimers();
|
|
14
14
|
// Setup happy-dom
|
|
@@ -21,21 +21,29 @@ describe('BranchCreatorScreen', () => {
|
|
|
21
21
|
vi.useRealTimers();
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
-
it(
|
|
24
|
+
it("should render header with title", () => {
|
|
25
25
|
const onBack = vi.fn();
|
|
26
26
|
const onCreate = vi.fn().mockResolvedValue(undefined);
|
|
27
27
|
const { getByText } = rtlRender(
|
|
28
|
-
<BranchCreatorScreen
|
|
28
|
+
<BranchCreatorScreen
|
|
29
|
+
onBack={onBack}
|
|
30
|
+
onCreate={onCreate}
|
|
31
|
+
disableAnimation
|
|
32
|
+
/>,
|
|
29
33
|
);
|
|
30
34
|
|
|
31
35
|
expect(getByText(/New Branch/i)).toBeDefined();
|
|
32
36
|
});
|
|
33
37
|
|
|
34
|
-
it(
|
|
38
|
+
it("should render branch type selection initially", () => {
|
|
35
39
|
const onBack = vi.fn();
|
|
36
40
|
const onCreate = vi.fn().mockResolvedValue(undefined);
|
|
37
41
|
const { getByText } = rtlRender(
|
|
38
|
-
<BranchCreatorScreen
|
|
42
|
+
<BranchCreatorScreen
|
|
43
|
+
onBack={onBack}
|
|
44
|
+
onCreate={onCreate}
|
|
45
|
+
disableAnimation
|
|
46
|
+
/>,
|
|
39
47
|
);
|
|
40
48
|
|
|
41
49
|
expect(getByText(/Select branch type/i)).toBeDefined();
|
|
@@ -45,47 +53,63 @@ describe('BranchCreatorScreen', () => {
|
|
|
45
53
|
expect(getByText(/release/i)).toBeDefined();
|
|
46
54
|
});
|
|
47
55
|
|
|
48
|
-
it(
|
|
56
|
+
it("should render footer with actions", () => {
|
|
49
57
|
const onBack = vi.fn();
|
|
50
58
|
const onCreate = vi.fn().mockResolvedValue(undefined);
|
|
51
59
|
const { getAllByText } = rtlRender(
|
|
52
|
-
<BranchCreatorScreen
|
|
60
|
+
<BranchCreatorScreen
|
|
61
|
+
onBack={onBack}
|
|
62
|
+
onCreate={onCreate}
|
|
63
|
+
disableAnimation
|
|
64
|
+
/>,
|
|
53
65
|
);
|
|
54
66
|
|
|
55
67
|
expect(getAllByText(/enter/i).length).toBeGreaterThan(0);
|
|
56
68
|
expect(getAllByText(/esc/i).length).toBeGreaterThan(0);
|
|
57
69
|
});
|
|
58
70
|
|
|
59
|
-
it(
|
|
71
|
+
it("should show branch name input after type selection", () => {
|
|
60
72
|
const onBack = vi.fn();
|
|
61
73
|
const onCreate = vi.fn().mockResolvedValue(undefined);
|
|
62
74
|
const { container } = rtlRender(
|
|
63
|
-
<BranchCreatorScreen
|
|
75
|
+
<BranchCreatorScreen
|
|
76
|
+
onBack={onBack}
|
|
77
|
+
onCreate={onCreate}
|
|
78
|
+
disableAnimation
|
|
79
|
+
/>,
|
|
64
80
|
);
|
|
65
81
|
|
|
66
82
|
// Test will verify the screen transitions from type selection to name input
|
|
67
83
|
expect(container).toBeDefined();
|
|
68
84
|
});
|
|
69
85
|
|
|
70
|
-
it(
|
|
86
|
+
it("should handle branch creation", () => {
|
|
71
87
|
const onBack = vi.fn();
|
|
72
88
|
const onCreate = vi.fn().mockResolvedValue(undefined);
|
|
73
89
|
const { container } = rtlRender(
|
|
74
|
-
<BranchCreatorScreen
|
|
90
|
+
<BranchCreatorScreen
|
|
91
|
+
onBack={onBack}
|
|
92
|
+
onCreate={onCreate}
|
|
93
|
+
disableAnimation
|
|
94
|
+
/>,
|
|
75
95
|
);
|
|
76
96
|
|
|
77
97
|
// Test will verify onCreate is called with correct branch name
|
|
78
98
|
expect(container).toBeDefined();
|
|
79
99
|
});
|
|
80
100
|
|
|
81
|
-
it(
|
|
101
|
+
it("should use terminal height for layout calculation", () => {
|
|
82
102
|
const originalRows = process.stdout.rows;
|
|
83
103
|
process.stdout.rows = 30;
|
|
84
104
|
|
|
85
105
|
const onBack = vi.fn();
|
|
86
106
|
const onCreate = vi.fn().mockResolvedValue(undefined);
|
|
87
107
|
const { container } = rtlRender(
|
|
88
|
-
<BranchCreatorScreen
|
|
108
|
+
<BranchCreatorScreen
|
|
109
|
+
onBack={onBack}
|
|
110
|
+
onCreate={onCreate}
|
|
111
|
+
disableAnimation
|
|
112
|
+
/>,
|
|
89
113
|
);
|
|
90
114
|
|
|
91
115
|
expect(container).toBeDefined();
|
|
@@ -93,18 +117,22 @@ describe('BranchCreatorScreen', () => {
|
|
|
93
117
|
process.stdout.rows = originalRows;
|
|
94
118
|
});
|
|
95
119
|
|
|
96
|
-
it(
|
|
120
|
+
it("should handle back navigation with ESC key", () => {
|
|
97
121
|
const onBack = vi.fn();
|
|
98
122
|
const onCreate = vi.fn().mockResolvedValue(undefined);
|
|
99
123
|
const { container } = rtlRender(
|
|
100
|
-
<BranchCreatorScreen
|
|
124
|
+
<BranchCreatorScreen
|
|
125
|
+
onBack={onBack}
|
|
126
|
+
onCreate={onCreate}
|
|
127
|
+
disableAnimation
|
|
128
|
+
/>,
|
|
101
129
|
);
|
|
102
130
|
|
|
103
131
|
// Test will verify onBack is called when ESC is pressed
|
|
104
132
|
expect(container).toBeDefined();
|
|
105
133
|
});
|
|
106
134
|
|
|
107
|
-
it(
|
|
135
|
+
it("should display creating state while waiting for branch creation", async () => {
|
|
108
136
|
expect.assertions(3);
|
|
109
137
|
const onBack = vi.fn();
|
|
110
138
|
let resolveCreate: (() => void) | null = null;
|
|
@@ -112,21 +140,25 @@ describe('BranchCreatorScreen', () => {
|
|
|
112
140
|
() =>
|
|
113
141
|
new Promise<void>((resolve) => {
|
|
114
142
|
resolveCreate = resolve;
|
|
115
|
-
})
|
|
143
|
+
}),
|
|
116
144
|
);
|
|
117
145
|
const { stdin, lastFrame } = inkRender(
|
|
118
|
-
<BranchCreatorScreen
|
|
146
|
+
<BranchCreatorScreen
|
|
147
|
+
onBack={onBack}
|
|
148
|
+
onCreate={onCreate}
|
|
149
|
+
disableAnimation
|
|
150
|
+
/>,
|
|
119
151
|
);
|
|
120
152
|
|
|
121
153
|
// Select default branch type (feature)
|
|
122
154
|
await act(async () => {
|
|
123
|
-
stdin.write(
|
|
155
|
+
stdin.write("\r");
|
|
124
156
|
});
|
|
125
157
|
await act(async () => {
|
|
126
158
|
await Promise.resolve();
|
|
127
159
|
});
|
|
128
160
|
|
|
129
|
-
const branchName =
|
|
161
|
+
const branchName = "new-branch";
|
|
130
162
|
for (const char of branchName) {
|
|
131
163
|
await act(async () => {
|
|
132
164
|
stdin.write(char);
|
|
@@ -138,14 +170,14 @@ describe('BranchCreatorScreen', () => {
|
|
|
138
170
|
|
|
139
171
|
// Submit branch name
|
|
140
172
|
await act(async () => {
|
|
141
|
-
stdin.write(
|
|
173
|
+
stdin.write("\r");
|
|
142
174
|
});
|
|
143
175
|
await act(async () => {
|
|
144
176
|
await Promise.resolve();
|
|
145
177
|
});
|
|
146
178
|
|
|
147
179
|
expect(onCreate).toHaveBeenCalledWith(`feature/${branchName}`);
|
|
148
|
-
expect(lastFrame()).toContain(
|
|
180
|
+
expect(lastFrame()).toContain("Creating branch");
|
|
149
181
|
expect(lastFrame()).toContain(`feature/${branchName}`);
|
|
150
182
|
|
|
151
183
|
await act(async () => {
|
|
@@ -156,7 +188,7 @@ describe('BranchCreatorScreen', () => {
|
|
|
156
188
|
});
|
|
157
189
|
});
|
|
158
190
|
|
|
159
|
-
it(
|
|
191
|
+
it("should ignore ESC input while branch creation is in progress", async () => {
|
|
160
192
|
expect.assertions(2);
|
|
161
193
|
const onBack = vi.fn();
|
|
162
194
|
let resolveCreate: (() => void) | null = null;
|
|
@@ -164,21 +196,25 @@ describe('BranchCreatorScreen', () => {
|
|
|
164
196
|
() =>
|
|
165
197
|
new Promise<void>((resolve) => {
|
|
166
198
|
resolveCreate = resolve;
|
|
167
|
-
})
|
|
199
|
+
}),
|
|
168
200
|
);
|
|
169
201
|
const { stdin, lastFrame } = inkRender(
|
|
170
|
-
<BranchCreatorScreen
|
|
202
|
+
<BranchCreatorScreen
|
|
203
|
+
onBack={onBack}
|
|
204
|
+
onCreate={onCreate}
|
|
205
|
+
disableAnimation
|
|
206
|
+
/>,
|
|
171
207
|
);
|
|
172
208
|
|
|
173
209
|
// Move to name input
|
|
174
210
|
await act(async () => {
|
|
175
|
-
stdin.write(
|
|
211
|
+
stdin.write("\r");
|
|
176
212
|
});
|
|
177
213
|
await act(async () => {
|
|
178
214
|
await Promise.resolve();
|
|
179
215
|
});
|
|
180
216
|
|
|
181
|
-
const branchName =
|
|
217
|
+
const branchName = "blocking-branch";
|
|
182
218
|
for (const char of branchName) {
|
|
183
219
|
await act(async () => {
|
|
184
220
|
stdin.write(char);
|
|
@@ -189,7 +225,7 @@ describe('BranchCreatorScreen', () => {
|
|
|
189
225
|
});
|
|
190
226
|
|
|
191
227
|
await act(async () => {
|
|
192
|
-
stdin.write(
|
|
228
|
+
stdin.write("\r");
|
|
193
229
|
});
|
|
194
230
|
await act(async () => {
|
|
195
231
|
await Promise.resolve();
|
|
@@ -197,14 +233,14 @@ describe('BranchCreatorScreen', () => {
|
|
|
197
233
|
|
|
198
234
|
// Attempt to cancel with ESC during creation
|
|
199
235
|
await act(async () => {
|
|
200
|
-
stdin.write(
|
|
236
|
+
stdin.write("\u001B");
|
|
201
237
|
});
|
|
202
238
|
await act(async () => {
|
|
203
239
|
await Promise.resolve();
|
|
204
240
|
});
|
|
205
241
|
|
|
206
242
|
expect(onBack).not.toHaveBeenCalled();
|
|
207
|
-
expect(lastFrame()).toContain(
|
|
243
|
+
expect(lastFrame()).toContain("Creating branch");
|
|
208
244
|
|
|
209
245
|
await act(async () => {
|
|
210
246
|
resolveCreate?.();
|