feat: simplify inbox actions and group task tabs

This commit is contained in:
2026-06-05 12:32:36 +08:00
parent 6d15639b41
commit 23f517dee3
7 changed files with 59 additions and 21 deletions
+17 -3
View File
@@ -145,6 +145,14 @@ async function runReadyScenario(cdp, url) {
await assertText(cdp, 'example.test', 'inbox: clipboard URL captured')
await assertText(cdp, 'Ссылка', 'inbox: clipboard URL kind visible')
await assertInboxItemButtonAbsent(cdp, 'example.test', 'Показать в проводнике', 'inbox: link has no explorer action')
await assertEval(cdp, `
(() => {
const row = [...document.querySelectorAll('.inbox-item')].find((el) => el.innerText.includes('example.test'));
if (!row) return false;
const iconButtons = [...row.querySelectorAll('.inbox-icon-btn')];
return iconButtons.length >= 3 && iconButtons.every((btn) => btn.title && btn.innerText.trim() === '');
})()
`, 'inbox: frequent actions are icon buttons with titles')
await clickInboxItemButton(cdp, 'example.test', 'Открыть')
await assertEval(cdp, `window.__VERSTAK_GUI_SMOKE__.state.openedUrls.includes('https://example.test/from-clipboard')`, 'inbox: open URL launches external URL')
await clickInboxItemButton(cdp, 'example.test', 'Разложить')
@@ -202,6 +210,8 @@ async function runReadyScenario(cdp, url) {
await waitForSelector(cdp, '.tabs')
await assertText(cdp, 'Smoke Project', 'node: selected project visible')
await assertEval(cdp, `document.querySelectorAll('.tab').length === 8`, 'node: all primary tabs rendered')
await assertEval(cdp, `[...document.querySelectorAll('.tab')].map((el) => el.innerText.trim()).join('|') === 'Обзор|Заметки|Файлы|Ссылки|Действия|Активность|Журнал|Неразобранное'`, 'node: tabs use content-first order')
await assertEval(cdp, `document.querySelector('.tab-separator') !== null`, 'node: service tabs are visually separated')
await screenshot(cdp, 'node-overview.png')
await clickText(cdp, '.tab', 'Заметки')
@@ -492,7 +502,9 @@ async function clickInboxItemButton(cdp, title, buttonText) {
.find((node) => norm(node.innerText || node.textContent).includes(${JSON.stringify(title)}));
if (!row) return false;
const btn = [...row.querySelectorAll('button')]
.find((node) => norm(node.innerText || node.textContent).includes(${JSON.stringify(buttonText)}));
.find((node) => norm(node.innerText || node.textContent).includes(${JSON.stringify(buttonText)}) ||
norm(node.getAttribute('title')).includes(${JSON.stringify(buttonText)}) ||
norm(node.getAttribute('aria-label')).includes(${JSON.stringify(buttonText)}));
if (!btn) return false;
btn.click();
return true;
@@ -510,7 +522,9 @@ async function assertInboxItemButtonAbsent(cdp, title, buttonText, label) {
.find((node) => norm(node.innerText || node.textContent).includes(${JSON.stringify(title)}));
if (!row) return false;
return ![...row.querySelectorAll('button')]
.some((node) => norm(node.innerText || node.textContent).includes(${JSON.stringify(buttonText)}));
.some((node) => norm(node.innerText || node.textContent).includes(${JSON.stringify(buttonText)}) ||
norm(node.getAttribute('title')).includes(${JSON.stringify(buttonText)}) ||
norm(node.getAttribute('aria-label')).includes(${JSON.stringify(buttonText)}));
})()
`, label)
}
@@ -848,7 +862,7 @@ function wailsMockSource() {
return (parsed.protocol === 'http:' || parsed.protocol === 'https:') && parsed.hostname ? raw : '';
} catch {
try {
const withScheme = `https://${raw}`;
const withScheme = 'https://' + raw;
const parsed = new URL(withScheme);
return parsed.hostname && parsed.hostname.includes('.') ? withScheme : '';
} catch {