feat(workbench): show progress update time first

This commit is contained in:
caoxiaozhu
2026-06-03 12:28:21 +08:00
parent 27dd2f0a0d
commit 6fc5e66ea1
4 changed files with 70 additions and 6 deletions

View File

@@ -96,7 +96,7 @@
} }
.progress-row { .progress-row {
grid-template-columns: minmax(126px, 0.9fr) minmax(270px, 1.35fr) minmax(86px, auto); grid-template-columns: minmax(72px, 0.42fr) minmax(126px, 0.86fr) minmax(270px, 1.32fr) minmax(86px, auto);
gap: 12px; gap: 12px;
} }
} }
@@ -325,15 +325,24 @@
/* 重点优化费用进度行的网格区域Grid Area双行重构 */ /* 重点优化费用进度行的网格区域Grid Area双行重构 */
.progress-row { .progress-row {
display: grid; display: grid;
grid-template-columns: 1fr 1fr; grid-template-columns: minmax(70px, auto) 1fr minmax(74px, auto);
grid-template-areas: grid-template-areas:
"identity result" "time identity result"
"steps steps"; "steps steps steps";
gap: 8px; gap: 8px;
padding: 10px 0; padding: 10px 0;
align-items: center; align-items: center;
} }
.progress-time {
grid-area: time;
width: 100%;
}
.progress-time time {
font-size: 11.5px;
}
.progress-identity { .progress-identity {
grid-area: identity; grid-area: identity;
width: 100%; width: 100%;

View File

@@ -554,7 +554,7 @@
.progress-row { .progress-row {
display: grid; display: grid;
grid-template-columns: minmax(138px, 0.9fr) minmax(300px, 1.5fr) minmax(92px, auto); grid-template-columns: minmax(78px, 0.44fr) minmax(138px, 0.86fr) minmax(300px, 1.46fr) minmax(92px, auto);
align-items: center; align-items: center;
gap: 12px; gap: 12px;
width: 100%; width: 100%;
@@ -563,6 +563,7 @@
text-align: left; text-align: left;
} }
.progress-time,
.progress-identity, .progress-identity,
.progress-result { .progress-result {
min-width: 0; min-width: 0;
@@ -570,6 +571,28 @@
gap: 2px; gap: 2px;
} }
.progress-time {
color: var(--workbench-muted);
}
.progress-time time {
min-width: 0;
overflow: hidden;
color: var(--workbench-ink);
font-size: 12px;
font-weight: 850;
line-height: 1.2;
text-overflow: ellipsis;
white-space: nowrap;
}
.progress-time small {
color: var(--workbench-muted);
font-size: 10px;
font-weight: 750;
line-height: 1.2;
}
.progress-result { .progress-result {
justify-items: end; justify-items: end;
} }

View File

@@ -205,6 +205,11 @@
class="progress-row" class="progress-row"
@click="openWorkbenchTarget(item)" @click="openWorkbenchTarget(item)"
> >
<span class="progress-time">
<time :datetime="item.updatedAt || ''">{{ item.displayTime }}</time>
<small>更新</small>
</span>
<span class="progress-identity"> <span class="progress-identity">
<strong>{{ item.id }}</strong> <strong>{{ item.id }}</strong>
<small>{{ item.title }}</small> <small>{{ item.title }}</small>
@@ -459,9 +464,26 @@ const visibleProgressItems = computed(() => {
const rows = Array.isArray(props.workbenchSummary.progressItems) const rows = Array.isArray(props.workbenchSummary.progressItems)
? props.workbenchSummary.progressItems ? props.workbenchSummary.progressItems
: [] : []
return rows.slice(0, 5) return rows.slice(0, 5).map((item) => ({
...item,
displayTime: formatProgressTime(item?.updatedAt)
}))
}) })
function formatProgressTime(value) {
const text = String(value || '').trim()
if (!text) {
return '最近更新'
}
const match = /^(\d{4})-(\d{2})-(\d{2})(?:[T\s](\d{2}):(\d{2}))?/.exec(text)
if (match) {
return match[4] ? `${match[2]}-${match[3]} ${match[4]}:${match[5]}` : `${match[2]}-${match[3]}`
}
return text
}
function buildSelectedFileKey(file) { function buildSelectedFileKey(file) {
return [file?.name, file?.size, file?.lastModified, file?.type].join('__') return [file?.name, file?.size, file?.lastModified, file?.type].join('__')
} }

View File

@@ -142,3 +142,13 @@ test('workbench submit shows intent recognition feedback before assistant opens'
assert.match(workbench, /if \(open\) \{\s*clearPendingAction\(\)/) assert.match(workbench, /if \(open\) \{\s*clearPendingAction\(\)/)
assert.match(workbench, /:readonly="isComposerPending"/) assert.match(workbench, /:readonly="isComposerPending"/)
}) })
test('workbench progress rows show update time first', () => {
assert.match(workbench, /class="progress-time"/)
assert.match(workbench, /<time :datetime="item\.updatedAt \|\| ''">\{\{ item\.displayTime \}\}<\/time>/)
assert.match(workbench, /displayTime: formatProgressTime\(item\?\.updatedAt\)/)
assert.match(workbench, /function formatProgressTime\(value\)/)
assert.match(workbenchStyles, /\.progress-row\s*\{[\s\S]*grid-template-columns:\s*minmax\(78px,\s*0\.44fr\)/)
assert.match(workbenchStyles, /\.progress-time\s*\{[\s\S]*color:\s*var\(--workbench-muted\);/)
assert.match(workbenchResponsiveStyles, /grid-template-areas:[\s\S]*"time identity result"[\s\S]*"steps steps steps"/)
})