Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions frontend/src/pages/playtest/workbench/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -477,9 +477,12 @@ function PlaytestExperience({
)
})}
</div>
<div className="hidden min-w-[116px] px-3 sm:block">
<div className="hidden w-56 min-w-0 px-3 sm:block lg:w-80">
<p className="text-[10px] text-app-faint">当前动作</p>
<p className="mt-0.5 truncate text-xs font-semibold">
<p
className="mt-0.5 truncate text-xs font-semibold"
title={runtime.action?.name ?? '无'}
>
{runtime.action?.name ?? '无'}
</p>
</div>
Expand Down
28 changes: 28 additions & 0 deletions frontend/src/pages/playtest/workbench/minimal-workbench.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,34 @@ describe('PlaytestWorkbench minimal control path', () => {
expect(screen.getByRole('button', { name: '绑定动作:行走' })).toBeTruthy()
})

it('keeps a long current action name inside a bounded control slot', () => {
const longActionName =
'32帧原地呼吸循环:东向站立,胸腔与肩部缓慢起伏,重心轻微上下移动,保持单角色与脚底线稳定。'
const characterWithLongActionName: Character = {
...character,
outfits: character.outfits.map((outfit) => ({
...outfit,
actions: outfit.actions.map((action) =>
action.id === IDLE_ACTION_ID ? { ...action, name: longActionName } : action,
),
})),
}

render(
<PlaytestWorkbench
character={characterWithLongActionName}
outfitId={OUTFIT_ID}
movementMode="single"
initialActionId={IDLE_ACTION_ID}
/>,
)

const currentActionSlot = screen.getByText('当前动作').parentElement
expect(currentActionSlot?.className).toContain('w-56')
expect(currentActionSlot?.className).toContain('min-w-0')
expect(currentActionSlot?.querySelector(`[title="${longActionName}"]`)).toBeTruthy()
})

it('uses the same bound character actions for keyboard movement', () => {
renderWorkbench()

Expand Down
Loading