mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-27 10:46:51 +00:00
fix: truncate long sidebar stack names before trailing indicators clip (#1562)
Clamp the stack list width with ScrollArea block and min-w-0 on the row flex chain so long names ellipsize instead of pushing update dots past the sidebar edge. Add E2E layout coverage for trailing-indicator edge cases.
This commit is contained in:
+13
-4
@@ -25,7 +25,7 @@ export function totpNow(secret: string): string {
|
||||
}
|
||||
|
||||
/** Selector for the dashboard - only present in EditorLayout, not on login/setup pages */
|
||||
const DASHBOARD_INDICATOR = 'img[src*="sencho-logo"]';
|
||||
const DASHBOARD_INDICATOR = 'img[src*="sencho-logo"], button:has-text("Create Stack")';
|
||||
|
||||
/** Returns true if the current page is the first-run setup screen */
|
||||
async function isSetupPage(page: Page): Promise<boolean> {
|
||||
@@ -39,7 +39,8 @@ async function isLoginPage(page: Page): Promise<boolean> {
|
||||
|
||||
/** Returns true if the dashboard (EditorLayout) is loaded */
|
||||
export async function isDashboard(page: Page): Promise<boolean> {
|
||||
return page.locator(DASHBOARD_INDICATOR).isVisible().catch(() => false);
|
||||
const indicator = page.locator(DASHBOARD_INDICATOR).first();
|
||||
return indicator.isVisible().catch(() => false);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -74,7 +75,7 @@ export async function loginAs(page: Page, username = TEST_USERNAME, password = T
|
||||
const enterButton = page.getByRole('button', { name: /enter sencho/i });
|
||||
await expect(enterButton).toBeVisible({ timeout: 10_000 });
|
||||
await enterButton.click();
|
||||
await expect(page.locator(DASHBOARD_INDICATOR)).toBeVisible({ timeout: 10_000 });
|
||||
await waitForStacksLoaded(page);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -93,7 +94,7 @@ export async function loginAs(page: Page, username = TEST_USERNAME, password = T
|
||||
await usernameField.fill(username);
|
||||
await page.locator('#password').fill(password);
|
||||
await page.locator('button:has-text("Login"), button:has-text("Sign in")').first().click();
|
||||
await expect(page.locator(DASHBOARD_INDICATOR)).toBeVisible({ timeout: 10_000 });
|
||||
await waitForStacksLoaded(page);
|
||||
return;
|
||||
}
|
||||
// Fall through to the dashboard check below.
|
||||
@@ -104,6 +105,14 @@ export async function loginAs(page: Page, username = TEST_USERNAME, password = T
|
||||
return;
|
||||
}
|
||||
|
||||
// Cookie session may still be restoring after a hard reload.
|
||||
try {
|
||||
await waitForStacksLoaded(page);
|
||||
return;
|
||||
} catch {
|
||||
// fall through
|
||||
}
|
||||
|
||||
throw new Error(
|
||||
'loginAs: could not determine page state - expected setup, login, or dashboard. ' +
|
||||
'Check that E2E_USERNAME and E2E_PASSWORD are set correctly.',
|
||||
|
||||
Reference in New Issue
Block a user