diff --git a/data/assets/styles.css b/data/assets/styles.css index ec97f1e0..37881fe2 100644 --- a/data/assets/styles.css +++ b/data/assets/styles.css @@ -10422,33 +10422,33 @@ body.ios>iframe { color: #fff; } -#user-pref>ul { +#user-pref ul { margin-bottom: .55em; padding-bottom: .5em; } -#user-pref>ul li.btn-group { +#user-pref ul li.btn-group { width: 100%; display: block; margin-bottom: .75em; } -#user-pref>ul li.btn-group:last-child { +#user-pref ul li.btn-group:last-child { margin-bottom: .35em; } -#user-pref>ul li.btn-group.option-romanization { +#user-pref ul li.btn-group.option-romanization { display: none; } -#user-pref>ul li.btn-group label { +#user-pref ul li.btn-group label { display: block; font-weight: 400; margin-top: 5px; text-shadow: 1px 1px 0 rgba(238,238,238,.7); } -#user-pref>ul li.btn-group button { +#user-pref ul li.btn-group button { float: none; margin-top: -.4em; border-radius: 4px !important; diff --git a/src/components/navbar-normal.tsx b/src/components/navbar-normal.tsx index c4855d61..6c233684 100644 --- a/src/components/navbar-normal.tsx +++ b/src/components/navbar-normal.tsx @@ -614,10 +614,14 @@ export function NavbarNormal({ currentLang }: NavbarNormalProps) { [closeDictionaryDropdown, navigate], ); - const handlePrefClick = useCallback((e: React.MouseEvent) => { - e.preventDefault(); - toggleUserPrefPanel(); - }, []); + const handlePrefClick = useCallback( + (e: React.MouseEvent) => { + e.preventDefault(); + closeDictionaryDropdown(); + toggleUserPrefPanel(); + }, + [closeDictionaryDropdown], + ); /** * 語言選項點擊:依照原 press-lang 邏輯計算目標路徑 diff --git a/src/utils/media-cdn.ts b/src/utils/media-cdn.ts index 5614567c..fd518f01 100644 --- a/src/utils/media-cdn.ts +++ b/src/utils/media-cdn.ts @@ -27,7 +27,7 @@ export const ASSET_CDN_BASE = "https://r2-assets.moedict.tw"; * edge-cached stylesheet key (the original unversioned object at 24h, or a * prior `?v=` version still cached at the 5-minute TTL). */ -export const LEGACY_STYLESHEET_VERSION = "20260711"; +export const LEGACY_STYLESHEET_VERSION = "20260914"; /** 筆畫 JSON:`${STROKE_JSON_BASE_URL}/{codepoint-hex}.json` */ export const STROKE_JSON_BASE_URL = `${ASSET_CDN_BASE}/stroke-json`; diff --git a/tests/e2e/legacy-styles-regression.spec.ts b/tests/e2e/legacy-styles-regression.spec.ts index 880ae4af..8e206493 100644 --- a/tests/e2e/legacy-styles-regression.spec.ts +++ b/tests/e2e/legacy-styles-regression.spec.ts @@ -313,6 +313,35 @@ test.describe("legacy styles.css \u2014 harness self-verification (controls)", ( ).not.toBe(blankDigest); }); + test("pref panel rows stack vertically under the real stylesheet (narrow viewport)", async ({ + page, + }) => { + // The React #user-pref markup nests its