收口个人中心钱包账单组件

迁移钱包账单空态到 PlatformEmptyState

迁移钱包账单行到 PlatformSubpanel 并保留收支展示

补充钱包账单公共组件断言

更新 PlatformUiKit 文档和 Hermes 决策记录
This commit is contained in:
2026-06-10 12:08:08 +08:00
parent 930f43661b
commit 0f5e0114a9
4 changed files with 33 additions and 7 deletions

View File

@@ -1265,7 +1265,13 @@ test('opens wallet ledger modal from narrative coin card', async () => {
expect(balanceBadge.className).toContain('border-rose-100');
expect(balanceBadge.className).toContain('bg-white/70');
expect(mockGetRpgProfileWalletLedger).toHaveBeenCalledTimes(1);
expect(screen.getByText('资产操作消耗')).toBeTruthy();
const consumeLedgerRow = screen
.getByText('资产操作消耗')
.closest('[class*="shadow-sm"]') as HTMLElement;
expect(consumeLedgerRow.className).toContain(
'border-[var(--platform-subpanel-border)]',
);
expect(consumeLedgerRow.className).toContain('shadow-sm');
expect(screen.getByText('-1')).toBeTruthy();
expect(screen.getByText('填写邀请码奖励')).toBeTruthy();
expect(screen.getByText('+30')).toBeTruthy();
@@ -3102,7 +3108,12 @@ test('wallet ledger modal shows empty and error states', async () => {
await user.click(screen.getByRole('button', { name: /\s*0/u }));
expect(await screen.findByText('泥点账单')).toBeTruthy();
await waitFor(() => {
expect(screen.getByText('暂无账单记录')).toBeTruthy();
const emptyState = screen.getByText('暂无账单记录');
expect(emptyState).toBeTruthy();
expect(emptyState.className).toContain('platform-empty-state');
expect(emptyState.className).toContain(
'border-[var(--platform-subpanel-border)]',
);
});
await user.click(screen.getByLabelText('关闭泥点账单'));

View File

@@ -3410,16 +3410,24 @@ function WalletLedgerModal({
))}
</div>
) : entries.length === 0 ? (
<div className="mt-5 rounded-xl border border-zinc-200 bg-white px-4 py-8 text-center text-sm font-semibold text-zinc-500">
<PlatformEmptyState
surface="subpanel"
size="inline"
className="mt-5 py-8"
>
</div>
</PlatformEmptyState>
) : (
<div className="mt-5 space-y-2.5">
{entries.map((entry) => {
return (
<div
<PlatformSubpanel
as="div"
key={entry.id}
className="flex items-center justify-between gap-3 rounded-xl border border-zinc-200 bg-white px-3 py-3 shadow-sm"
surface="flat"
radius="xs"
padding="none"
className="flex items-center justify-between gap-3 px-3 py-3 shadow-sm"
>
<div className="min-w-0">
<div className="truncate text-sm font-black text-zinc-900">
@@ -3441,7 +3449,7 @@ function WalletLedgerModal({
{entry.balanceLabel}
</div>
</div>
</div>
</PlatformSubpanel>
);
})}
</div>