fix(manga): show force-resync result on mobile, not just desktop

`.resync-msg` (the admin Force-resync result) was display:none under 640px,
so mobile admins — who trigger resync from the overflow sheet — got no
success or error feedback. The element is already a sibling of `.action-row`
(not a child), so it survives the row being hidden; the only thing hiding it
was an explicit mobile rule. Drop that rule.

e2e: a mobile admin triggers Force resync from the overflow sheet and now
sees the "Metadata updated" result (written test-first against the hidden
element, then unhidden).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
MechaCat02
2026-06-25 20:05:42 +02:00
parent 194adf1339
commit 94591dfda4
2 changed files with 48 additions and 3 deletions

View File

@@ -236,6 +236,51 @@ test.describe('mobile manga detail', () => {
await expect(sheet.getByTestId('overflow-add-to-collection')).toBeVisible();
});
test('phone viewport: force resync from the overflow sheet surfaces a result message', async ({
page
}) => {
await mockDetail(page, { authed: true });
// Upgrade the session to admin so the Force resync action is offered.
// Registered after mockDetail so this auth/me wins (Playwright routes
// resolve most-recently-registered first).
await page.route('**/api/v1/auth/me', (route) =>
route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({
user: {
id: 'u1',
username: 'admin',
created_at: '2026-01-01T00:00:00Z',
is_admin: true
}
})
})
);
await page.route(`**/api/v1/admin/mangas/${mangaId}/resync`, (route) =>
route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({
manga: mangaFixture(),
cover_fetched: true,
metadata_status: 'updated'
})
})
);
await page.setViewportSize(MOBILE);
await page.goto(`/manga/${mangaId}`);
await page.getByTestId('detail-overflow').click();
await page.getByTestId('overflow-force-resync').click();
// The result was previously display:none under 640px, leaving mobile
// admins with no feedback. It must now be visible.
const msg = page.getByTestId('force-resync-message');
await expect(msg).toBeVisible();
await expect(msg).toContainText(/Metadata updated/i);
});
test('desktop viewport: mobile hero is hidden, existing layout + action-row stays', async ({
page
}) => {

View File

@@ -1243,9 +1243,9 @@
display: none;
}
.resync-msg {
display: none;
}
/* `.resync-msg` is a sibling of `.action-row`, not a child, so it
survives the row being hidden. Keep it visible on mobile: admins
trigger Force resync from the overflow sheet and need the result. */
.continue {
display: none;