fix: improve mobile terminal region tabs

This commit is contained in:
2569718930@qq.com
2026-06-05 16:08:34 +08:00
parent 2af1cf9cd8
commit e6a1d14b09
3 changed files with 66 additions and 27 deletions
@@ -36,6 +36,10 @@ export function runTests() {
path.join(projectRoot, "components", "dashboard", "scan-terminal", "use-scan-terminal-query.ts"),
"utf8",
);
const mobileRegionTabsSource = fs.readFileSync(
path.join(projectRoot, "components", "dashboard", "scan-terminal", "MobileRegionTabs.tsx"),
"utf8",
);
assert(
dashboardSource.includes("MAX_TERMINAL_CHARTS = 9"),
@@ -57,6 +61,16 @@ export function runTests() {
dashboardSource.includes("disableClose={true}"),
"mobile terminal should render one selected chart and suggest landscape for the full grid",
);
assert(
dashboardSource.includes("mobile-region-tabs-shell") &&
dashboardSource.includes("handleMobileSelectTab") &&
dashboardSource.includes("mobileSelectedRowInActiveGroup") &&
dashboardSource.includes("mobileActiveGroup?.rows[0]") &&
mobileRegionTabsSource.includes("min-h-11") &&
mobileRegionTabsSource.includes("snap-x") &&
mobileRegionTabsSource.includes("aria-pressed={isActive}"),
"mobile region navigation must stay visible above the landscape hint, remain touch-friendly, and switch the visible chart with the active region",
);
assert(
!dashboardSource.includes("disableClose={visibleSlots.filter(Boolean).length <= 1}"),
"desktop chart slots must allow clearing the last visible city so users can close a 1x1 chart",