fix: show inbox capture target context
This commit is contained in:
parent
a8df9d118c
commit
22b05f57b4
|
|
@ -1487,6 +1487,15 @@
|
||||||
if (!source) return ''
|
if (!source) return ''
|
||||||
return t('capture.source.' + source)
|
return t('capture.source.' + source)
|
||||||
}
|
}
|
||||||
|
function inboxMetaText(item) {
|
||||||
|
const parts = []
|
||||||
|
if (item.captureKind) parts.push(captureKindLabel(item.captureKind))
|
||||||
|
if (item.captureSource) parts.push(captureSourceLabel(item.captureSource))
|
||||||
|
if (item.captureContextLabel) parts.push(`${t('inbox.capturedIn')}: ${item.captureContextLabel}`)
|
||||||
|
if (item.suggestedTargetLabel) parts.push(`${t('inbox.suggestedTarget')}: ${item.suggestedTargetLabel}`)
|
||||||
|
parts.push(formatDate(item.capturedAt || item.createdAt))
|
||||||
|
return parts.filter(Boolean).join(' · ')
|
||||||
|
}
|
||||||
function addInboxCapture(item) {
|
function addInboxCapture(item) {
|
||||||
if (!item || !item.id) return
|
if (!item || !item.id) return
|
||||||
inboxNodes = [item, ...inboxNodes.filter(existing => existing.id !== item.id)]
|
inboxNodes = [item, ...inboxNodes.filter(existing => existing.id !== item.id)]
|
||||||
|
|
@ -2345,12 +2354,7 @@
|
||||||
<div class="inbox-item" role="button" tabindex="0" on:click={() => openInboxArtifact(item)} on:keydown={(e) => e.key === 'Enter' && openInboxArtifact(item)}>
|
<div class="inbox-item" role="button" tabindex="0" on:click={() => openInboxArtifact(item)} on:keydown={(e) => e.key === 'Enter' && openInboxArtifact(item)}>
|
||||||
<div class="inbox-item-main">
|
<div class="inbox-item-main">
|
||||||
<span class="inbox-item-title">{item.title}</span>
|
<span class="inbox-item-title">{item.title}</span>
|
||||||
<span class="inbox-item-meta">
|
<span class="inbox-item-meta">{inboxMetaText(item)}</span>
|
||||||
{#if item.captureKind}{captureKindLabel(item.captureKind)} · {/if}
|
|
||||||
{#if item.captureSource}{captureSourceLabel(item.captureSource)} · {/if}
|
|
||||||
{#if item.captureContextLabel}{t('inbox.capturedIn')}: {item.captureContextLabel} · {/if}
|
|
||||||
{formatDate(item.capturedAt || item.createdAt)}
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="inbox-item-actions">
|
<div class="inbox-item-actions">
|
||||||
<button class="btn btn-sm btn-primary" on:click|stopPropagation={() => resolveInboxHere(item)}>{t('inbox.keepHere')}</button>
|
<button class="btn btn-sm btn-primary" on:click|stopPropagation={() => resolveInboxHere(item)}>{t('inbox.keepHere')}</button>
|
||||||
|
|
@ -2577,11 +2581,7 @@
|
||||||
<div class="inbox-item" role="button" tabindex="0" on:click={() => openInboxArtifact(item)} on:keydown={(e) => e.key === 'Enter' && openInboxArtifact(item)}>
|
<div class="inbox-item" role="button" tabindex="0" on:click={() => openInboxArtifact(item)} on:keydown={(e) => e.key === 'Enter' && openInboxArtifact(item)}>
|
||||||
<div class="inbox-item-main">
|
<div class="inbox-item-main">
|
||||||
<span class="inbox-item-title">{item.title}</span>
|
<span class="inbox-item-title">{item.title}</span>
|
||||||
<span class="inbox-item-meta">
|
<span class="inbox-item-meta">{inboxMetaText(item)}</span>
|
||||||
{#if item.captureKind}{captureKindLabel(item.captureKind)} · {/if}
|
|
||||||
{#if item.captureSource}{captureSourceLabel(item.captureSource)} · {/if}
|
|
||||||
{formatDate(item.createdAt)}
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="inbox-item-actions">
|
<div class="inbox-item-actions">
|
||||||
{#if item.suggestedTargetNodeId}
|
{#if item.suggestedTargetNodeId}
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ export default {
|
||||||
'inbox.keepHere': 'Keep here',
|
'inbox.keepHere': 'Keep here',
|
||||||
'inbox.localEmpty': 'No unprocessed materials for this case',
|
'inbox.localEmpty': 'No unprocessed materials for this case',
|
||||||
'inbox.capturedIn': 'Captured in',
|
'inbox.capturedIn': 'Captured in',
|
||||||
|
'inbox.suggestedTarget': 'Target',
|
||||||
'inbox.assignTitle': 'Assign material',
|
'inbox.assignTitle': 'Assign material',
|
||||||
'inbox.assignTarget': 'Case',
|
'inbox.assignTarget': 'Case',
|
||||||
'inbox.assignSearchPlaceholder': 'Find case',
|
'inbox.assignSearchPlaceholder': 'Find case',
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ export default {
|
||||||
'inbox.keepHere': 'Оставить здесь',
|
'inbox.keepHere': 'Оставить здесь',
|
||||||
'inbox.localEmpty': 'Для этого дела неразобранных материалов нет',
|
'inbox.localEmpty': 'Для этого дела неразобранных материалов нет',
|
||||||
'inbox.capturedIn': 'Захвачено в',
|
'inbox.capturedIn': 'Захвачено в',
|
||||||
|
'inbox.suggestedTarget': 'Цель',
|
||||||
'inbox.assignTitle': 'Разложить материал',
|
'inbox.assignTitle': 'Разложить материал',
|
||||||
'inbox.assignTarget': 'Дело',
|
'inbox.assignTarget': 'Дело',
|
||||||
'inbox.assignSearchPlaceholder': 'Найти дело',
|
'inbox.assignSearchPlaceholder': 'Найти дело',
|
||||||
|
|
|
||||||
|
|
@ -263,6 +263,15 @@ async function runReadyScenario(cdp, url) {
|
||||||
await clickText(cdp, '.tab', 'Активность')
|
await clickText(cdp, '.tab', 'Активность')
|
||||||
await assertText(cdp, 'Smoke activity', 'activity: per-node activity visible')
|
await assertText(cdp, 'Smoke activity', 'activity: per-node activity visible')
|
||||||
|
|
||||||
|
await emitDroppedFiles(cdp, ['/tmp/project-context-file.txt'])
|
||||||
|
await clickText(cdp, '.nav-item', 'Неразобранное')
|
||||||
|
await assertText(cdp, 'project-context-file.txt', 'inbox: node-context capture visible globally')
|
||||||
|
await assertText(cdp, 'Захвачено в: Smoke Project', 'inbox: global list shows capture context')
|
||||||
|
await assertText(cdp, 'Цель: Smoke Project', 'inbox: global list shows suggested target')
|
||||||
|
await clickInboxItemButton(cdp, 'project-context-file.txt', 'Удалить')
|
||||||
|
await clickText(cdp, '.overlay .btn', 'Удалить')
|
||||||
|
await assertEval(cdp, `!document.querySelector('.inbox-screen')?.innerText.includes('project-context-file.txt')`, 'inbox: node-context capture can be deleted')
|
||||||
|
|
||||||
await clickText(cdp, '.nav-item', 'Сегодня')
|
await clickText(cdp, '.nav-item', 'Сегодня')
|
||||||
await assertText(cdp, 'Сегодня', 'today: system view opens')
|
await assertText(cdp, 'Сегодня', 'today: system view opens')
|
||||||
await assertText(cdp, 'Smoke Project', 'today: dashboard data visible')
|
await assertText(cdp, 'Smoke Project', 'today: dashboard data visible')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue