From 11fca1ed8bad17ef676a3a6f7ba3b029a44fc02b Mon Sep 17 00:00:00 2001 From: hided62 Date: Sun, 30 Aug 2026 01:27:06 +0000 Subject: [PATCH] =?UTF-8?q?=EC=82=AC=EB=A0=B9=EB=B6=80=20=EC=A7=80?= =?UTF-8?q?=EB=8F=84=20=EC=9E=85=EB=A0=A5=EC=B0=BD=20=EB=84=88=EB=B9=84?= =?UTF-8?q?=EB=A5=BC=20=ED=86=B5=EC=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/game-frontend/e2e/commandArguments.spec.ts | 15 +++++++++++++++ .../components/command/ReservedCommandEditor.vue | 15 +++++++++++---- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/app/game-frontend/e2e/commandArguments.spec.ts b/app/game-frontend/e2e/commandArguments.spec.ts index 70dbcb07..47621e83 100644 --- a/app/game-frontend/e2e/commandArguments.spec.ts +++ b/app/game-frontend/e2e/commandArguments.spec.ts @@ -2161,6 +2161,7 @@ test('touch command maps select city and nation on the first tap without changin test('shows a map and target details for every city or nation argument chief command except assignment', async ({ page, }) => { + test.setTimeout(60_000); await install(page); await page.setViewportSize({ width: 1200, height: 900 }); const cases = [ @@ -2207,6 +2208,20 @@ test('shows a map and target details for every city or nation argument chief com await page.screenshot({ path: test.info().outputPath('chief-command-target-map-details.png'), fullPage: true }); + const targetMapPickerWidth = await page + .getByTestId('command-picker') + .evaluate((element) => element.getBoundingClientRect().width); + await page.goto('/che/chief-center'); + await page.getByRole('button', { name: '1턴 명령 입력', exact: true }).click(); + const capitalPicker = page.getByTestId('command-picker'); + await capitalPicker.getByRole('button', { name: /^(?:국가:)?특수$/ }).click(); + await capitalPicker.getByRole('button', { name: /증축/ }).click(); + await expect(capitalPicker.getByTestId('command-argument-map')).toBeVisible(); + const capitalMapPickerWidth = await capitalPicker.evaluate((element) => element.getBoundingClientRect().width); + expect(capitalMapPickerWidth).toBe(targetMapPickerWidth); + expect(capitalMapPickerWidth).toBeGreaterThanOrEqual(700); + await capitalPicker.screenshot({ path: test.info().outputPath('chief-capital-map-expanded-desktop.png') }); + await page.setViewportSize({ width: 500, height: 900 }); await page.goto('/che/chief-center'); await page.getByRole('button', { name: '1턴 명령 입력', exact: true }).click(); diff --git a/app/game-frontend/src/components/command/ReservedCommandEditor.vue b/app/game-frontend/src/components/command/ReservedCommandEditor.vue index 028ac2e3..d496aca4 100644 --- a/app/game-frontend/src/components/command/ReservedCommandEditor.vue +++ b/app/game-frontend/src/components/command/ReservedCommandEditor.vue @@ -2,7 +2,7 @@ import { computed, nextTick, onBeforeUnmount, onMounted, ref, shallowRef, watch } from 'vue'; import CommandArgumentForm from '../main/CommandArgumentForm.vue'; import CommandSelectForm from '../main/CommandSelectForm.vue'; -import { commandArgumentPresentation } from './commandArgumentPresentation'; +import { commandArgumentPresentation, resolveCommandArgumentMapTarget } from './commandArgumentPresentation'; import DragSelect from './DragSelect.vue'; import RecruitmentCommandForm from './RecruitmentCommandForm.vue'; import { @@ -134,6 +134,15 @@ const quickPickerTop = ref('38px'); const isRecruitmentCommand = computed( () => selectedCommand.value?.key === 'che_징병' || selectedCommand.value?.key === 'che_모병' ); +const isArgumentPickerExpanded = computed(() => { + const command = selectedCommand.value; + if (!command) return false; + const presentation = commandArgumentPresentation(command.key); + return Boolean( + (command.reqArg && presentation.lines.length) || + resolveCommandArgumentMapTarget(command.key, command.inputFields) + ); +}); const isRecruitmentOverlayOpen = computed(() => pickerOpen.value && isRecruitmentCommand.value); const commandBrief = (entry: { action: string; args: unknown; label?: string }): string => formatReservedCommandBrief(props.scope, entry.action, entry.args, props.commandTable) || @@ -361,9 +370,7 @@ const clickOutsideMenu = (event: Event) => { mobile: props.mobile, 'edit-mode': editMode, 'picker-open': pickerOpen, - 'argument-expanded': Boolean( - selectedCommand?.reqArg && commandArgumentPresentation(selectedCommand.key).lines.length - ), + 'argument-expanded': isArgumentPickerExpanded, }" :data-command-scope="props.scope" >