feat(webui): truncate long file names with 100ms hover tooltip (#355)

This commit is contained in:
Yiling-J
2026-08-27 10:54:35 +08:00
committed by GitHub
parent 5ec4cd7fcd
commit d9a8b6a191
7 changed files with 324 additions and 24 deletions
+6 -5
View File
@@ -7,15 +7,16 @@ interface CreateShareResponse {
}
/**
* Locates a file/folder card by its name. File names are rendered as
* `EditableText` inputs (not text nodes), so `getByText` does not match them.
* The returned locator points at the card wrapper div (right-clickable to open
* the card context menu).
* Locates a file/folder card by its name. Matches both read-only text nodes
* and active EditableText inputs. The returned locator points at the card
* wrapper div (right-clickable to open the card context menu).
*/
export function fileCard(page: Page, name: string): Locator {
return page
.locator('div.group')
.filter({ has: page.locator(`input[value="${name}"]`) })
.filter({
has: page.locator(`input[value="${name}"]`).or(page.getByText(name, { exact: true })),
})
.first()
}