@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.
Files changed (149) hide show
  1. package/README.ja.md +4 -4
  2. package/README.md +4 -4
  3. package/dist/cli/ui/components/App.d.ts +4 -4
  4. package/dist/cli/ui/components/App.d.ts.map +1 -1
  5. package/dist/cli/ui/components/App.js +144 -105
  6. package/dist/cli/ui/components/App.js.map +1 -1
  7. package/dist/cli/ui/components/common/Confirm.d.ts +1 -1
  8. package/dist/cli/ui/components/common/Confirm.d.ts.map +1 -1
  9. package/dist/cli/ui/components/common/Confirm.js +7 -7
  10. package/dist/cli/ui/components/common/Confirm.js.map +1 -1
  11. package/dist/cli/ui/components/common/ErrorBoundary.d.ts +1 -1
  12. package/dist/cli/ui/components/common/ErrorBoundary.d.ts.map +1 -1
  13. package/dist/cli/ui/components/common/ErrorBoundary.js +4 -4
  14. package/dist/cli/ui/components/common/ErrorBoundary.js.map +1 -1
  15. package/dist/cli/ui/components/common/Input.d.ts +2 -2
  16. package/dist/cli/ui/components/common/Input.d.ts.map +1 -1
  17. package/dist/cli/ui/components/common/Input.js +4 -4
  18. package/dist/cli/ui/components/common/Input.js.map +1 -1
  19. package/dist/cli/ui/components/common/LoadingIndicator.d.ts +1 -1
  20. package/dist/cli/ui/components/common/LoadingIndicator.d.ts.map +1 -1
  21. package/dist/cli/ui/components/common/LoadingIndicator.js +4 -4
  22. package/dist/cli/ui/components/common/LoadingIndicator.js.map +1 -1
  23. package/dist/cli/ui/components/common/Select.d.ts +1 -1
  24. package/dist/cli/ui/components/common/Select.d.ts.map +1 -1
  25. package/dist/cli/ui/components/common/Select.js +11 -12
  26. package/dist/cli/ui/components/common/Select.js.map +1 -1
  27. package/dist/cli/ui/components/screens/AIToolSelectorScreen.d.ts +2 -2
  28. package/dist/cli/ui/components/screens/AIToolSelectorScreen.d.ts.map +1 -1
  29. package/dist/cli/ui/components/screens/AIToolSelectorScreen.js +11 -11
  30. package/dist/cli/ui/components/screens/AIToolSelectorScreen.js.map +1 -1
  31. package/dist/cli/ui/components/screens/BranchCreatorScreen.d.ts +1 -1
  32. package/dist/cli/ui/components/screens/BranchCreatorScreen.d.ts.map +1 -1
  33. package/dist/cli/ui/components/screens/BranchCreatorScreen.js +39 -36
  34. package/dist/cli/ui/components/screens/BranchCreatorScreen.js.map +1 -1
  35. package/dist/cli/ui/components/screens/BranchListScreen.d.ts +3 -3
  36. package/dist/cli/ui/components/screens/BranchListScreen.d.ts.map +1 -1
  37. package/dist/cli/ui/components/screens/BranchListScreen.js +55 -50
  38. package/dist/cli/ui/components/screens/BranchListScreen.js.map +1 -1
  39. package/dist/cli/ui/components/screens/ExecutionModeSelectorScreen.d.ts +2 -2
  40. package/dist/cli/ui/components/screens/ExecutionModeSelectorScreen.d.ts.map +1 -1
  41. package/dist/cli/ui/components/screens/ExecutionModeSelectorScreen.js +25 -25
  42. package/dist/cli/ui/components/screens/ExecutionModeSelectorScreen.js.map +1 -1
  43. package/dist/cli/ui/components/screens/PRCleanupScreen.d.ts +2 -2
  44. package/dist/cli/ui/components/screens/PRCleanupScreen.js +21 -21
  45. package/dist/cli/ui/components/screens/SessionSelectorScreen.d.ts +1 -1
  46. package/dist/cli/ui/components/screens/SessionSelectorScreen.js +8 -8
  47. package/dist/cli/ui/components/screens/WorktreeManagerScreen.d.ts +1 -1
  48. package/dist/cli/ui/components/screens/WorktreeManagerScreen.js +8 -8
  49. package/dist/cli/ui/screens/BranchActionSelectorScreen.d.ts.map +1 -1
  50. package/dist/cli/ui/screens/BranchActionSelectorScreen.js +7 -4
  51. package/dist/cli/ui/screens/BranchActionSelectorScreen.js.map +1 -1
  52. package/dist/cli/ui/types.d.ts.map +1 -1
  53. package/dist/client/assets/{index-V6hDu9KS.js → index-Difv1Hwu.js} +2 -2
  54. package/dist/client/index.html +1 -1
  55. package/dist/config/builtin-tools.d.ts +10 -2
  56. package/dist/config/builtin-tools.d.ts.map +1 -1
  57. package/dist/config/builtin-tools.js +40 -4
  58. package/dist/config/builtin-tools.js.map +1 -1
  59. package/dist/config/index.d.ts.map +1 -1
  60. package/dist/config/index.js.map +1 -1
  61. package/dist/config/tools.d.ts.map +1 -1
  62. package/dist/config/tools.js +4 -3
  63. package/dist/config/tools.js.map +1 -1
  64. package/dist/gemini.d.ts +12 -0
  65. package/dist/gemini.d.ts.map +1 -0
  66. package/dist/gemini.js +154 -0
  67. package/dist/gemini.js.map +1 -0
  68. package/dist/git.d.ts.map +1 -1
  69. package/dist/git.js.map +1 -1
  70. package/dist/index.d.ts.map +1 -1
  71. package/dist/index.js +30 -0
  72. package/dist/index.js.map +1 -1
  73. package/dist/qwen.d.ts +12 -0
  74. package/dist/qwen.d.ts.map +1 -0
  75. package/dist/qwen.js +154 -0
  76. package/dist/qwen.js.map +1 -0
  77. package/dist/services/git.service.d.ts.map +1 -1
  78. package/dist/services/git.service.js.map +1 -1
  79. package/dist/web/client/src/components/BranchGraph.d.ts.map +1 -1
  80. package/dist/web/client/src/components/BranchGraph.js +1 -1
  81. package/dist/web/client/src/components/BranchGraph.js.map +1 -1
  82. package/dist/web/client/src/components/EnvEditor.d.ts.map +1 -1
  83. package/dist/web/client/src/components/EnvEditor.js +7 -4
  84. package/dist/web/client/src/components/EnvEditor.js.map +1 -1
  85. package/dist/web/client/src/pages/BranchDetailPage.d.ts.map +1 -1
  86. package/dist/web/client/src/pages/BranchDetailPage.js +55 -18
  87. package/dist/web/client/src/pages/BranchDetailPage.js.map +1 -1
  88. package/dist/web/client/src/pages/BranchListPage.d.ts.map +1 -1
  89. package/dist/web/client/src/pages/BranchListPage.js +10 -4
  90. package/dist/web/client/src/pages/BranchListPage.js.map +1 -1
  91. package/dist/web/client/src/pages/ConfigManagementPage.d.ts.map +1 -1
  92. package/dist/web/client/src/pages/ConfigManagementPage.js +4 -2
  93. package/dist/web/client/src/pages/ConfigManagementPage.js.map +1 -1
  94. package/package.json +2 -1
  95. package/src/cli/ui/__tests__/acceptance/navigation.acceptance.test.tsx +69 -50
  96. package/src/cli/ui/__tests__/components/App.protected-branch.test.tsx +67 -45
  97. package/src/cli/ui/__tests__/components/App.shortcuts.test.tsx +117 -75
  98. package/src/cli/ui/__tests__/components/App.test.tsx +45 -37
  99. package/src/cli/ui/__tests__/components/common/Confirm.test.tsx +35 -22
  100. package/src/cli/ui/__tests__/components/common/ErrorBoundary.test.tsx +22 -22
  101. package/src/cli/ui/__tests__/components/common/Input.test.tsx +29 -22
  102. package/src/cli/ui/__tests__/components/common/LoadingIndicator.test.tsx +40 -34
  103. package/src/cli/ui/__tests__/components/common/Select.memo.test.tsx +57 -66
  104. package/src/cli/ui/__tests__/components/common/Select.test.tsx +121 -91
  105. package/src/cli/ui/__tests__/components/parts/Footer.test.tsx +18 -16
  106. package/src/cli/ui/__tests__/components/parts/Header.test.tsx +13 -13
  107. package/src/cli/ui/__tests__/components/parts/ScrollableList.test.tsx +20 -20
  108. package/src/cli/ui/__tests__/components/parts/Stats.test.tsx +38 -26
  109. package/src/cli/ui/__tests__/components/screens/AIToolSelectorScreen.test.tsx +31 -31
  110. package/src/cli/ui/__tests__/components/screens/BranchCreatorScreen.test.tsx +73 -37
  111. package/src/cli/ui/__tests__/components/screens/BranchListScreen.test.tsx +261 -153
  112. package/src/cli/ui/__tests__/components/screens/ExecutionModeSelectorScreen.test.tsx +38 -32
  113. package/src/cli/ui/__tests__/components/screens/PRCleanupScreen.test.tsx +39 -39
  114. package/src/cli/ui/__tests__/components/screens/SessionSelectorScreen.test.tsx +49 -21
  115. package/src/cli/ui/__tests__/components/screens/WorktreeManagerScreen.test.tsx +52 -28
  116. package/src/cli/ui/__tests__/integration/edgeCases.test.tsx +84 -48
  117. package/src/cli/ui/__tests__/integration/navigation.test.tsx +111 -83
  118. package/src/cli/ui/__tests__/integration/realtimeUpdate.test.tsx +111 -108
  119. package/src/cli/ui/__tests__/performance/branchList.performance.test.tsx +50 -37
  120. package/src/cli/ui/__tests__/performance/useMemoOptimization.test.tsx +75 -76
  121. package/src/cli/ui/components/App.tsx +247 -150
  122. package/src/cli/ui/components/common/Confirm.tsx +13 -9
  123. package/src/cli/ui/components/common/ErrorBoundary.tsx +8 -5
  124. package/src/cli/ui/components/common/Input.tsx +12 -4
  125. package/src/cli/ui/components/common/LoadingIndicator.tsx +8 -5
  126. package/src/cli/ui/components/common/Select.tsx +28 -17
  127. package/src/cli/ui/components/parts/Header.test.tsx +5 -15
  128. package/src/cli/ui/components/screens/AIToolSelectorScreen.tsx +19 -13
  129. package/src/cli/ui/components/screens/BranchCreatorScreen.tsx +74 -54
  130. package/src/cli/ui/components/screens/BranchListScreen.tsx +92 -75
  131. package/src/cli/ui/components/screens/ExecutionModeSelectorScreen.tsx +35 -28
  132. package/src/cli/ui/components/screens/PRCleanupScreen.tsx +22 -22
  133. package/src/cli/ui/components/screens/SessionSelectorScreen.tsx +8 -8
  134. package/src/cli/ui/components/screens/WorktreeManagerScreen.tsx +8 -8
  135. package/src/cli/ui/screens/BranchActionSelectorScreen.tsx +9 -4
  136. package/src/cli/ui/types.ts +8 -1
  137. package/src/config/builtin-tools.ts +42 -4
  138. package/src/config/index.ts +2 -12
  139. package/src/config/tools.ts +16 -6
  140. package/src/gemini.ts +202 -0
  141. package/src/git.ts +2 -1
  142. package/src/index.ts +30 -0
  143. package/src/qwen.ts +208 -0
  144. package/src/services/git.service.ts +2 -1
  145. package/src/web/client/src/components/BranchGraph.tsx +3 -2
  146. package/src/web/client/src/components/EnvEditor.tsx +44 -11
  147. package/src/web/client/src/pages/BranchDetailPage.tsx +165 -54
  148. package/src/web/client/src/pages/BranchListPage.tsx +37 -13
  149. package/src/web/client/src/pages/ConfigManagementPage.tsx +28 -9
@@ -1,12 +1,12 @@
1
1
  /**
2
2
  * @vitest-environment happy-dom
3
3
  */
4
- import { describe, it, expect, vi, beforeEach } from 'vitest';
5
- import { render } from '@testing-library/react';
6
- import React, { useMemo } from 'react';
7
- import { Window } from 'happy-dom';
8
- import type { BranchInfo, WorktreeInfo } from '../../types.js';
9
- import { formatBranchItems } from '../../utils/branchFormatter.js';
4
+ import { describe, it, expect, vi, beforeEach } from "vitest";
5
+ import { render } from "@testing-library/react";
6
+ import React, { useMemo } from "react";
7
+ import { Window } from "happy-dom";
8
+ import type { BranchInfo, WorktreeInfo } from "../../types.js";
9
+ import { formatBranchItems } from "../../utils/branchFormatter.js";
10
10
 
11
11
  /**
12
12
  * T082-1: useMemo optimization tests
@@ -14,29 +14,31 @@ import { formatBranchItems } from '../../utils/branchFormatter.js';
14
14
  */
15
15
 
16
16
  // Mock useGitData hook
17
- vi.mock('../../hooks/useGitData.js', () => ({
17
+ vi.mock("../../hooks/useGitData.js", () => ({
18
18
  useGitData: vi.fn(),
19
19
  }));
20
20
 
21
- import { useGitData } from '../../hooks/useGitData.js';
21
+ import { useGitData } from "../../hooks/useGitData.js";
22
22
  // const mockUseGitData = useGitData as ReturnType<typeof vi.fn>;
23
23
 
24
24
  // Helper function to create a stable hash of branch data
25
25
  function createBranchHash(branches: BranchInfo[]): string {
26
- return branches
27
- .map((b) => `${b.name}-${b.type}-${b.isCurrent}`)
28
- .join(',');
26
+ return branches.map((b) => `${b.name}-${b.type}-${b.isCurrent}`).join(",");
29
27
  }
30
28
 
31
29
  // Helper function to create a stable hash of worktree data
32
30
  function createWorktreeHash(worktrees: WorktreeInfo[]): string {
33
- return worktrees
34
- .map((w) => `${w.branch}-${w.path}`)
35
- .join(',');
31
+ return worktrees.map((w) => `${w.branch}-${w.path}`).join(",");
36
32
  }
37
33
 
38
34
  // Test component that uses optimized useMemo
39
- function TestComponent({ branches, worktrees }: { branches: BranchInfo[]; worktrees: WorktreeInfo[] }) {
35
+ function TestComponent({
36
+ branches,
37
+ worktrees,
38
+ }: {
39
+ branches: BranchInfo[];
40
+ worktrees: WorktreeInfo[];
41
+ }) {
40
42
  // Count how many times formatBranchItems is called
41
43
  const formatCallCount = React.useRef(0);
42
44
 
@@ -53,17 +55,12 @@ function TestComponent({ branches, worktrees }: { branches: BranchInfo[]; worktr
53
55
  });
54
56
  }
55
57
  return formatBranchItems(branches, worktreeMap);
56
- }, [
57
- createBranchHash(branches),
58
- createWorktreeHash(worktrees),
59
- ]);
60
-
61
- return (
62
- <div data-testid="branch-count">{branchItems.length}</div>
63
- );
58
+ }, [createBranchHash(branches), createWorktreeHash(worktrees)]);
59
+
60
+ return <div data-testid="branch-count">{branchItems.length}</div>;
64
61
  }
65
62
 
66
- describe('useMemo Optimization (T082-1)', () => {
63
+ describe("useMemo Optimization (T082-1)", () => {
67
64
  beforeEach(() => {
68
65
  const window = new Window();
69
66
  globalThis.window = window as any;
@@ -71,54 +68,54 @@ describe('useMemo Optimization (T082-1)', () => {
71
68
  vi.clearAllMocks();
72
69
  });
73
70
 
74
- it('should not regenerate branchItems when data content is the same', () => {
71
+ it("should not regenerate branchItems when data content is the same", () => {
75
72
  const mockBranches: BranchInfo[] = [
76
73
  {
77
- name: 'main',
78
- branchType: 'main',
79
- type: 'local',
74
+ name: "main",
75
+ branchType: "main",
76
+ type: "local",
80
77
  isCurrent: true,
81
78
  },
82
79
  {
83
- name: 'feature/test-1',
84
- branchType: 'feature',
85
- type: 'local',
80
+ name: "feature/test-1",
81
+ branchType: "feature",
82
+ type: "local",
86
83
  isCurrent: false,
87
84
  },
88
85
  ];
89
86
 
90
87
  const mockWorktrees: WorktreeInfo[] = [
91
88
  {
92
- path: '/mock/worktree/feature-test-1',
93
- branch: 'feature/test-1',
89
+ path: "/mock/worktree/feature-test-1",
90
+ branch: "feature/test-1",
94
91
  isAccessible: true,
95
92
  },
96
93
  ];
97
94
 
98
95
  const { rerender } = render(
99
- <TestComponent branches={mockBranches} worktrees={mockWorktrees} />
96
+ <TestComponent branches={mockBranches} worktrees={mockWorktrees} />,
100
97
  );
101
98
 
102
99
  // Create new arrays with the same content
103
100
  const sameBranches: BranchInfo[] = [
104
101
  {
105
- name: 'main',
106
- branchType: 'main',
107
- type: 'local',
102
+ name: "main",
103
+ branchType: "main",
104
+ type: "local",
108
105
  isCurrent: true,
109
106
  },
110
107
  {
111
- name: 'feature/test-1',
112
- branchType: 'feature',
113
- type: 'local',
108
+ name: "feature/test-1",
109
+ branchType: "feature",
110
+ type: "local",
114
111
  isCurrent: false,
115
112
  },
116
113
  ];
117
114
 
118
115
  const sameWorktrees: WorktreeInfo[] = [
119
116
  {
120
- path: '/mock/worktree/feature-test-1',
121
- branch: 'feature/test-1',
117
+ path: "/mock/worktree/feature-test-1",
118
+ branch: "feature/test-1",
122
119
  isAccessible: true,
123
120
  },
124
121
  ];
@@ -129,11 +126,13 @@ describe('useMemo Optimization (T082-1)', () => {
129
126
 
130
127
  // Verify that content is the same
131
128
  expect(createBranchHash(sameBranches)).toBe(createBranchHash(mockBranches));
132
- expect(createWorktreeHash(sameWorktrees)).toBe(createWorktreeHash(mockWorktrees));
129
+ expect(createWorktreeHash(sameWorktrees)).toBe(
130
+ createWorktreeHash(mockWorktrees),
131
+ );
133
132
 
134
133
  // Re-render with same content but different references
135
134
  rerender(
136
- <TestComponent branches={sameBranches} worktrees={sameWorktrees} />
135
+ <TestComponent branches={sameBranches} worktrees={sameWorktrees} />,
137
136
  );
138
137
 
139
138
  // formatBranchItems should only be called once (not twice)
@@ -141,69 +140,69 @@ describe('useMemo Optimization (T082-1)', () => {
141
140
  // depends on array references, not content
142
141
  });
143
142
 
144
- it('should regenerate branchItems when data content changes', () => {
143
+ it("should regenerate branchItems when data content changes", () => {
145
144
  const initialBranches: BranchInfo[] = [
146
145
  {
147
- name: 'main',
148
- branchType: 'main',
149
- type: 'local',
146
+ name: "main",
147
+ branchType: "main",
148
+ type: "local",
150
149
  isCurrent: true,
151
150
  },
152
151
  ];
153
152
 
154
153
  const { rerender } = render(
155
- <TestComponent branches={initialBranches} worktrees={[]} />
154
+ <TestComponent branches={initialBranches} worktrees={[]} />,
156
155
  );
157
156
 
158
157
  // Add a new branch
159
158
  const updatedBranches: BranchInfo[] = [
160
159
  ...initialBranches,
161
160
  {
162
- name: 'feature/new',
163
- branchType: 'feature',
164
- type: 'local',
161
+ name: "feature/new",
162
+ branchType: "feature",
163
+ type: "local",
165
164
  isCurrent: false,
166
165
  },
167
166
  ];
168
167
 
169
168
  // Verify content changed
170
- expect(createBranchHash(updatedBranches)).not.toBe(createBranchHash(initialBranches));
169
+ expect(createBranchHash(updatedBranches)).not.toBe(
170
+ createBranchHash(initialBranches),
171
+ );
171
172
 
172
173
  // Re-render with new content
173
- rerender(
174
- <TestComponent branches={updatedBranches} worktrees={[]} />
175
- );
174
+ rerender(<TestComponent branches={updatedBranches} worktrees={[]} />);
176
175
 
177
176
  // formatBranchItems should be called twice (once for initial, once for update)
178
177
  });
179
178
 
180
- it('should handle branch order changes correctly', () => {
179
+ it("should handle branch order changes correctly", () => {
181
180
  const branches1: BranchInfo[] = [
182
181
  {
183
- name: 'main',
184
- branchType: 'main',
185
- type: 'local',
182
+ name: "main",
183
+ branchType: "main",
184
+ type: "local",
186
185
  isCurrent: true,
187
186
  },
188
187
  {
189
- name: 'feature/test',
190
- branchType: 'feature',
191
- type: 'local',
188
+ name: "feature/test",
189
+ branchType: "feature",
190
+ type: "local",
192
191
  isCurrent: false,
193
192
  },
194
193
  ];
195
194
 
196
195
  const branches2: BranchInfo[] = [
197
196
  {
198
- name: 'feature/test',
199
- branchType: 'feature',
200
- type: 'local',
197
+ name: "feature/test",
198
+ branchType: "feature",
199
+ type: "local",
201
200
  isCurrent: false,
202
201
  },
203
202
  {
204
- name: 'main',
205
- branchType: 'main',
206
- type: 'local',
203
+ name: "main",
204
+ branchType: "main",
205
+ type: "local",
207
206
  isCurrent: true,
208
207
  },
209
208
  ];
@@ -212,21 +211,21 @@ describe('useMemo Optimization (T082-1)', () => {
212
211
  expect(createBranchHash(branches1)).not.toBe(createBranchHash(branches2));
213
212
  });
214
213
 
215
- it('should detect subtle branch property changes', () => {
214
+ it("should detect subtle branch property changes", () => {
216
215
  const branches1: BranchInfo[] = [
217
216
  {
218
- name: 'main',
219
- branchType: 'main',
220
- type: 'local',
217
+ name: "main",
218
+ branchType: "main",
219
+ type: "local",
221
220
  isCurrent: false,
222
221
  },
223
222
  ];
224
223
 
225
224
  const branches2: BranchInfo[] = [
226
225
  {
227
- name: 'main',
228
- branchType: 'main',
229
- type: 'local',
226
+ name: "main",
227
+ branchType: "main",
228
+ type: "local",
230
229
  isCurrent: true, // Changed from false to true
231
230
  },
232
231
  ];