Skip to content

Commit 5c1db4f

Browse files
authored
Merge pull request #3488 from modelscope/codex/fix-site-evidence-mobile-overflow-20260813
fix(site): prevent mobile evidence overflow
2 parents 72d7bc7 + 7c6075a commit 5c1db4f

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

web-pages/product-site/assets/css/site.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -989,6 +989,11 @@ td a {
989989
.evidence-list a {
990990
color: var(--blue-dark);
991991
font-weight: 700;
992+
overflow-wrap: anywhere;
993+
}
994+
995+
.evidence-list li {
996+
min-width: 0;
992997
}
993998

994999
.benchmark-intro > div {

web-pages/product-site/tests/browser/product-site.spec.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,40 @@ for (const viewport of [
160160
});
161161
}
162162

163+
for (const viewport of [
164+
{ name: 'mobile', width: 390, height: 844 },
165+
{ name: 'desktop', width: 1440, height: 900 },
166+
]) {
167+
test(`audio.cpp deployment is stable at ${viewport.name}`, async ({ page }, testInfo) => {
168+
await page.setViewportSize(viewport);
169+
await page.goto('/deploy/audio-cpp.html');
170+
171+
await expect(page.locator('h1')).toHaveText('audio.cpp 原生 Fun-ASR-Nano 与 SenseVoice');
172+
await expect(page.getByText('pinned SenseVoice GGUF package', { exact: false })).toBeVisible();
173+
await expect(page.locator('a[href="https://github.com/0xShug0/audio.cpp/pull/219"]')).toBeVisible();
174+
175+
const layout = await page.evaluate(() => ({
176+
overflow: document.documentElement.scrollWidth - document.documentElement.clientWidth,
177+
evidenceWidths: [...document.querySelectorAll<HTMLElement>('.evidence-list li')].map((node) => ({
178+
client: node.clientWidth,
179+
scroll: node.scrollWidth,
180+
})),
181+
commandWidths: [...document.querySelectorAll<HTMLElement>('.command-block')].map((node) => ({
182+
parent: node.parentElement?.getBoundingClientRect().width ?? 0,
183+
width: node.getBoundingClientRect().width,
184+
})),
185+
}));
186+
expect(layout.overflow).toBeLessThanOrEqual(1);
187+
expect(layout.evidenceWidths.every(({ client, scroll }) => scroll <= client + 1)).toBe(true);
188+
expect(layout.commandWidths.every(({ parent, width }) => width <= parent + 1)).toBe(true);
189+
190+
await page.screenshot({
191+
path: testInfo.outputPath(`audio-cpp-${viewport.name}.png`),
192+
fullPage: true,
193+
});
194+
});
195+
}
196+
163197
test('reduced motion disables smooth scrolling', async ({ page }) => {
164198
await page.emulateMedia({ reducedMotion: 'reduce' });
165199
await page.goto('/en/');

0 commit comments

Comments
 (0)