收口作品详情标签与作品号

将作品详情主题标签迁移到 PlatformPillBadge

将作品详情作品号复制按钮迁移到 CopyCodeButton pill 外观

删除作品详情本地 chip 基础样式

更新 PlatformUiKit 文档和 Hermes 决策记录
This commit is contained in:
2026-06-10 14:07:51 +08:00
parent b9ddc07e0a
commit eff95886ad
5 changed files with 32 additions and 18 deletions

View File

@@ -140,6 +140,13 @@ test('PlatformWorkDetailView renders compact stats and date time', () => {
expect(screen.getByText('2026-04-25')).toBeTruthy();
expect(screen.getAllByText('次')).toHaveLength(2);
expect(screen.getByText('赞')).toBeTruthy();
const tagChip = screen
.getAllByText('拼图')
.find((element) =>
element.className.includes('platform-work-detail__chip'),
);
expect(tagChip?.className).toContain('rounded-full');
expect(tagChip?.className).toContain('bg-[var(--platform-neutral-bg)]');
expect(screen.getByRole('button', { name: '返回' }).className).toContain(
'platform-icon-button',
);
@@ -240,7 +247,14 @@ test('PlatformWorkDetailView copies public work code and share text', async () =
/>,
);
fireEvent.click(screen.getByRole('button', { name: 'PZ-001' }));
const publicWorkCodeButton = screen.getByRole('button', { name: 'PZ-001' });
expect(publicWorkCodeButton.className).toContain('rounded-full');
expect(publicWorkCodeButton.className).toContain(
'bg-[var(--platform-neutral-bg)]',
);
fireEvent.click(publicWorkCodeButton);
expect(clipboardService.copyTextToClipboard).toHaveBeenCalledWith('PZ-001');
expect(await screen.findByText('已复制')).toBeTruthy();

View File

@@ -20,6 +20,7 @@ import { CopyCodeButton } from '../common/CopyCodeButton';
import { CopyFeedbackMessage } from '../common/CopyFeedbackMessage';
import { PlatformActionButton } from '../common/PlatformActionButton';
import { PlatformIconButton } from '../common/PlatformIconButton';
import { PlatformPillBadge } from '../common/PlatformPillBadge';
import { useCopyFeedback } from '../common/useCopyFeedback';
import { ResolvedAssetImage } from '../ResolvedAssetImage';
import {
@@ -426,9 +427,14 @@ export function PlatformWorkDetailView({
<section className="platform-work-detail__body">
<div className="platform-work-detail__chips">
{tags.map((tag) => (
<span key={tag} className="platform-work-detail__chip">
<PlatformPillBadge
key={tag}
tone="neutralSolid"
size="sm"
className="platform-work-detail__chip"
>
{tag}
</span>
</PlatformPillBadge>
))}
</div>
<p className="platform-work-detail__copy">{entry.summaryText}</p>
@@ -439,6 +445,9 @@ export function PlatformWorkDetailView({
codeLabel={null}
accessibleLabel={publicWorkCode}
title="复制作品号"
actionAppearance="pill"
actionPillTone="neutralSolid"
actionPillSize="sm"
className="platform-work-detail__code"
onClick={copyPublicWorkCode}
idleIcon={<Copy className="h-4 w-4" />}