diff --git a/src/presentation/styles/theme/shell.css b/src/presentation/styles/theme/shell.css index 3d3530bd..65087704 100644 --- a/src/presentation/styles/theme/shell.css +++ b/src/presentation/styles/theme/shell.css @@ -106,15 +106,10 @@ .theme-selector .ui-field__input, .locale-selector .ui-field__input { min-height: var(--size-control-sm); - max-width: 8.5rem; padding: 0.35rem 2rem 0.35rem 0.65rem; cursor: pointer; } - .locale-selector .ui-field__input { - max-width: 7rem; - } - .app-shell__session-error { position: absolute; top: calc(100% + 0.25rem); diff --git a/tests/e2e/i18n.spec.ts b/tests/e2e/i18n.spec.ts index bbff8e49..a877de53 100644 --- a/tests/e2e/i18n.spec.ts +++ b/tests/e2e/i18n.spec.ts @@ -22,6 +22,38 @@ test("switches the shell locale and keeps pseudo-locale copy within compact layo await expect(page.getByRole("button", { name: /Ménú/ })).toBeVisible(); }); +// UI-04. A fixed max-width clipped the selected value ("Light then", +// "라이트 테ㅁ"). The selector must be at least as wide as the browser's own +// width for its options, which depends on the font the machine has. +test("keeps the header selectors as wide as their options in every locale", async ({ + page, +}) => { + await page.setViewportSize({ width: 1280, height: 800 }); + await page.goto("/"); + const selectors = page.locator( + ".theme-selector select, .locale-selector select", + ); + await expect(selectors).toHaveCount(2); + + for (const locale of ["ko-KR", "en-US", "en-XA"]) { + await page.locator(".locale-selector select").selectOption(locale); + await expect(page.locator("html")).toHaveAttribute("lang", locale); + const shortfalls = await selectors.evaluateAll((elements) => + elements.map((element) => { + const select = element as HTMLSelectElement; + const actual = select.getBoundingClientRect().width; + const inline = select.style.cssText; + select.style.maxWidth = "none"; + select.style.width = "auto"; + const needed = select.getBoundingClientRect().width; + select.style.cssText = inline; + return Math.max(0, Math.round(needed - actual)); + }), + ); + expect(shortfalls, locale).toEqual([0, 0]); + } +}); + test("applies RTL to the shell and modal navigation without changing action semantics", async ({ page, }) => {