github-issue-tower-defence-management 1.101.5 → 1.101.7
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/CHANGELOG.md +14 -0
- package/bin/adapter/entry-points/console/ui-dist/assets/index--7aFZNg9.js +101 -0
- package/bin/adapter/entry-points/console/ui-dist/assets/index-ES6SLB1Y.css +1 -0
- package/bin/adapter/entry-points/console/ui-dist/index.html +2 -2
- package/bin/domain/usecases/HandleScheduledEventUseCase.js +1 -0
- package/bin/domain/usecases/HandleScheduledEventUseCase.js.map +1 -1
- package/bin/domain/usecases/RevertNotReadyReviewQueueIssueUseCase.js +17 -0
- package/bin/domain/usecases/RevertNotReadyReviewQueueIssueUseCase.js.map +1 -1
- package/package.json +1 -1
- package/src/adapter/entry-points/console/ui/src/features/console/components/detail/ConsoleItemDetail.tsx +139 -145
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleOperations.test.ts +2 -2
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleOperations.ts +2 -4
- package/src/adapter/entry-points/console/ui/src/features/console/pages/ConsoleItemDetailContainer.tsx +1 -4
- package/src/adapter/entry-points/console/ui/src/features/console/pages/ConsolePage.test.tsx +0 -97
- package/src/adapter/entry-points/console/ui/src/features/console/pages/ConsolePage.tsx +0 -39
- package/src/adapter/entry-points/console/ui/src/index.css +6 -16
- package/src/adapter/entry-points/console/ui-dist/assets/index--7aFZNg9.js +101 -0
- package/src/adapter/entry-points/console/ui-dist/assets/index-ES6SLB1Y.css +1 -0
- package/src/adapter/entry-points/console/ui-dist/index.html +2 -2
- package/src/domain/usecases/HandleScheduledEventUseCase.ts +1 -0
- package/src/domain/usecases/RevertNotReadyReviewQueueIssueUseCase.test.ts +125 -0
- package/src/domain/usecases/RevertNotReadyReviewQueueIssueUseCase.ts +32 -0
- package/types/domain/usecases/HandleScheduledEventUseCase.d.ts.map +1 -1
- package/types/domain/usecases/RevertNotReadyReviewQueueIssueUseCase.d.ts +1 -0
- package/types/domain/usecases/RevertNotReadyReviewQueueIssueUseCase.d.ts.map +1 -1
- package/bin/adapter/entry-points/console/ui-dist/assets/index-D4zghbcI.css +0 -1
- package/bin/adapter/entry-points/console/ui-dist/assets/index-DX0mapkS.js +0 -101
- package/src/adapter/entry-points/console/ui-dist/assets/index-D4zghbcI.css +0 -1
- package/src/adapter/entry-points/console/ui-dist/assets/index-DX0mapkS.js +0 -101
|
@@ -391,103 +391,6 @@ describe('ConsolePage swipe navigation', () => {
|
|
|
391
391
|
});
|
|
392
392
|
});
|
|
393
393
|
|
|
394
|
-
describe('ConsolePage detail scroll reset', () => {
|
|
395
|
-
beforeEach(() => {
|
|
396
|
-
localStorage.clear();
|
|
397
|
-
window.history.replaceState({}, '', '/projects/umino/prs?k=token');
|
|
398
|
-
const fetchMock = jest.fn(async (url: string) => {
|
|
399
|
-
const listMatch = url.match(/\/projects\/[^/]+\/([^/]+)\/list\.json/);
|
|
400
|
-
if (listMatch !== null) {
|
|
401
|
-
return {
|
|
402
|
-
ok: true,
|
|
403
|
-
status: 200,
|
|
404
|
-
json: async () =>
|
|
405
|
-
listMatch[1] === 'prs'
|
|
406
|
-
? twoItemPrPayload()
|
|
407
|
-
: { ...twoItemPrPayload(), items: [] },
|
|
408
|
-
};
|
|
409
|
-
}
|
|
410
|
-
return { ok: true, status: 200, json: async () => ({ body: '# body' }) };
|
|
411
|
-
});
|
|
412
|
-
global.fetch = fetchMock as unknown as typeof fetch;
|
|
413
|
-
});
|
|
414
|
-
|
|
415
|
-
it('resets the detail scroll container to the top when navigating to the next item', async () => {
|
|
416
|
-
const { container, getByText, findByText } = render(<ConsolePage />);
|
|
417
|
-
await waitFor(() => {
|
|
418
|
-
expect(getByText('Add serveConsole subcommand')).toBeInTheDocument();
|
|
419
|
-
});
|
|
420
|
-
fireEvent.click(getByText('Add serveConsole subcommand'));
|
|
421
|
-
expect(await findByText('Approve')).toBeInTheDocument();
|
|
422
|
-
|
|
423
|
-
const scrollContainer = container.querySelector('.console-detail');
|
|
424
|
-
expect(scrollContainer).not.toBeNull();
|
|
425
|
-
(scrollContainer as HTMLElement).scrollTop = 240;
|
|
426
|
-
expect((scrollContainer as HTMLElement).scrollTop).toBe(240);
|
|
427
|
-
|
|
428
|
-
const detailScreen = container.querySelector('.console-detail-screen');
|
|
429
|
-
swipeDetailScreen(
|
|
430
|
-
detailScreen as HTMLElement,
|
|
431
|
-
{ clientX: 240, clientY: 100 },
|
|
432
|
-
{ clientX: 40, clientY: 110 },
|
|
433
|
-
);
|
|
434
|
-
|
|
435
|
-
await waitFor(() => {
|
|
436
|
-
expect(window.location.hash).toBe('#item/PVTI_2');
|
|
437
|
-
});
|
|
438
|
-
await waitFor(() => {
|
|
439
|
-
expect((scrollContainer as HTMLElement).scrollTop).toBe(0);
|
|
440
|
-
});
|
|
441
|
-
});
|
|
442
|
-
});
|
|
443
|
-
|
|
444
|
-
describe('ConsolePage next item prefetch', () => {
|
|
445
|
-
beforeEach(() => {
|
|
446
|
-
localStorage.clear();
|
|
447
|
-
window.history.replaceState({}, '', '/projects/umino/prs?k=token');
|
|
448
|
-
});
|
|
449
|
-
|
|
450
|
-
it('warms the next pending item resources while the current item is open', async () => {
|
|
451
|
-
const fetchMock = jest.fn(async (url: string) => {
|
|
452
|
-
const listMatch = url.match(/\/projects\/[^/]+\/([^/]+)\/list\.json/);
|
|
453
|
-
if (listMatch !== null) {
|
|
454
|
-
return {
|
|
455
|
-
ok: true,
|
|
456
|
-
status: 200,
|
|
457
|
-
json: async () =>
|
|
458
|
-
listMatch[1] === 'prs'
|
|
459
|
-
? twoItemPrPayload()
|
|
460
|
-
: { ...twoItemPrPayload(), items: [] },
|
|
461
|
-
};
|
|
462
|
-
}
|
|
463
|
-
return { ok: true, status: 200, json: async () => ({ body: '# body' }) };
|
|
464
|
-
});
|
|
465
|
-
global.fetch = fetchMock as unknown as typeof fetch;
|
|
466
|
-
|
|
467
|
-
const { getByText, findByText, queryByText } = render(<ConsolePage />);
|
|
468
|
-
await waitFor(() => {
|
|
469
|
-
expect(getByText('Add serveConsole subcommand')).toBeInTheDocument();
|
|
470
|
-
});
|
|
471
|
-
fireEvent.click(getByText('Add serveConsole subcommand'));
|
|
472
|
-
expect(await findByText('Approve')).toBeInTheDocument();
|
|
473
|
-
expect(window.location.hash).toBe('#item/PVTI_1');
|
|
474
|
-
expect(queryByText('Add server-side console API handlers')).toBeNull();
|
|
475
|
-
|
|
476
|
-
const nextItemUrlFragment = encodeURIComponent(
|
|
477
|
-
'https://github.com/o/r/pull/852',
|
|
478
|
-
);
|
|
479
|
-
await waitFor(() => {
|
|
480
|
-
const calledNextItemBody = fetchMock.mock.calls.some(
|
|
481
|
-
([url]) =>
|
|
482
|
-
typeof url === 'string' &&
|
|
483
|
-
url.includes('/api/itembody') &&
|
|
484
|
-
url.includes(nextItemUrlFragment),
|
|
485
|
-
);
|
|
486
|
-
expect(calledNextItemBody).toBe(true);
|
|
487
|
-
});
|
|
488
|
-
});
|
|
489
|
-
});
|
|
490
|
-
|
|
491
394
|
describe('ConsolePage auto-advance', () => {
|
|
492
395
|
beforeEach(() => {
|
|
493
396
|
localStorage.clear();
|
|
@@ -191,44 +191,6 @@ export const ConsolePage = () => {
|
|
|
191
191
|
);
|
|
192
192
|
|
|
193
193
|
const detailScreenRef = useConsoleSwipeNavigation(handleSwipe);
|
|
194
|
-
const detailScrollElementRef = useRef<HTMLElement | null>(null);
|
|
195
|
-
|
|
196
|
-
useEffect(() => {
|
|
197
|
-
if (selectedItemKey === null) {
|
|
198
|
-
return;
|
|
199
|
-
}
|
|
200
|
-
const element = detailScrollElementRef.current;
|
|
201
|
-
if (element !== null) {
|
|
202
|
-
element.scrollTop = 0;
|
|
203
|
-
}
|
|
204
|
-
}, [selectedItemKey]);
|
|
205
|
-
|
|
206
|
-
const nextPendingItem = useMemo<ConsoleListItem | null>(() => {
|
|
207
|
-
if (selectedItemKey === null) {
|
|
208
|
-
return null;
|
|
209
|
-
}
|
|
210
|
-
const nextKey = nextPendingKeyBrowse(orderedPendingKeys, selectedItemKey);
|
|
211
|
-
if (nextKey === null) {
|
|
212
|
-
return null;
|
|
213
|
-
}
|
|
214
|
-
return (
|
|
215
|
-
pendingItems.find((item) => overlayKeyForItem(item) === nextKey) ?? null
|
|
216
|
-
);
|
|
217
|
-
}, [selectedItemKey, orderedPendingKeys, pendingItems]);
|
|
218
|
-
|
|
219
|
-
useEffect(() => {
|
|
220
|
-
if (nextPendingItem === null) {
|
|
221
|
-
return;
|
|
222
|
-
}
|
|
223
|
-
const key = `${nextPendingItem.repo}#${nextPendingItem.number}`;
|
|
224
|
-
const url = nextPendingItem.url;
|
|
225
|
-
void caches.body.load(key, url);
|
|
226
|
-
void caches.state.load(key, url);
|
|
227
|
-
if (nextPendingItem.isPr) {
|
|
228
|
-
void caches.files.load(key, url);
|
|
229
|
-
void caches.commits.load(key, url);
|
|
230
|
-
}
|
|
231
|
-
}, [nextPendingItem, caches]);
|
|
232
194
|
|
|
233
195
|
return (
|
|
234
196
|
<main className="console-app">
|
|
@@ -273,7 +235,6 @@ export const ConsolePage = () => {
|
|
|
273
235
|
overlayStatus={overlayStatusForSelected}
|
|
274
236
|
now={now}
|
|
275
237
|
onQueueAction={handleQueueAction}
|
|
276
|
-
scrollRef={detailScrollElementRef}
|
|
277
238
|
/>
|
|
278
239
|
</div>
|
|
279
240
|
)}
|
|
@@ -33,10 +33,8 @@ body {
|
|
|
33
33
|
.console-app {
|
|
34
34
|
max-width: 920px;
|
|
35
35
|
margin: 0 auto;
|
|
36
|
-
height: 100dvh;
|
|
37
36
|
display: flex;
|
|
38
37
|
flex-direction: column;
|
|
39
|
-
min-height: 0;
|
|
40
38
|
}
|
|
41
39
|
|
|
42
40
|
.console-tabbar {
|
|
@@ -116,10 +114,6 @@ body {
|
|
|
116
114
|
list-style: none;
|
|
117
115
|
margin: 0;
|
|
118
116
|
padding: 12px 18px 18px;
|
|
119
|
-
flex: 1;
|
|
120
|
-
min-height: 0;
|
|
121
|
-
overflow-y: auto;
|
|
122
|
-
-webkit-overflow-scrolling: touch;
|
|
123
117
|
}
|
|
124
118
|
|
|
125
119
|
.console-list-group {
|
|
@@ -264,10 +258,6 @@ body {
|
|
|
264
258
|
}
|
|
265
259
|
|
|
266
260
|
.console-detail {
|
|
267
|
-
flex: 1;
|
|
268
|
-
min-height: 0;
|
|
269
|
-
overflow-y: auto;
|
|
270
|
-
-webkit-overflow-scrolling: touch;
|
|
271
261
|
display: flex;
|
|
272
262
|
flex-direction: column;
|
|
273
263
|
gap: 12px;
|
|
@@ -473,11 +463,14 @@ body {
|
|
|
473
463
|
}
|
|
474
464
|
|
|
475
465
|
.console-actionbar {
|
|
476
|
-
|
|
466
|
+
position: fixed;
|
|
467
|
+
bottom: 0;
|
|
468
|
+
left: 0;
|
|
469
|
+
right: 0;
|
|
470
|
+
z-index: 100;
|
|
477
471
|
background: #161b22;
|
|
478
472
|
border-top: 2px solid #30363d;
|
|
479
473
|
padding: 10px 16px;
|
|
480
|
-
padding-bottom: calc(10px + env(safe-area-inset-bottom));
|
|
481
474
|
}
|
|
482
475
|
|
|
483
476
|
.console-operation-bar {
|
|
@@ -568,10 +561,7 @@ body {
|
|
|
568
561
|
}
|
|
569
562
|
|
|
570
563
|
.console-detail-screen {
|
|
571
|
-
|
|
572
|
-
min-height: 0;
|
|
573
|
-
display: flex;
|
|
574
|
-
flex-direction: column;
|
|
564
|
+
padding-bottom: 140px;
|
|
575
565
|
}
|
|
576
566
|
|
|
577
567
|
.console-panel-open-link {
|