[feat] solution: 지역 이야기 생성 · 발행본 섹션 손질 · 마이그레이션 주석 축약
- 지역 이야기(가요·인물·연표·엽서·퀴즈) 생성 경로: story_service · grounding/story · section_prompts. 지금까지 만들 자리가 없어 시안에만 손으로 넣은 3만 자였다 - 발행본 섹션: ItinerarySection · Carousel 레일 자동재생(use-rail-autoplay) · Festival · LocalGuide · Weather · Gallery · Header/Footer - 목업 payload 를 payloads-mockup/ 으로 분리 — 발행 대상과 섞이지 않게 - DB 새 구조 후속: site_payload · local_content_crud 조인 정리 · 테스트 - 마이그레이션 주석 축약: 9개 파일 합계 주석 비율 48% → 25%. 실측과 밟은 함정만 남기고 논증은 커밋 메시지로 옮겼다 검증: site·frontend 빌드 통과 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
3910feddfb
commit
328d9e18ee
58 files changed
+5625
-412
No files matched your search
@@ -474,24 +474,37 @@ export const useBuilderStore = create<BuilderState>((set, get) => ({
|
||||
*
|
||||
* ★ 넣기만 하고 빼지 않는다. 템플릿을 눌러 보다가 넣어 둔 섹션이 사라지면
|
||||
* 사장님은 그게 템플릿 때문인 줄 모르고 자기가 지웠다고 생각한다.
|
||||
* ★ `disabledSectionTypes` 는 이 규칙을 어기지 않는다 — **지우지 않고 끈다.**
|
||||
* 목록에 그대로 남아 한 번 눌러 되살린다. 시안(`/s/stay`)의 옛 항구에 예약 안내가
|
||||
* 없는 것처럼, 템플릿이 "이 섹션은 안 쓴다"고 말할 자리가 없어서 켜기만 가능했다.
|
||||
* ★ 잠긴 섹션은 끄지 않는다. 히어로·기본 정보·오시는 길에는 SEO 필수 마크업이 달려 있어
|
||||
* 사장님도 못 끄는 자리다 — 템플릿이 우회로가 되면 안 된다.
|
||||
* ★ 배리에이션은 **비어 있을 때만** 넣는다. 사장님이 이미 고른 모양을 템플릿이 덮으면
|
||||
* 위와 같은 일이 생긴다(고른 적 없는 모양으로 돌아가 있다).
|
||||
*/
|
||||
selectTemplate: (templateId) => {
|
||||
set((state) => {
|
||||
const template = INDUSTRY_CONFIGS[state.industry].templates.find((t) => t.id === templateId);
|
||||
const wanted = template?.defaultSectionTypes ?? [];
|
||||
const turnOff = template?.disabledSectionTypes ?? [];
|
||||
const variants = template?.defaultVariants ?? {};
|
||||
const added = wanted
|
||||
.filter((type) => !state.sections.some((sec) => sec.type === type))
|
||||
.map(newSectionOf)
|
||||
.filter((sec): sec is SectionItem => sec !== undefined);
|
||||
const apply = (sec: SectionItem): SectionItem => {
|
||||
const variantId = sec.variantId ?? variants[sec.type];
|
||||
const isEnabled = wanted.includes(sec.type)
|
||||
? true
|
||||
: turnOff.includes(sec.type) && !sec.isLocked
|
||||
? false
|
||||
: sec.isEnabled;
|
||||
return {...sec, isEnabled, ...(variantId ? {variantId} : {})};
|
||||
};
|
||||
return {
|
||||
templateId,
|
||||
colorPaletteId: null,
|
||||
sections: [
|
||||
...state.sections.map((sec) =>
|
||||
wanted.includes(sec.type) ? {...sec, isEnabled: true} : sec,
|
||||
),
|
||||
...added,
|
||||
],
|
||||
sections: [...state.sections.map(apply), ...added.map(apply)],
|
||||
};
|
||||
});
|
||||
persistTheme();
|
||||
|
||||
Reference in new issue
Block a user