From 0f9c36eda40a85f94a58d6f3eae0b12c1fd4ebbb Mon Sep 17 00:00:00 2001 From: xyh202131 Date: Sat, 29 Aug 2026 04:35:54 +0800 Subject: [PATCH] fix(playtest): bound long current action labels Keep prompt-like action names from stretching the control dock while preserving the full text on hover. Co-Authored-By: Codex --- .../src/pages/playtest/workbench/index.tsx | 7 +++-- .../workbench/minimal-workbench.test.tsx | 28 +++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/playtest/workbench/index.tsx b/frontend/src/pages/playtest/workbench/index.tsx index 2f41e5825..1da580b07 100644 --- a/frontend/src/pages/playtest/workbench/index.tsx +++ b/frontend/src/pages/playtest/workbench/index.tsx @@ -477,9 +477,12 @@ function PlaytestExperience({ ) })} -
+

当前动作

-

+

{runtime.action?.name ?? '无'}

diff --git a/frontend/src/pages/playtest/workbench/minimal-workbench.test.tsx b/frontend/src/pages/playtest/workbench/minimal-workbench.test.tsx index 0d5b36615..9518c0df5 100644 --- a/frontend/src/pages/playtest/workbench/minimal-workbench.test.tsx +++ b/frontend/src/pages/playtest/workbench/minimal-workbench.test.tsx @@ -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( + , + ) + + 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()