fix(sirsoft-basic): 모바일 뷰포트 가로 오버플로·압착 해소 및 확장 조각 audit 사각지대 수정

390px 실측 결과 26개 라우트 중 24개에서 문서가 뷰포트를 11px 넘겼고,
320px 에서는 햄버거 버튼이 화면 밖으로 밀려 내비게이션 자체가 불가능했다.
원인은 예외 없이 헤더 우측의 언어(71px)+통화(91px) 선택기였다.

이를 모바일 드로어로 옮기고, 좁은 화면에서는 세로 목록 대신 가로 칩으로
나열하도록 했다. 통화·배송국가는 이커머스 모듈이 슬롯에 주입하는 조각이므로
모듈 쪽에도 responsive.portable 오버라이드를 넣었다. 템플릿의 드로어 자리는
overflow-y-auto 라 옛 absolute 드롭다운이 잘리므로, 템플릿의 이커머스 모듈
의존 하한을 >=1.0.2 로 올렸다.

게시글 상단 네비는 성격이 다른 회귀였다. 게시판 이름이 길수록 flex 형제인
목록·이전글·다음글 버튼이 좁아지는데(87→73→62px), document.scrollWidth 는
내내 뷰포트와 같아 오버플로 검사로는 잡히지 않았다. 넘치는 게 아니라 줄어드는
회귀다. shrink-0 으로 버튼 폭을 고정하고, 모바일에서만 게시판 이름을 자기 줄로
올렸다. 버튼 3개 고정폭 261px + 21자 제목 323px = 584px < 태블릿 콘텐츠 735px
이므로 portable 이 아니라 mobile 스코프로 한정했다.

커밋 전 점검에서 audit 결함 두 건이 드러나 함께 고쳤다.

첫째, layout-* 룰 28개 중 27개가 appliesTo 에 확장 주입 조각 경로를 빠뜨려
조각 32개가 정적 검사에서 통째로 빠져 있었다. 실제 위반 60건이 은닉돼 있었고
그중 45건은 error 다. 다만 glob 만 넓히면 layout-grammar 의 root 화이트리스트가
조각의 정당한 키(target_layout/injections/extension_point/mode/priority)를 전부
오탐해 90건의 error 를 새로 만든다. 조각은 레이아웃이 아니라 별도 스키마이므로
extension-fragment 스키마를 신설해 오탐을 없애는 동시에 조각 고유의 결함(대상 키
누락으로 인한 silent drop, target_layout ↔ extension_point 동시 정의, 무동작 조각)을
새로 검출하게 했다.

둘째, Icon 의 w-N h-N 을 size prop 으로 바꾸라는 규정이 틀렸다. Icon 은 <i> 글리프라
박스 크기가 곧 font-size 인데, size prop 은 Font Awesome fa-* 로 매핑되어 상대값
0.875em + line-height 붕괴를 동반한다. 실측하면 w-4 h-4(16×16)가 fa-sm 에서
12.25×0.88 이 된다. 등가는 text-base 하나뿐이다. 앞선 작업에서 size:"sm" 으로
치환했던 2건을 되돌리고, 규정과 룰 메시지를 실측 등가표로 교체했다.
This commit is contained in:
HeuJung committed 2026-07-10 19:27:25 +09:00
1 parent 0200f1d043
commit e3c00addd8
33 files changed
+1442 -237

No files matched your search

@@ -12,6 +12,51 @@
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
import { Logger } from '../../utils/Logger';
import { hasExplicitSetStateForField } from '../FormContext';
import { responsiveManager } from '../ResponsiveManager';
describe('트러블슈팅 회귀 테스트 - flex 압착(shrink)', () => {
/**
* 사례: 텍스트가 길어질수록 형제 버튼이 좁아지는데 오버플로 검사로는 안 잡힘
*
* 해결책이 `responsive.mobile`(0~767) 로 좁힌 2행 레이아웃에 의존한다.
* `portable`(0~1023) 이면 태블릿에서 불필요하게 줄바꿈된다.
* 여기서는 그 전제인 스코프 경계와 우선순위를 고정한다.
*
* @see docs/frontend/troubleshooting-components-misc.md "flex 압착(shrink) 관련 이슈"
*/
describe('[사례 1] responsive 스코프 경계 — mobile(0~767) vs portable(0~1023)', () => {
it('mobile 은 767px 까지만 매칭되고 768px 부터는 미적용', () => {
const responsive = { mobile: { props: { className: 'flex-wrap' } } };
expect(responsiveManager.getMatchingKey(responsive, 320)).toBe('mobile');
expect(responsiveManager.getMatchingKey(responsive, 390)).toBe('mobile');
expect(responsiveManager.getMatchingKey(responsive, 767)).toBe('mobile');
// 768px 부터 태블릿 — 한 줄 유지 (버튼 261px + 21자 제목 323px = 584px < 735px)
expect(responsiveManager.getMatchingKey(responsive, 768)).toBeNull();
expect(responsiveManager.getMatchingKey(responsive, 1280)).toBeNull();
});
it('portable 은 1023px 까지 매칭되어 태블릿도 포함한다', () => {
const responsive = { portable: { props: { className: 'flex-wrap' } } };
expect(responsiveManager.getMatchingKey(responsive, 767)).toBe('portable');
expect(responsiveManager.getMatchingKey(responsive, 768)).toBe('portable');
expect(responsiveManager.getMatchingKey(responsive, 1023)).toBe('portable');
expect(responsiveManager.getMatchingKey(responsive, 1024)).toBeNull();
});
it('mobile 과 portable 이 함께 정의되면 좁은 범위(mobile)가 우선한다', () => {
const responsive = {
portable: { props: { className: 'portable-wins' } },
mobile: { props: { className: 'mobile-wins' } },
};
expect(responsiveManager.getMatchingKey(responsive, 390)).toBe('mobile');
// 태블릿 구간에서는 mobile 이 매칭되지 않으므로 portable 로 폴백
expect(responsiveManager.getMatchingKey(responsive, 900)).toBe('portable');
});
});
});
describe('트러블슈팅 회귀 테스트 - DataGrid 컴포넌트', () => {
beforeEach(() => {