收口作品详情标签与作品号
将作品详情主题标签迁移到 PlatformPillBadge 将作品详情作品号复制按钮迁移到 CopyCodeButton pill 外观 删除作品详情本地 chip 基础样式 更新 PlatformUiKit 文档和 Hermes 决策记录
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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" />}
|
||||
|
||||
@@ -8687,20 +8687,6 @@ button {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.platform-work-detail__chip,
|
||||
.platform-work-detail__code {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.4rem;
|
||||
border: 1px solid var(--platform-neutral-border);
|
||||
border-radius: 0.7rem;
|
||||
background: var(--platform-neutral-bg);
|
||||
color: var(--platform-neutral-text);
|
||||
padding: 0.42rem 0.75rem;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.platform-work-detail__copy {
|
||||
margin: 0;
|
||||
color: var(--platform-text-base);
|
||||
|
||||
Reference in New Issue
Block a user