From 092d71bdf310d3b7ad54aa25e137a9c3f3dccaf5 Mon Sep 17 00:00:00 2001 From: huyan Date: Sat, 19 Sep 2026 00:53:31 +0800 Subject: [PATCH 1/4] feat(character): lay four-way masters out on the nine-cell direction grid MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 四向原本排成 2×2 方阵,读不出方位。改成和八向同一张九宫格:北在上中、南在下中、西在左中、东在右中,四角与中心留空。 --- frontend/src/entities/character/directions.test.ts | 4 ++-- frontend/src/entities/character/directions.ts | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/src/entities/character/directions.test.ts b/frontend/src/entities/character/directions.test.ts index f9e5086c..03dc6306 100644 --- a/frontend/src/entities/character/directions.test.ts +++ b/frontend/src/entities/character/directions.test.ts @@ -11,8 +11,8 @@ describe('direction grid layouts', () => { it('maps single, four-way, and eight-way assets to their display grids', () => { expect(getDirectionGridLayout('single')).toEqual({ columns: 1, cells: ['east'] }) expect(getDirectionGridLayout('four-way')).toEqual({ - columns: 2, - cells: ['north', 'south', 'west', 'east'], + columns: 3, + cells: [null, 'north', null, 'west', null, 'east', null, 'south', null], }) expect(getDirectionGridLayout('eight-way')).toEqual({ columns: 3, diff --git a/frontend/src/entities/character/directions.ts b/frontend/src/entities/character/directions.ts index 402591ef..a77f605d 100644 --- a/frontend/src/entities/character/directions.ts +++ b/frontend/src/entities/character/directions.ts @@ -59,9 +59,10 @@ const DIRECTION_PROFILES: Record = { const DIRECTION_GRID_LAYOUTS: Record = { single: { columns: 1, cells: ['east'] }, + /** 四向也走九宫格:方位落在它本来的位置上,四角和中心空着,不挤成 2×2 方阵。 */ 'four-way': { - columns: 2, - cells: ['north', 'south', 'west', 'east'], + columns: 3, + cells: [null, 'north', null, 'west', null, 'east', null, 'south', null], }, 'eight-way': { columns: 3, From 7796d98b99419c96ee5e7626be9a3007fe27717d Mon Sep 17 00:00:00 2001 From: huyan Date: Sat, 19 Sep 2026 00:53:42 +0800 Subject: [PATCH 2/4] fix(quick-start): keep the first-frame pad readable on the nine-cell grid MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 四向改九宫格后空位从 0 个变成 5 个,原来每个空位画一个虚线框,盘面会碎成一片。空位改为不画边框、不进可访问树。 --- frontend/src/pages/quick-start/index.test.tsx | 7 ++++--- frontend/src/pages/quick-start/index.tsx | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/frontend/src/pages/quick-start/index.test.tsx b/frontend/src/pages/quick-start/index.test.tsx index 6e1b605c..17bf94ea 100644 --- a/frontend/src/pages/quick-start/index.test.tsx +++ b/frontend/src/pages/quick-start/index.test.tsx @@ -2877,8 +2877,9 @@ describe('QuickStartPage', () => { const grid = await screen.findByRole('group', { name: '四向首帧集合' }) expect(within(grid).getAllByRole('img')).toHaveLength(4) - expect(grid.className).toContain('grid-cols-2') - expect(within(grid).queryByLabelText('中心留空')).toBeNull() + // 四向也按方位排在九宫格上:上北下南左西右东,四角与中心空着。 + expect(grid.className).toContain('grid-cols-3') + expect(grid.children).toHaveLength(9) }) it('动作首帧确认完成后仍显示八张独立图片和空中心', async () => { @@ -2922,7 +2923,7 @@ describe('QuickStartPage', () => { const grid = await screen.findByRole('group', { name: '八向首帧集合' }) expect(within(grid).getAllByRole('img')).toHaveLength(8) - expect(within(grid).getByLabelText('中心留空')).toBeTruthy() + expect(grid.children).toHaveLength(9) }) it('keeps the natural-language creation entry visible when no run is selected', () => { diff --git a/frontend/src/pages/quick-start/index.tsx b/frontend/src/pages/quick-start/index.tsx index 6f5afe88..c19a7626 100644 --- a/frontend/src/pages/quick-start/index.tsx +++ b/frontend/src/pages/quick-start/index.tsx @@ -2453,11 +2453,12 @@ function DirectionFirstFrameGrid({ > {layout.cells.map((direction, cellIndex) => { if (!direction) { + // 宫格占位只是盘面的一部分,不进可访问树,也不画成一个个虚线空框。 return (