继续扩展共享可导航行

扩展 PlatformNavigableListItem 接入 profile 设置行
补充 profile 设置行的组件级与首页集成回归测试
更新 PlatformUiKit 收口计划与共享决策记录
This commit is contained in:
2026-06-11 03:22:34 +08:00
parent 22c6edb7c2
commit 051fd6156c
5 changed files with 22 additions and 11 deletions

View File

@@ -72,7 +72,10 @@ describe('PlatformProfilePrimitives', () => {
</>,
);
await user.click(screen.getByRole('button', { name: //u }));
const settingsButton = screen.getByRole('button', { name: //u });
expect(settingsButton.className).toContain('platform-navigable-list-item');
await user.click(settingsButton);
expect(onSettingsClick).toHaveBeenCalledTimes(1);
await user.click(

View File

@@ -8,6 +8,7 @@ import {
LEGAL_DOCUMENTS,
type LegalDocumentId,
} from '../common/legalDocuments';
import { PlatformNavigableListItem } from '../common/PlatformNavigableListItem';
type ProfileStatCardProps = {
cardKey: ProfileDashboardCardKey;
@@ -119,21 +120,23 @@ export function ProfileSettingsRow({
const Icon = icon;
return (
<button
type="button"
<PlatformNavigableListItem
onClick={onClick}
className="platform-profile-settings-row flex w-full items-center justify-between gap-3 px-4 py-3 text-left transition"
>
<span className="flex min-w-0 items-center gap-3">
className="platform-profile-settings-row px-4 py-3 transition"
leading={
<span className="platform-profile-settings-row__icon">
<Icon className="h-4 w-4" />
</span>
<span className="truncate text-[14px] font-semibold text-[var(--platform-text-strong)]">
{label}
</span>
}
bodyClassName="flex min-w-0 items-center"
trailing={
<ChevronRight className="h-4 w-4 shrink-0 text-[var(--platform-text-soft)]" />
}
>
<span className="truncate text-[14px] font-semibold text-[var(--platform-text-strong)]">
{label}
</span>
<ChevronRight className="h-4 w-4 shrink-0 text-[var(--platform-text-soft)]" />
</button>
</PlatformNavigableListItem>
);
}

View File

@@ -3027,6 +3027,9 @@ test('mobile profile page matches the reference layout sections', async () => {
expect(
within(settingsRegion).getByRole('button', { name: //u }),
).toBeTruthy();
expect(
within(settingsRegion).getByRole('button', { name: //u }).className,
).toContain('platform-navigable-list-item');
expect(
within(settingsRegion).queryByRole('button', { name: //u }),
).toBeNull();