fix: show inbox capture target context

This commit is contained in:
2026-06-05 08:10:33 +08:00
parent a8df9d118c
commit 22b05f57b4
4 changed files with 22 additions and 11 deletions
+11 -11
View File
@@ -1487,6 +1487,15 @@
if (!source) return ''
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) {
if (!item || !item.id) return
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-main">
<span class="inbox-item-title">{item.title}</span>
<span class="inbox-item-meta">
{#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>
<span class="inbox-item-meta">{inboxMetaText(item)}</span>
</div>
<div class="inbox-item-actions">
<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-main">
<span class="inbox-item-title">{item.title}</span>
<span class="inbox-item-meta">
{#if item.captureKind}{captureKindLabel(item.captureKind)} · {/if}
{#if item.captureSource}{captureSourceLabel(item.captureSource)} · {/if}
{formatDate(item.createdAt)}
</span>
<span class="inbox-item-meta">{inboxMetaText(item)}</span>
</div>
<div class="inbox-item-actions">
{#if item.suggestedTargetNodeId}
+1
View File
@@ -34,6 +34,7 @@ export default {
'inbox.keepHere': 'Keep here',
'inbox.localEmpty': 'No unprocessed materials for this case',
'inbox.capturedIn': 'Captured in',
'inbox.suggestedTarget': 'Target',
'inbox.assignTitle': 'Assign material',
'inbox.assignTarget': 'Case',
'inbox.assignSearchPlaceholder': 'Find case',
+1
View File
@@ -35,6 +35,7 @@ export default {
'inbox.keepHere': 'Оставить здесь',
'inbox.localEmpty': 'Для этого дела неразобранных материалов нет',
'inbox.capturedIn': 'Захвачено в',
'inbox.suggestedTarget': 'Цель',
'inbox.assignTitle': 'Разложить материал',
'inbox.assignTarget': 'Дело',
'inbox.assignSearchPlaceholder': 'Найти дело',