继续收口运行态浮层暗色动作与行卡

统一运行态浮层里的标准暗色动作按钮到共享 PlatformActionButton
统一设置面板里的运行统计入口到共享 PlatformSubpanel 按钮壳
补充 PlatformUiKit 收口计划、共享决策记录与 quest offer 组件测试护栏
This commit is contained in:
2026-06-11 02:33:31 +08:00
parent 60ef4ead71
commit ab5a0efe50
4 changed files with 49 additions and 37 deletions

View File

@@ -351,7 +351,11 @@ test('quest offer accept button reuses the shared accepted-quest follow-up chain
expect(affinityRewardClassName).toContain('border-rose-300/18');
expect(currencyRewardClassName).toContain('border-amber-300/18');
expect(experienceRewardClassName).toContain('border-sky-400/18');
await user.click(await screen.findByRole('button', { name: '领取任务' }));
const acceptButton = await screen.findByRole('button', { name: '领取任务' });
expect(acceptButton.className).toContain(
'platform-action-button--editor-dark',
);
await user.click(acceptButton);
expect((await screen.findAllByText('任务进度0/1')).length).toBeGreaterThan(
0,
@@ -452,7 +456,12 @@ test('adventure statistics panel reuses dark PlatformSubpanel chrome', async ()
render(<QuestOfferHarness />);
await user.click(screen.getByRole('button', { name: '打开设置' }));
await user.click(await screen.findByRole('button', { name: //u }));
const statsEntryButton = await screen.findByRole('button', {
name: //u,
});
expect(statsEntryButton.className).toContain('bg-black/25');
expect(statsEntryButton.className).toContain('border-white/10');
await user.click(statsEntryButton);
const statsTitle = await screen.findByText('冒险统计');
const statsDialog = statsTitle.closest('.pixel-modal-shell');
@@ -496,9 +505,13 @@ test('quest completion notice reuses dark PlatformSubpanel chrome', async () =>
const noticeText = await screen.findByText('可前往任务日志领取奖励。');
const noticeClassName = findNearestClassName(noticeText, 'bg-black/25');
const openQuestLogButton = screen.getByRole('button', { name: '打开任务日志' });
expect(screen.getByText('奖励已准备')).toBeTruthy();
expect(noticeClassName).toContain('border-emerald-400/15');
expect(openQuestLogButton.className).toContain(
'platform-action-button--editor-dark',
);
});
test('battle reward modal reuses dark PlatformSubpanel chrome', async () => {

View File

@@ -1042,17 +1042,16 @@ export function RpgAdventurePanelOverlays({
</PlatformActionButton>
) : null}
<button
type="button"
<PlatformActionButton
surface="editorDark"
tone="primary"
size="xxs"
shape="pill"
onClick={closeGoalPanel}
className="pixel-nine-slice pixel-pressable px-4 py-2 text-xs text-white"
style={getNineSliceStyle(UI_CHROME.choiceButton, {
paddingX: 14,
paddingY: 8,
})}
className="px-4 py-2 text-xs"
>
</button>
</PlatformActionButton>
</div>
</motion.div>
</motion.div>
@@ -1126,10 +1125,14 @@ export function RpgAdventurePanelOverlays({
</div>
</div>
<button
<PlatformSubpanel
as="button"
type="button"
onClick={() => setIsStatsPanelOpen(true)}
className="w-full rounded-2xl border border-white/10 bg-black/25 px-4 py-3 text-left transition hover:border-white/20"
surface="dark"
radius="sm"
padding="sm"
className="w-full text-left transition hover:border-white/20"
>
<div className="flex items-center justify-between gap-3">
<div>
@@ -1142,7 +1145,7 @@ export function RpgAdventurePanelOverlays({
</div>
<BarChart3 className="h-4 w-4 text-amber-200/75" />
</div>
</button>
</PlatformSubpanel>
<PlatformActionButton
surface="editorDark"
@@ -1463,8 +1466,11 @@ export function RpgAdventurePanelOverlays({
{isPendingSelectedQuest && (
<div className="flex justify-end">
<button
type="button"
<PlatformActionButton
surface="editorDark"
tone="primary"
size="xs"
shape="pill"
onClick={() => {
const acceptedQuestId = onAcceptPendingNpcQuestOffer();
if (!acceptedQuestId) return;
@@ -1472,31 +1478,24 @@ export function RpgAdventurePanelOverlays({
setSelectedRewardItemId(null);
setSelectedBattleRewardItemId(null);
}}
className="pixel-nine-slice pixel-pressable px-4 py-2 text-xs text-white"
style={getNineSliceStyle(UI_CHROME.choiceButton, {
paddingX: 14,
paddingY: 8,
})}
>
</button>
</PlatformActionButton>
</div>
)}
{isQuestReadyToClaim(selectedQuest) &&
!isPendingSelectedQuest && (
<div className="flex justify-end">
<button
type="button"
<PlatformActionButton
surface="editorDark"
tone="ghost"
size="xs"
shape="pill"
onClick={() => setSelectedQuestId(null)}
className="pixel-nine-slice pixel-pressable px-4 py-2 text-xs text-white"
style={getNineSliceStyle(UI_CHROME.choiceButton, {
paddingX: 14,
paddingY: 8,
})}
>
</button>
</PlatformActionButton>
</div>
)}
</div>
@@ -1548,8 +1547,11 @@ export function RpgAdventurePanelOverlays({
: '可前往任务日志领取奖励。'}
</PlatformSubpanel>
<div className="flex justify-center">
<button
type="button"
<PlatformActionButton
surface="editorDark"
tone="primary"
size="xs"
shape="pill"
onClick={() => {
questUi.acknowledgeQuestCompletion(
completionNoticeQuest.id,
@@ -1557,14 +1559,9 @@ export function RpgAdventurePanelOverlays({
setCompletionNoticeQuestId(null);
setIsQuestPanelOpen(true);
}}
className="pixel-nine-slice pixel-pressable px-4 py-2 text-xs text-white"
style={getNineSliceStyle(UI_CHROME.choiceButton, {
paddingX: 14,
paddingY: 8,
})}
>
</button>
</PlatformActionButton>
</div>
</div>
</motion.div>