diff --git a/frontend/src/App.svelte b/frontend/src/App.svelte index a2eac89..aebd863 100644 --- a/frontend/src/App.svelte +++ b/frontend/src/App.svelte @@ -902,6 +902,11 @@ return item?.sourceKind || item?.captureKind || item?.type || '' } + function canShowInboxArtifactInFolder(item) { + const kind = inboxArtifactKind(item) + return kind !== 'url' && item?.type !== 'link' + } + function fileRecordToPreviewItem(item, record) { return { id: item.id, @@ -2584,7 +2589,9 @@ {/if} - + {#if canShowInboxArtifactInFolder(item)} + + {/if} diff --git a/scripts/check-gui-render.mjs b/scripts/check-gui-render.mjs index ac327dd..3fd78ca 100755 --- a/scripts/check-gui-render.mjs +++ b/scripts/check-gui-render.mjs @@ -144,6 +144,7 @@ async function runReadyScenario(cdp, url) { await clickText(cdp, '.inbox-header .btn', 'Вставить из буфера') 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 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', 'Разложить') @@ -485,6 +486,19 @@ async function clickInboxItemButton(cdp, title, buttonText) { await sleep(250) } +async function assertInboxItemButtonAbsent(cdp, title, buttonText, label) { + await assertEval(cdp, ` + (() => { + const norm = (value) => (value || '').replace(/\\s+/g, ' ').trim(); + const row = [...document.querySelectorAll('.inbox-item')] + .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)})); + })() + `, label) +} + async function evalValue(cdp, expression) { const result = await cdp.send('Runtime.evaluate', { expression,