- 중앙 도구줄 '상하 | 좌우' 전환(② 도구줄 신설), 분할선 드래그·키보드(←→↑↓, Shift×5, Home/End)·더블클릭 기본값 - 상하: 모델 높이 180–560 px, 좌우: 모델 폭 30–70 %(모델 왼쪽), 모델 접기 시 창 전체 사용 - 중앙 열 900 px 미만·1100 px 이하 화면은 자동 상하 + 안내, 넓어지면 복귀 - 단계별 표시 설정을 localStorage에 저장(기존 pierzainer.review-layout 이관), 프로젝트 파일 미포함 - 오른쪽 창 묶음(.workspace-pane) 도입에 맞춰 기존 검증 스크립트 선택자 갱신 - 단위시험 4개, verify-workspace-layout.cjs Chrome 27개 검사 Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
24 lines
1.5 KiB
TypeScript
24 lines
1.5 KiB
TypeScript
import { describe, it, expect } from 'vitest';
|
|
import { defaultLayout, effectiveMode, parseLayout, SIDE_MIN_WIDTH } from '../src/view/workspace-layout';
|
|
|
|
describe('workspace layout preference', () => {
|
|
it('defaults: stacked, ③ model 240 px, ② keeps its responsive band', () => {
|
|
expect(defaultLayout('rebar')).toEqual({ mode: 'stack', height: 240, width: 50, collapsed: false });
|
|
expect(defaultLayout('plan').height).toBeNull();
|
|
});
|
|
it('migrates the old ③ {height, collapsed} value', () => {
|
|
expect(parseLayout('rebar', { height: 360, collapsed: true })).toEqual({ mode: 'stack', height: 360, width: 50, collapsed: true });
|
|
});
|
|
it('rejects out-of-range or corrupt values', () => {
|
|
expect(parseLayout('rebar', { mode: 'grid', height: 9999, width: 95 })).toEqual({ mode: 'stack', height: 240, width: 70, collapsed: false });
|
|
expect(parseLayout('plan', 'x')).toEqual(defaultLayout('plan'));
|
|
});
|
|
it('side-by-side only on a wide desktop column, otherwise stacked and marked forced', () => {
|
|
const side = { ...defaultLayout('plan'), mode: 'side' as const };
|
|
expect(effectiveMode(side, SIDE_MIN_WIDTH, true)).toEqual({ mode: 'side', forced: false });
|
|
expect(effectiveMode(side, SIDE_MIN_WIDTH - 1, true)).toEqual({ mode: 'stack', forced: true });
|
|
expect(effectiveMode(side, 1400, false)).toEqual({ mode: 'stack', forced: true });
|
|
expect(effectiveMode(defaultLayout('plan'), 400, true)).toEqual({ mode: 'stack', forced: false });
|
|
});
|
|
});
|