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

@@ -4,6 +4,12 @@
형식은 [Keep a Changelog](https://keepachangelog.com/ko/1.1.0/)를 따르며,
[Semantic Versioning](https://semver.org/lang/ko/)을 준수합니다.
## [1.0.2] - 2026-07-09
### Changed
- 휴대폰·태블릿 화면에서 통화·배송국가 선택이 드롭다운 대신 항상 펼쳐진 가로 버튼으로 표시됩니다. 좁은 화면의 메뉴 안에서 드롭다운이 잘려 보이던 문제가 함께 해소됩니다. 데스크톱 화면의 드롭다운은 그대로입니다.
## [1.0.1] - 2026-07-08
### Added
@@ -2,7 +2,7 @@
"name": "modules/sirsoft-ecommerce",
"description": "Ecommerce module for Gnuboard7",
"type": "library",
"version": "1.0.1",
"version": "1.0.2",
"license": "MIT",
"autoload": {
"psr-4": {
@@ -5,7 +5,7 @@
"ko": "이커머스",
"en": "Ecommerce"
},
"version": "1.0.1",
"version": "1.0.2",
"license": "MIT",
"description": {
"ko": "그누보드7 이커머스 모듈 - 상품, 주문, 결제 관리",
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "@g7/sirsoft-ecommerce",
"version": "1.0.1",
"version": "1.0.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@g7/sirsoft-ecommerce",
"version": "1.0.1",
"version": "1.0.2",
"devDependencies": {
"jsdom": "^27.4.0",
"typescript": "^5.3.3",
@@ -1,6 +1,6 @@
{
"name": "@g7/sirsoft-ecommerce",
"version": "1.0.1",
"version": "1.0.2",
"description": "그누보드7 이커머스 모듈 프론트엔드 에셋",
"private": true,
"type": "module",
@@ -63,9 +63,9 @@
"props": { "className": "text-xs text-gray-500 dark:text-gray-400" },
"text": "{{_global.preferredShippingCountry ?? _global.modules?.['sirsoft-ecommerce']?.shipping?.default_country ?? 'KR'}}"
},
{ "type": "basic", "name": "Icon", "props": { "name": "coins", "className": "w-4 h-4" } },
{ "type": "basic", "name": "Icon", "props": { "name": "coins", "className": "text-base" } },
{ "type": "basic", "name": "Span", "props": { "className": "font-medium" }, "text": "{{_global.preferredCurrency ?? _global.modules?.['sirsoft-ecommerce']?.language_currency?.default_currency ?? 'KRW'}}" },
{ "type": "basic", "name": "Icon", "props": { "name": "chevron-down", "className": "w-3 h-3" } }
{ "type": "basic", "name": "Icon", "props": { "name": "chevron-down", "className": "text-xs" } }
],
"actions": [
{
@@ -119,7 +119,7 @@
"type": "basic",
"name": "Icon",
"if": "{{_global.preferredCurrency === currency.code}}",
"props": { "name": "check", "className": "w-4 h-4" }
"props": { "name": "check", "className": "text-base" }
}
],
"actions": [
@@ -174,7 +174,7 @@
"type": "basic",
"name": "Icon",
"if": "{{(_global.preferredShippingCountry ?? 'KR') === shipCountry.code}}",
"props": { "name": "check", "className": "w-4 h-4" }
"props": { "name": "check", "className": "text-base" }
}
],
"actions": [
@@ -12,8 +12,15 @@
"name": "Div",
"slot": "header_currency",
"props": { "className": "relative {{(_global.availableCurrencies ?? []).length > 0 || ((_global.availableShippingCountries ?? []).length > 1 && _global.modules?.['sirsoft-ecommerce']?.shipping?.international_shipping_enabled === true) ? '' : 'hidden'}}" },
"responsive": {
"portable": {
"comment": "portable 에서는 이 조각이 사용자 템플릿 모바일 드로어(세로 블록) 안에 렌더된다. 펼친 목록이 컨테이너 폭을 채우도록 w-full. hidden 게이트 표현식은 그대로 유지(props 얕은 머지가 아니라 className 통째 교체이므로 표현식을 복제해야 함).",
"props": { "className": "relative w-full {{(_global.availableCurrencies ?? []).length > 0 || ((_global.availableShippingCountries ?? []).length > 1 && _global.modules?.['sirsoft-ecommerce']?.shipping?.international_shipping_enabled === true) ? '' : 'hidden'}}" }
}
},
"children": [
{
"comment": "트리거 버튼 — 데스크톱 전용. 모바일/태블릿(portable)에서는 이 조각이 드로어(overflow-y-auto) 안에 렌더되어 absolute 드롭다운이 잘리므로, 트리거를 숨기고 패널을 항상 펼친다.",
"type": "basic",
"name": "Button",
"props": {
@@ -22,6 +29,11 @@
"aria-expanded": "{{_local.showCurrencyDropdown ?? false}}",
"aria-label": "$t:sirsoft-ecommerce.common.currency_label"
},
"responsive": {
"portable": {
"props": { "className": "hidden" }
}
},
"children": [
{
"comment": "트리거 라벨: 해외배송 활성이면 선택 배송국가 코드 병기 (관리자 헤더와 동일하게 코드 텍스트로 표기 — flag-icons 의존 제거).",
@@ -31,9 +43,9 @@
"props": { "className": "text-xs text-gray-500 dark:text-gray-400" },
"text": "{{_global.preferredShippingCountry ?? _global.modules?.['sirsoft-ecommerce']?.shipping?.default_country ?? 'KR'}}"
},
{ "type": "basic", "name": "Icon", "props": { "name": "coins", "className": "w-4 h-4" } },
{ "type": "basic", "name": "Icon", "props": { "name": "coins", "className": "text-base" } },
{ "type": "basic", "name": "Span", "props": { "className": "font-medium" }, "text": "{{_global.preferredCurrency ?? _global.defaultCurrency ?? 'KRW'}}" },
{ "type": "basic", "name": "Icon", "props": { "name": "chevron-down", "className": "w-3 h-3" } }
{ "type": "basic", "name": "Icon", "props": { "name": "chevron-down", "className": "text-xs" } }
],
"actions": [
{
@@ -44,7 +56,7 @@
]
},
{
"comment": "드롭다운 메뉴 (통화 + 배송국가 2섹션)",
"comment": "드롭다운 메뉴 (통화 + 배송국가 2섹션). portable(0~1023px) 에서는 트리거 없이 항상 펼쳐진 정적 목록 — 드로어 스크롤 경계에서 absolute 패널이 잘리는 문제 회피.",
"type": "basic",
"name": "Div",
"if": "{{_local.showCurrencyDropdown}}",
@@ -52,6 +64,15 @@
"className": "absolute right-0 top-full mt-2 w-52 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50 py-1 overflow-hidden",
"role": "listbox"
},
"responsive": {
"portable": {
"if": "{{true}}",
"props": {
"className": "static w-full mt-2 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg py-1",
"role": "listbox"
}
}
},
"children": [
{
"comment": "── 통화 섹션 ──",
@@ -63,8 +84,19 @@
"type": "basic",
"name": "Div",
"props": { "className": "px-4 py-1.5 text-xs font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wide" },
"responsive": { "portable": { "props": { "className": "px-3 py-1 text-xs font-medium text-gray-500 dark:text-gray-400 uppercase" } } },
"text": "$t:sirsoft-ecommerce.common.currency_label"
},
{
"comment": "옵션 래퍼. portable 에서만 가로 칩 나열(flex-wrap). 데스크톱은 무클래스 블록이라 기존 세로 목록 그대로. iteration 은 아래 Div 자신에 걸려 있어 항목 수만큼 복제되므로, 복제본들이 이 래퍼의 flex item 이 된다.",
"type": "basic",
"name": "Div",
"responsive": {
"portable": {
"props": { "className": "flex flex-wrap gap-2 px-3 pb-2" }
}
},
"children": [
{
"type": "basic",
"name": "Div",
@@ -78,22 +110,34 @@
"role": "option",
"aria-selected": "{{_global.preferredCurrency === currency.code}}"
},
"responsive": {
"portable": {
"props": {
"className": "inline-flex items-center gap-1.5 px-3 py-1.5 text-sm border rounded-full cursor-pointer whitespace-nowrap transition-colors {{_global.preferredCurrency === currency.code ? 'bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 border-blue-200 dark:border-blue-800' : 'text-gray-700 dark:text-gray-300 border-gray-200 dark:border-gray-600 hover:bg-gray-100 dark:hover:bg-gray-700'}}",
"role": "option",
"aria-selected": "{{_global.preferredCurrency === currency.code}}"
}
}
},
"children": [
{ "type": "basic", "name": "Span", "props": { "className": "text-base" }, "text": "{{currency.flag}}" },
{
"type": "basic",
"name": "Span",
"props": { "className": "flex-1" },
"responsive": { "portable": { "props": { "className": "" } } },
"children": [
{ "type": "basic", "name": "Span", "props": { "className": "font-medium" }, "text": "{{currency.code}}" },
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-500 dark:text-gray-400 ml-1" }, "text": "({{currency.symbol}})" }
]
},
{
"comment": "portable(칩 나열)에서는 선택 상태가 배경/테두리 색으로 이미 표현되고 aria-selected 로도 전달되므로, 칩 폭을 아끼려 체크 아이콘을 숨긴다.",
"type": "basic",
"name": "Icon",
"if": "{{_global.preferredCurrency === currency.code}}",
"props": { "name": "check", "className": "w-4 h-4" }
"responsive": { "portable": { "if": "{{false}}" } },
"props": { "name": "check", "className": "text-base" }
}
],
"actions": [
@@ -128,6 +172,8 @@
}
]
}
]
}
]
},
{
@@ -147,8 +193,19 @@
"type": "basic",
"name": "Div",
"props": { "className": "px-4 py-1.5 text-xs font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wide" },
"responsive": { "portable": { "props": { "className": "px-3 py-1 text-xs font-medium text-gray-500 dark:text-gray-400 uppercase" } } },
"text": "$t:sirsoft-ecommerce.common.shipping_country_label"
},
{
"comment": "옵션 래퍼. portable 에서만 가로 칩 나열(flex-wrap). 데스크톱은 무클래스 블록.",
"type": "basic",
"name": "Div",
"responsive": {
"portable": {
"props": { "className": "flex flex-wrap gap-2 px-3 pb-2" }
}
},
"children": [
{
"type": "basic",
"name": "Div",
@@ -162,13 +219,30 @@
"role": "option",
"aria-selected": "{{(_global.preferredShippingCountry ?? 'KR') === shipCountry.code}}"
},
"responsive": {
"portable": {
"props": {
"className": "inline-flex items-center gap-1.5 px-3 py-1.5 text-sm border rounded-full cursor-pointer whitespace-nowrap transition-colors {{(_global.preferredShippingCountry ?? 'KR') === shipCountry.code ? 'bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 border-blue-200 dark:border-blue-800' : 'text-gray-700 dark:text-gray-300 border-gray-200 dark:border-gray-600 hover:bg-gray-100 dark:hover:bg-gray-700'}}",
"role": "option",
"aria-selected": "{{(_global.preferredShippingCountry ?? 'KR') === shipCountry.code}}"
}
}
},
"children": [
{ "type": "basic", "name": "Span", "props": { "className": "flex-1 font-medium" }, "text": "{{shipCountry.name}}" },
{
"type": "basic",
"name": "Span",
"props": { "className": "flex-1 font-medium" },
"responsive": { "portable": { "props": { "className": "font-medium" } } },
"text": "{{shipCountry.name}}"
},
{
"comment": "portable(칩 나열)에서는 선택 상태를 배경/테두리 색 + aria-selected 로 전달하므로 체크 아이콘을 숨긴다.",
"type": "basic",
"name": "Icon",
"if": "{{(_global.preferredShippingCountry ?? 'KR') === shipCountry.code}}",
"props": { "name": "check", "className": "w-4 h-4" }
"responsive": { "portable": { "if": "{{false}}" } },
"props": { "name": "check", "className": "text-base" }
}
],
"actions": [
@@ -217,6 +291,8 @@
}
]
}
]
}
]
}
]
@@ -116,6 +116,112 @@ describe('header-currency-selector-user.json — 헤더 공용 셀렉터 2섹션
expect(raw).toContain('g7_preferred_shipping_country');
});
/**
* 사용자 템플릿(sirsoft-basic)은 390px 뷰포트 오버플로(+11px) 해소를 위해 이 슬롯을
* 헤더 우측 그룹에서 모바일 드로어(overflow-y-auto + w-80)로 옮겼다. 드로어에서는
* absolute 드롭다운 패널이 스크롤 경계에서 잘리므로, 주입 노드 자체가 responsive.portable
* (0~1023px) 오버라이드로 "트리거 숨김 + 패널 항상 펼침(static)" 을 선언한다.
*
* SlotContainer 는 주입 자식에게 variant/context prop 을 전달하지 않으므로 컨테이너별로
* 다르게 그릴 방법이 이것뿐이다. 데스크톱(≥1024px)은 기존 드롭다운을 그대로 유지한다.
*/
it('트리거 버튼은 portable(0~1023px)에서 숨겨진다 (모바일 드로어 = 펼친 목록)', () => {
const trigger = walk(root, (n) => n.name === 'Button' && Array.isArray(n.actions) &&
n.actions.some((a: any) => a.handler === 'setState' && a.params?.showCurrencyDropdown !== undefined));
expect(trigger).toBeTruthy();
expect(trigger.responsive?.portable?.props?.className).toBe('hidden');
});
it('패널은 portable 에서 if 해제 + static 흐름 (데스크톱 absolute/z-50 은 보존)', () => {
const panel = (root.children ?? []).find(
(n: any) => n.name === 'Div' && n.props?.role === 'listbox'
);
expect(panel).toBeTruthy();
// 데스크톱 기본 경로 — 회귀 방지
expect(panel.if).toBe('{{_local.showCurrencyDropdown}}');
expect(panel.props.className).toContain('absolute');
expect(panel.props.className).toContain('z-50');
// portable 오버라이드 — 엔진은 override.if 로 base if 를 완전 교체한다
const portable = panel.responsive?.portable;
expect(portable).toBeTruthy();
expect(portable.if).toBe('{{true}}');
expect(portable.props.className).toContain('static');
expect(portable.props.className).not.toContain('absolute');
expect(portable.props.className).not.toContain('z-50');
// 접근성 role 은 props 얕은 머지에서 유실되지 않도록 오버라이드에도 명시
expect(portable.props.role).toBe('listbox');
});
/**
* 모바일(portable)에서는 통화·배송국가를 세로 목록이 아니라 가로 나열 칩으로 그린다.
* 세로 목록은 좁은 드로어에서 세로 공간을 과하게 먹는다.
*
* 엔진의 `iteration` 은 그 속성을 가진 노드 자신을 항목 수만큼 복제한다. 따라서 옵션들을
* 한 줄에 흘리려면 iteration 노드의 **부모**가 flex 컨테이너여야 한다 → 래퍼 Div 를 두고
* 그 래퍼에만 responsive.portable 로 `flex flex-wrap` 을 준다(데스크톱은 무클래스 블록).
*/
const findSection = (labelKey: string) => {
const panel = (root.children ?? []).find((c: any) => c.props?.role === 'listbox');
return (panel.children ?? []).find(
(c: any) => JSON.stringify(c).includes(labelKey) && Array.isArray(c.children)
);
};
for (const [name, labelKey] of [
['통화', 'common.currency_label'],
['배송국가', 'common.shipping_country_label'],
] as const) {
it(`${name} 섹션: iteration 노드의 부모 래퍼가 portable 에서 flex-wrap 이다 (가로 칩 나열)`, () => {
const section = findSection(labelKey);
expect(section).toBeTruthy();
// [0] = 라벨, [1] = 옵션 래퍼
const wrapper = section.children[1];
expect(wrapper.name).toBe('Div');
// 데스크톱은 무클래스(블록 흐름) — 기존 세로 목록 유지
expect(wrapper.props?.className).toBeUndefined();
const portableCls = wrapper.responsive?.portable?.props?.className ?? '';
expect(portableCls).toContain('flex');
expect(portableCls).toContain('flex-wrap');
// iteration 은 래퍼가 아니라 그 자식에 있어야 한다 (래퍼가 복제되면 칩이 세로로 쌓임)
expect(wrapper.iteration).toBeUndefined();
expect(wrapper.children[0].iteration).toBeTruthy();
});
it(`${name} 섹션: 옵션 버튼이 portable 에서 칩(rounded-full) 이고 데스크톱은 w-full 행이다`, () => {
const section = findSection(labelKey);
const iterNode = section.children[1].children[0];
const button = iterNode.children[0];
expect(button.name).toBe('Button');
// 데스크톱 기본 — 전체폭 행
expect(button.props.className).toContain('w-full');
expect(button.props.className).not.toContain('rounded-full');
// portable — 가로 칩
const chip = button.responsive?.portable?.props?.className ?? '';
expect(chip).toContain('inline-flex');
expect(chip).toContain('rounded-full');
expect(chip).toContain('whitespace-nowrap');
expect(chip).not.toContain('w-full');
// 접근성 속성은 props 얕은 머지에서 유실되지 않도록 오버라이드에도 유지
expect(button.responsive.portable.props.role).toBe('option');
expect(button.responsive.portable.props['aria-selected']).toBeTruthy();
});
it(`${name} 섹션: 선택 체크 아이콘은 portable 에서 숨긴다 (칩 폭 절약, 선택은 색+aria-selected 로 전달)`, () => {
const section = findSection(labelKey);
const button = section.children[1].children[0].children[0];
const check = (button.children ?? []).find((c: any) => c.props?.name === 'check');
expect(check).toBeTruthy();
expect(check.responsive?.portable?.if).toBe('{{false}}');
});
}
it('트리거 라벨 = 배송국가 코드 텍스트 (관리자 헤더와 동일, flag-icons 비의존)', () => {
// 트리거(통화 버튼) 안의 첫 Span 이 배송국가 코드를 텍스트로 표시해야 한다.
const trigger = walk(root, (n) => n.name === 'Button' && Array.isArray(n.actions) &&