feat: show dataset item thumbnails

This commit is contained in:
2026-07-23 23:17:56 +08:00
parent 56d96f23dd
commit 400d768ecf
3 changed files with 31 additions and 3 deletions

View File

@@ -868,6 +868,19 @@
cursor: pointer;
}
.explore-article-item.has-image {
grid-template-columns: 30px minmax(0, 1fr) 76px;
}
.explore-article-thumbnail {
width: 76px;
height: 58px;
align-self: center;
border-radius: 8px;
background: var(--senlin-panel-muted);
object-fit: cover;
}
.explore-article-item:hover,
.explore-article-item.active {
background: color-mix(in srgb, var(--senlin-primary) 8%, var(--senlin-panel));

View File

@@ -391,7 +391,11 @@ export function WorkspaceExplorePage({
return (
<button
key={item.id}
className={item.id === selected.id ? 'explore-article-item active' : 'explore-article-item'}
className={[
'explore-article-item',
item.id === selected.id ? 'active' : '',
item.imageUrl ? 'has-image' : '',
].filter(Boolean).join(' ')}
onClick={() => setActiveItemID(item.id)}
>
<span className={`explore-source-logo ${itemSource.color}`}>{sourceInitial(itemSource.name)}</span>
@@ -402,6 +406,15 @@ export function WorkspaceExplorePage({
{item.summary || '暂无摘要'}
</Text>
</span>
{item.imageUrl ? (
<img
className="explore-article-thumbnail"
src={item.imageUrl}
alt=""
loading="lazy"
referrerPolicy="no-referrer"
/>
) : null}
</button>
)
})}