github-issue-tower-defence-management 1.117.9 → 1.118.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 (38) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +7 -5
  3. package/bin/adapter/entry-points/console/ui-dist/assets/{index-DID_sTas.js → index-DWiG7btO.js} +24 -24
  4. package/bin/adapter/entry-points/console/ui-dist/index.html +1 -1
  5. package/bin/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.js +26 -12
  6. package/bin/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.js.map +1 -1
  7. package/bin/adapter/repositories/ConfigurableSilentSessionMessageComposer.js +44 -11
  8. package/bin/adapter/repositories/ConfigurableSilentSessionMessageComposer.js.map +1 -1
  9. package/bin/domain/usecases/DefaultSilentSessionMessageComposer.js +27 -7
  10. package/bin/domain/usecases/DefaultSilentSessionMessageComposer.js.map +1 -1
  11. package/bin/domain/usecases/NotifySilentLiveSessionsUseCase.js +4 -1
  12. package/bin/domain/usecases/NotifySilentLiveSessionsUseCase.js.map +1 -1
  13. package/package.json +1 -1
  14. package/src/adapter/entry-points/console/ui/e2e/consoleScenario.spec.ts +39 -26
  15. package/src/adapter/entry-points/console/ui/e2e/consoleTestHarness.ts +28 -2
  16. package/src/adapter/entry-points/console/ui/src/features/console/components/detail/ConsoleItemDetail.stories.tsx +2 -2
  17. package/src/adapter/entry-points/console/ui/src/features/console/components/detail/ConsoleItemDetail.tsx +1 -7
  18. package/src/adapter/entry-points/console/ui/src/features/console/pages/ConsoleItemDetailContainer.test.tsx +55 -26
  19. package/src/adapter/entry-points/console/ui/src/features/console/pages/ConsoleItemDetailContainer.tsx +1 -8
  20. package/src/adapter/entry-points/console/ui-dist/assets/{index-DID_sTas.js → index-DWiG7btO.js} +24 -24
  21. package/src/adapter/entry-points/console/ui-dist/index.html +1 -1
  22. package/src/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.ts +18 -8
  23. package/src/adapter/entry-points/handlers/notifySilentTmuxSessions.test.ts +8 -4
  24. package/src/adapter/repositories/ConfigurableSilentSessionMessageComposer.test.ts +81 -28
  25. package/src/adapter/repositories/ConfigurableSilentSessionMessageComposer.ts +91 -19
  26. package/src/domain/usecases/DefaultSilentSessionMessageComposer.test.ts +91 -15
  27. package/src/domain/usecases/DefaultSilentSessionMessageComposer.ts +54 -11
  28. package/src/domain/usecases/NotifySilentLiveSessionsUseCase.test.ts +34 -0
  29. package/src/domain/usecases/NotifySilentLiveSessionsUseCase.ts +6 -1
  30. package/src/domain/usecases/adapter-interfaces/SilentSessionMessageComposer.ts +9 -1
  31. package/types/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.d.ts.map +1 -1
  32. package/types/adapter/repositories/ConfigurableSilentSessionMessageComposer.d.ts +8 -4
  33. package/types/adapter/repositories/ConfigurableSilentSessionMessageComposer.d.ts.map +1 -1
  34. package/types/domain/usecases/DefaultSilentSessionMessageComposer.d.ts +2 -2
  35. package/types/domain/usecases/DefaultSilentSessionMessageComposer.d.ts.map +1 -1
  36. package/types/domain/usecases/NotifySilentLiveSessionsUseCase.d.ts.map +1 -1
  37. package/types/domain/usecases/adapter-interfaces/SilentSessionMessageComposer.d.ts +5 -1
  38. package/types/domain/usecases/adapter-interfaces/SilentSessionMessageComposer.d.ts.map +1 -1
@@ -187,28 +187,39 @@ describe('ConsoleItemDetailContainer', () => {
187
187
  ]);
188
188
  });
189
189
 
190
- it('routes an inline review comment on an issue related pull request to that pull request url', async () => {
190
+ it('collects an inline comment on an issue related pull request diff, enables Reject, and submits it as the request-changes review for that pull request url', async () => {
191
191
  const operations = buildOperations();
192
+ const onQueueAction = jest.fn();
192
193
  const relatedPullRequest = consoleRelatedPullRequestsFixture[0];
193
- const { container, findByRole, getAllByRole, getByPlaceholderText } =
194
- render(
195
- <ConsoleItemDetailContainer
196
- tab="unread"
197
- item={issueItem}
198
- caches={buildCaches({
199
- relatedPrs: [relatedPullRequest],
200
- prFiles: consoleChangedFilesFixture,
201
- })}
202
- operations={operations}
203
- statusOptions={consoleStatusOptionsFixture}
204
- storyOptions={consoleStoryOptionsFixture}
205
- storyColors={consoleStoryColorsFixture}
206
- storyName="TDPM Console port"
207
- overlayStatus={null}
208
- now={Date.parse('2026-06-19T12:00:00.000Z')}
209
- onQueueAction={jest.fn()}
210
- />,
211
- );
194
+ const {
195
+ container,
196
+ findByRole,
197
+ getAllByRole,
198
+ getByPlaceholderText,
199
+ getByText,
200
+ } = render(
201
+ <ConsoleItemDetailContainer
202
+ tab="unread"
203
+ item={issueItem}
204
+ caches={buildCaches({
205
+ relatedPrs: [relatedPullRequest],
206
+ prFiles: consoleChangedFilesFixture,
207
+ })}
208
+ operations={operations}
209
+ statusOptions={consoleStatusOptionsFixture}
210
+ storyOptions={consoleStoryOptionsFixture}
211
+ storyColors={consoleStoryColorsFixture}
212
+ storyName="TDPM Console port"
213
+ overlayStatus={null}
214
+ now={Date.parse('2026-06-19T12:00:00.000Z')}
215
+ onQueueAction={onQueueAction}
216
+ />,
217
+ );
218
+
219
+ await waitFor(() => {
220
+ expect(getByText('Reject')).toBeInTheDocument();
221
+ });
222
+ expect(getByText('Reject')).toBeDisabled();
212
223
 
213
224
  const fileRow = await findByRole('button', {
214
225
  name: new RegExp(consoleChangedFilesFixture[0].path),
@@ -230,13 +241,31 @@ describe('ConsoleItemDetailContainer', () => {
230
241
  expect(submitButton).not.toBeNull();
231
242
  fireEvent.click(submitButton as Element);
232
243
 
233
- const addInlineReviewComment =
234
- operations.addInlineReviewComment as jest.Mock;
235
244
  await waitFor(() => {
236
- expect(addInlineReviewComment).toHaveBeenCalledTimes(1);
245
+ expect(getByText('Reject')).not.toBeDisabled();
237
246
  });
238
- const call = addInlineReviewComment.mock.calls[0];
239
- expect(call[0]).toBe(relatedPullRequest.url);
240
- expect(call[4]).toBe('Please rename this variable.');
247
+ expect(operations.addInlineReviewComment).not.toHaveBeenCalled();
248
+
249
+ fireEvent.click(getByText('Reject'));
250
+ const rejectInput = onQueueAction.mock.calls.at(-1)?.[0];
251
+ expect(rejectInput.kind).toEqual({
252
+ type: 'review',
253
+ action: 'request_changes',
254
+ });
255
+ rejectInput.commit();
256
+ const reviewCall = (
257
+ operations.reviewPullRequest as jest.Mock
258
+ ).mock.calls.at(-1);
259
+ expect(reviewCall?.[1]).toBe(relatedPullRequest.url);
260
+ expect(reviewCall?.[2]).toBe('request_changes');
261
+ expect(reviewCall?.[3]).toEqual([
262
+ {
263
+ path: consoleChangedFilesFixture[0].path,
264
+ line: expect.any(Number),
265
+ side: expect.stringMatching(/LEFT|RIGHT/),
266
+ body: 'Please rename this variable.',
267
+ },
268
+ ]);
269
+ expect(reviewCall?.[3][0].body).not.toBe('');
241
270
  });
242
271
  });
@@ -77,12 +77,6 @@ export const ConsoleItemDetailContainer = ({
77
77
  const [pendingReviewComments, setPendingReviewComments] = useState<
78
78
  ConsolePendingReviewComment[]
79
79
  >([]);
80
- const buildAddInlineComment = useCallback(
81
- (prUrl: string): ConsoleAddInlineComment =>
82
- (path, line, side, body) =>
83
- operations.addInlineReviewComment(prUrl, path, line, side, body),
84
- [operations],
85
- );
86
80
  const addInlineComment = useCallback<ConsoleAddInlineComment>(
87
81
  async (path, line, side, body) => {
88
82
  setPendingReviewComments((previous) => [
@@ -175,8 +169,7 @@ export const ConsoleItemDetailContainer = ({
175
169
  now={now}
176
170
  buildImageProxyUrl={resolveImageProxyUrl}
177
171
  renderReferenceLink={renderReferenceLink}
178
- onAddInlineComment={item.isPr ? addInlineComment : undefined}
179
- buildAddInlineComment={buildAddInlineComment}
172
+ onAddInlineComment={addInlineComment}
180
173
  commentComposer={
181
174
  <ConsoleCommentComposer
182
175
  isPr={item.isPr}