@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,34 +1,44 @@
1
1
  /**
2
2
  * @vitest-environment happy-dom
3
3
  */
4
- import { describe, it, expect, beforeEach, afterEach, afterAll, vi } from 'vitest';
5
- import type { Mock } from 'vitest';
6
- import { render, waitFor } from '@testing-library/react';
7
- import { act } from 'react-dom/test-utils';
8
- import React from 'react';
9
- import { App } from '../../components/App.js';
10
- import { Window } from 'happy-dom';
11
- import type { BranchInfo, BranchItem } from '../../types.js';
12
- import * as BranchListScreenModule from '../../components/screens/BranchListScreen.js';
13
- import * as BranchActionSelectorScreenModule from '../../screens/BranchActionSelectorScreen.js';
14
-
15
- vi.mock('../../../../git.ts', () => ({
4
+ import {
5
+ describe,
6
+ it,
7
+ expect,
8
+ beforeEach,
9
+ afterEach,
10
+ afterAll,
11
+ vi,
12
+ } from "vitest";
13
+ import type { Mock } from "vitest";
14
+ import { render, waitFor } from "@testing-library/react";
15
+ import { act } from "react-dom/test-utils";
16
+ import React from "react";
17
+ import { App } from "../../components/App.js";
18
+ import { Window } from "happy-dom";
19
+ import type { BranchInfo, BranchItem } from "../../types.js";
20
+ import * as BranchListScreenModule from "../../components/screens/BranchListScreen.js";
21
+ import * as BranchActionSelectorScreenModule from "../../screens/BranchActionSelectorScreen.js";
22
+
23
+ vi.mock("../../../../git.ts", () => ({
16
24
  __esModule: true,
17
25
  getAllBranches: vi.fn(),
18
- getRepositoryRoot: vi.fn(async () => '/repo'),
26
+ getRepositoryRoot: vi.fn(async () => "/repo"),
19
27
  deleteBranch: vi.fn(async () => undefined),
20
28
  }));
21
29
 
22
- const { mockIsProtectedBranchName, mockSwitchToProtectedBranch } = vi.hoisted(() => ({
23
- mockIsProtectedBranchName: vi.fn(() => false),
24
- mockSwitchToProtectedBranch: vi.fn(async () => 'none' as const),
25
- }));
30
+ const { mockIsProtectedBranchName, mockSwitchToProtectedBranch } = vi.hoisted(
31
+ () => ({
32
+ mockIsProtectedBranchName: vi.fn(() => false),
33
+ mockSwitchToProtectedBranch: vi.fn(async () => "none" as const),
34
+ }),
35
+ );
26
36
 
27
- vi.mock('../../../../worktree.ts', () => ({
37
+ vi.mock("../../../../worktree.ts", () => ({
28
38
  __esModule: true,
29
39
  listAdditionalWorktrees: vi.fn(),
30
40
  createWorktree: vi.fn(async () => undefined),
31
- generateWorktreePath: vi.fn(async () => '/repo/.git/worktree/test'),
41
+ generateWorktreePath: vi.fn(async () => "/repo/.git/worktree/test"),
32
42
  getMergedPRWorktrees: vi.fn(async () => []),
33
43
  removeWorktree: vi.fn(async () => undefined),
34
44
  isProtectedBranchName: mockIsProtectedBranchName,
@@ -37,23 +47,27 @@ vi.mock('../../../../worktree.ts', () => ({
37
47
 
38
48
  const aiToolScreenProps: unknown[] = [];
39
49
 
40
- vi.mock('../../components/screens/AIToolSelectorScreen.js', () => {
50
+ vi.mock("../../components/screens/AIToolSelectorScreen.js", () => {
41
51
  return {
42
52
  AIToolSelectorScreen: (props: unknown) => {
43
53
  aiToolScreenProps.push(props);
44
- return React.createElement('div');
54
+ return React.createElement("div");
45
55
  },
46
56
  };
47
57
  });
48
58
 
49
- import { getAllBranches, getRepositoryRoot, deleteBranch } from '../../../../git.ts';
59
+ import {
60
+ getAllBranches,
61
+ getRepositoryRoot,
62
+ deleteBranch,
63
+ } from "../../../../git.ts";
50
64
  import {
51
65
  listAdditionalWorktrees,
52
66
  createWorktree,
53
67
  generateWorktreePath,
54
68
  getMergedPRWorktrees,
55
69
  removeWorktree,
56
- } from '../../../../worktree.ts';
70
+ } from "../../../../worktree.ts";
57
71
 
58
72
  const mockedGetAllBranches = getAllBranches as Mock;
59
73
  const mockedGetRepositoryRoot = getRepositoryRoot as Mock;
@@ -69,7 +83,7 @@ const originalBranchListScreen = BranchListScreenModule.BranchListScreen;
69
83
  const originalBranchActionSelectorScreen =
70
84
  BranchActionSelectorScreenModule.BranchActionSelectorScreen;
71
85
 
72
- describe('Navigation Integration Tests', () => {
86
+ describe("Navigation Integration Tests", () => {
73
87
  beforeEach(() => {
74
88
  // Setup happy-dom
75
89
  const window = new Window();
@@ -87,27 +101,29 @@ describe('Navigation Integration Tests', () => {
87
101
  mockedRemoveWorktree.mockReset();
88
102
  mockedIsProtectedBranchName.mockReset();
89
103
  mockedSwitchToProtectedBranch.mockReset();
90
- mockedGetRepositoryRoot.mockResolvedValue('/repo');
91
- mockedSwitchToProtectedBranch.mockResolvedValue('local');
104
+ mockedGetRepositoryRoot.mockResolvedValue("/repo");
105
+ mockedSwitchToProtectedBranch.mockResolvedValue("local");
92
106
  });
93
107
 
94
108
  const mockBranches: BranchInfo[] = [
95
109
  {
96
- name: 'main',
97
- type: 'local',
98
- branchType: 'main',
110
+ name: "main",
111
+ type: "local",
112
+ branchType: "main",
99
113
  isCurrent: true,
100
114
  },
101
115
  {
102
- name: 'feature/test',
103
- type: 'local',
104
- branchType: 'feature',
116
+ name: "feature/test",
117
+ type: "local",
118
+ branchType: "feature",
105
119
  isCurrent: false,
106
120
  },
107
121
  ];
108
122
 
109
- it('should start with branch-list screen', async () => {
110
- (getAllBranches as ReturnType<typeof vi.fn>).mockResolvedValue(mockBranches);
123
+ it("should start with branch-list screen", async () => {
124
+ (getAllBranches as ReturnType<typeof vi.fn>).mockResolvedValue(
125
+ mockBranches,
126
+ );
111
127
  (listAdditionalWorktrees as ReturnType<typeof vi.fn>).mockResolvedValue([]);
112
128
 
113
129
  const onExit = vi.fn();
@@ -119,8 +135,10 @@ describe('Navigation Integration Tests', () => {
119
135
  });
120
136
  });
121
137
 
122
- it('should support navigation between screens', async () => {
123
- (getAllBranches as ReturnType<typeof vi.fn>).mockResolvedValue(mockBranches);
138
+ it("should support navigation between screens", async () => {
139
+ (getAllBranches as ReturnType<typeof vi.fn>).mockResolvedValue(
140
+ mockBranches,
141
+ );
124
142
  (listAdditionalWorktrees as ReturnType<typeof vi.fn>).mockResolvedValue([]);
125
143
 
126
144
  const onExit = vi.fn();
@@ -134,8 +152,10 @@ describe('Navigation Integration Tests', () => {
134
152
  expect(container).toBeDefined();
135
153
  });
136
154
 
137
- it('should maintain state across screen transitions', async () => {
138
- (getAllBranches as ReturnType<typeof vi.fn>).mockResolvedValue(mockBranches);
155
+ it("should maintain state across screen transitions", async () => {
156
+ (getAllBranches as ReturnType<typeof vi.fn>).mockResolvedValue(
157
+ mockBranches,
158
+ );
139
159
  (listAdditionalWorktrees as ReturnType<typeof vi.fn>).mockResolvedValue([]);
140
160
 
141
161
  const onExit = vi.fn();
@@ -149,8 +169,10 @@ describe('Navigation Integration Tests', () => {
149
169
  expect(container).toBeDefined();
150
170
  });
151
171
 
152
- it('should handle back navigation correctly', async () => {
153
- (getAllBranches as ReturnType<typeof vi.fn>).mockResolvedValue(mockBranches);
172
+ it("should handle back navigation correctly", async () => {
173
+ (getAllBranches as ReturnType<typeof vi.fn>).mockResolvedValue(
174
+ mockBranches,
175
+ );
154
176
  (listAdditionalWorktrees as ReturnType<typeof vi.fn>).mockResolvedValue([]);
155
177
 
156
178
  const onExit = vi.fn();
@@ -164,8 +186,10 @@ describe('Navigation Integration Tests', () => {
164
186
  expect(container).toBeDefined();
165
187
  });
166
188
 
167
- it('should handle navigation history', async () => {
168
- (getAllBranches as ReturnType<typeof vi.fn>).mockResolvedValue(mockBranches);
189
+ it("should handle navigation history", async () => {
190
+ (getAllBranches as ReturnType<typeof vi.fn>).mockResolvedValue(
191
+ mockBranches,
192
+ );
169
193
  (listAdditionalWorktrees as ReturnType<typeof vi.fn>).mockResolvedValue([]);
170
194
 
171
195
  const onExit = vi.fn();
@@ -179,8 +203,10 @@ describe('Navigation Integration Tests', () => {
179
203
  expect(container).toBeDefined();
180
204
  });
181
205
 
182
- it('should display correct screen on navigation', async () => {
183
- (getAllBranches as ReturnType<typeof vi.fn>).mockResolvedValue(mockBranches);
206
+ it("should display correct screen on navigation", async () => {
207
+ (getAllBranches as ReturnType<typeof vi.fn>).mockResolvedValue(
208
+ mockBranches,
209
+ );
184
210
  (listAdditionalWorktrees as ReturnType<typeof vi.fn>).mockResolvedValue([]);
185
211
 
186
212
  const onExit = vi.fn();
@@ -194,8 +220,10 @@ describe('Navigation Integration Tests', () => {
194
220
  expect(container).toBeDefined();
195
221
  });
196
222
 
197
- it('should call onExit when branch is selected', async () => {
198
- (getAllBranches as ReturnType<typeof vi.fn>).mockResolvedValue(mockBranches);
223
+ it("should call onExit when branch is selected", async () => {
224
+ (getAllBranches as ReturnType<typeof vi.fn>).mockResolvedValue(
225
+ mockBranches,
226
+ );
199
227
  (listAdditionalWorktrees as ReturnType<typeof vi.fn>).mockResolvedValue([]);
200
228
 
201
229
  const onExit = vi.fn();
@@ -210,7 +238,7 @@ describe('Navigation Integration Tests', () => {
210
238
  });
211
239
  });
212
240
 
213
- describe('Protected Branch Navigation (T103)', () => {
241
+ describe("Protected Branch Navigation (T103)", () => {
214
242
  const branchListProps: any[] = [];
215
243
  const branchActionProps: any[] = [];
216
244
  let branchListSpy: ReturnType<typeof vi.spyOn>;
@@ -218,15 +246,15 @@ describe('Protected Branch Navigation (T103)', () => {
218
246
 
219
247
  const baseBranches: BranchInfo[] = [
220
248
  {
221
- name: 'main',
222
- type: 'local',
223
- branchType: 'main',
249
+ name: "main",
250
+ type: "local",
251
+ branchType: "main",
224
252
  isCurrent: true,
225
253
  },
226
254
  {
227
- name: 'feature/test',
228
- type: 'local',
229
- branchType: 'feature',
255
+ name: "feature/test",
256
+ type: "local",
257
+ branchType: "feature",
230
258
  isCurrent: false,
231
259
  },
232
260
  ];
@@ -245,28 +273,28 @@ describe('Protected Branch Navigation (T103)', () => {
245
273
  mockedRemoveWorktree.mockReset();
246
274
  mockedIsProtectedBranchName.mockReset();
247
275
  mockedSwitchToProtectedBranch.mockReset();
248
- mockedGetRepositoryRoot.mockResolvedValue('/repo');
276
+ mockedGetRepositoryRoot.mockResolvedValue("/repo");
249
277
  branchListProps.length = 0;
250
278
  branchActionProps.length = 0;
251
279
  aiToolScreenProps.length = 0;
252
280
  branchListSpy = vi
253
- .spyOn(BranchListScreenModule, 'BranchListScreen')
281
+ .spyOn(BranchListScreenModule, "BranchListScreen")
254
282
  .mockImplementation((props: any) => {
255
283
  branchListProps.push(props);
256
284
  return React.createElement(originalBranchListScreen, props);
257
285
  });
258
286
  branchActionSpy = vi
259
- .spyOn(BranchActionSelectorScreenModule, 'BranchActionSelectorScreen')
287
+ .spyOn(BranchActionSelectorScreenModule, "BranchActionSelectorScreen")
260
288
  .mockImplementation((props: any) => {
261
289
  branchActionProps.push(props);
262
290
  return React.createElement(originalBranchActionSelectorScreen, props);
263
291
  });
264
292
 
265
293
  mockedIsProtectedBranchName.mockImplementation((name: string) =>
266
- ['main', 'develop', 'origin/main', 'origin/develop'].includes(name)
294
+ ["main", "develop", "origin/main", "origin/develop"].includes(name),
267
295
  );
268
- mockedSwitchToProtectedBranch.mockResolvedValue('local');
269
- mockedGetRepositoryRoot.mockResolvedValue('/repo');
296
+ mockedSwitchToProtectedBranch.mockResolvedValue("local");
297
+ mockedGetRepositoryRoot.mockResolvedValue("/repo");
270
298
  });
271
299
 
272
300
  afterEach(() => {
@@ -274,7 +302,7 @@ describe('Protected Branch Navigation (T103)', () => {
274
302
  branchActionSpy.mockRestore();
275
303
  });
276
304
 
277
- it('switches local protected branches via root workflow and navigates to AI tool', async () => {
305
+ it("switches local protected branches via root workflow and navigates to AI tool", async () => {
278
306
  mockedGetAllBranches.mockResolvedValue(baseBranches);
279
307
  mockedListAdditionalWorktrees.mockResolvedValue([]);
280
308
 
@@ -288,15 +316,15 @@ describe('Protected Branch Navigation (T103)', () => {
288
316
  await waitFor(() => {
289
317
  const latest = branchListProps.at(-1);
290
318
  const names = (latest?.branches as BranchItem[] | undefined)?.map(
291
- (item) => item.name
319
+ (item) => item.name,
292
320
  );
293
321
  expect(names).toBeDefined();
294
- expect(names).toContain('main');
322
+ expect(names).toContain("main");
295
323
  });
296
324
 
297
325
  const latestProps = branchListProps.at(-1);
298
326
  const protectedBranch = (latestProps?.branches as BranchItem[]).find(
299
- (item) => item.name === 'main'
327
+ (item) => item.name === "main",
300
328
  );
301
329
  expect(protectedBranch).toBeDefined();
302
330
 
@@ -310,8 +338,8 @@ describe('Protected Branch Navigation (T103)', () => {
310
338
  });
311
339
 
312
340
  const actionProps = branchActionProps.at(-1);
313
- expect(actionProps?.mode).toBe('protected');
314
- expect(actionProps?.infoMessage).toContain('is a root branch');
341
+ expect(actionProps?.mode).toBe("protected");
342
+ expect(actionProps?.infoMessage).toContain("is a root branch");
315
343
 
316
344
  await act(async () => {
317
345
  await actionProps?.onUseExisting();
@@ -319,8 +347,8 @@ describe('Protected Branch Navigation (T103)', () => {
319
347
  });
320
348
 
321
349
  expect(mockedSwitchToProtectedBranch).toHaveBeenCalledWith({
322
- branchName: 'main',
323
- repoRoot: '/repo',
350
+ branchName: "main",
351
+ repoRoot: "/repo",
324
352
  remoteRef: null,
325
353
  });
326
354
 
@@ -329,24 +357,24 @@ describe('Protected Branch Navigation (T103)', () => {
329
357
  });
330
358
  });
331
359
 
332
- it('creates tracking branch for remote protected selections before navigating to AI tool', async () => {
360
+ it("creates tracking branch for remote protected selections before navigating to AI tool", async () => {
333
361
  const remoteBranches: BranchInfo[] = [
334
362
  {
335
- name: 'origin/develop',
336
- type: 'remote',
337
- branchType: 'develop',
363
+ name: "origin/develop",
364
+ type: "remote",
365
+ branchType: "develop",
338
366
  isCurrent: false,
339
367
  },
340
368
  {
341
- name: 'feature/test',
342
- type: 'local',
343
- branchType: 'feature',
369
+ name: "feature/test",
370
+ type: "local",
371
+ branchType: "feature",
344
372
  isCurrent: false,
345
373
  },
346
374
  ];
347
375
  mockedGetAllBranches.mockResolvedValue(remoteBranches);
348
376
  mockedListAdditionalWorktrees.mockResolvedValue([]);
349
- mockedSwitchToProtectedBranch.mockResolvedValue('remote');
377
+ mockedSwitchToProtectedBranch.mockResolvedValue("remote");
350
378
 
351
379
  const onExit = vi.fn();
352
380
  render(<App onExit={onExit} />);
@@ -358,15 +386,15 @@ describe('Protected Branch Navigation (T103)', () => {
358
386
  await waitFor(() => {
359
387
  const latest = branchListProps.at(-1);
360
388
  const names = (latest?.branches as BranchItem[] | undefined)?.map(
361
- (item) => item.name
389
+ (item) => item.name,
362
390
  );
363
391
  expect(names).toBeDefined();
364
- expect(names).toContain('origin/develop');
392
+ expect(names).toContain("origin/develop");
365
393
  });
366
394
 
367
395
  const latestProps = branchListProps.at(-1);
368
396
  const protectedBranch = (latestProps?.branches as BranchItem[]).find(
369
- (item) => item.name === 'origin/develop'
397
+ (item) => item.name === "origin/develop",
370
398
  );
371
399
  expect(protectedBranch).toBeDefined();
372
400
 
@@ -380,8 +408,8 @@ describe('Protected Branch Navigation (T103)', () => {
380
408
  });
381
409
 
382
410
  const actionProps = branchActionProps.at(-1);
383
- expect(actionProps?.mode).toBe('protected');
384
- expect(actionProps?.primaryLabel).toContain('root');
411
+ expect(actionProps?.mode).toBe("protected");
412
+ expect(actionProps?.primaryLabel).toContain("root");
385
413
 
386
414
  await act(async () => {
387
415
  await actionProps?.onUseExisting();
@@ -389,9 +417,9 @@ describe('Protected Branch Navigation (T103)', () => {
389
417
  });
390
418
 
391
419
  expect(mockedSwitchToProtectedBranch).toHaveBeenCalledWith({
392
- branchName: 'develop',
393
- repoRoot: '/repo',
394
- remoteRef: 'origin/develop',
420
+ branchName: "develop",
421
+ repoRoot: "/repo",
422
+ remoteRef: "origin/develop",
395
423
  });
396
424
 
397
425
  await waitFor(() => {