Repository navigation
feat: rich document blocks with lossless storage and print output (DEV-118) - #40
Conversation
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
| if (!isKnownBlockType(current.type)) throw new DomainError('invalid_input', '알 수 없는 블록은 읽기 전용입니다'); | ||
| const block = BlockSchema.parse({ | ||
| ...current, | ||
| data: command.data ? {...current.data,...command.data} : current.data ?? (command.blockType==='table'?{table:{rows:[['',''],['','']],header:true}}:command.blockType==='code'?{code:{language:'text',lineNumbers:false}}:undefined), |
There was a problem hiding this comment.
🔴 리치 블록을 편집할 때 가져온 확장 데이터 유실
가져온 표의 셀을 SQLite 모드에서 편집하면, 저장 명령이 표의 확장 속성을 제거합니다. 편집기가 함께 전송한 숨겨진 코드나 그림의 확장 속성도 사라집니다.
Learn more
BlockSchema는 알려진 블록의 data를 검증하되 검증 결과 대신 원본을 유지하므로, 가져온 표의 중첩 확장 속성도 처음에는 남아 있습니다. RichBlockEditor는 셀을 편집할 때 표만이 아니라 블록의 전체 data를 보냅니다. 데몬의 명령 파서는 RichBlockDataSchema를 사용하며, 이 스키마의 중첩 객체들은 정의되지 않은 키를 제거합니다. 코어는 기존 data와 명령의 data를 한 단계만 병합하므로 파싱된 표 객체가 기존 표 객체를 통째로 대체합니다.
Example: data.table에 columnWidths: [120, 240]가 있는 표를 가져옵니다. 셀 내용을 고친 뒤 다시 내보내면 새 셀 값은 있지만 columnWidths가 없습니다.
Recommended fix: 리치 데이터 명령의 중첩 스키마에서도 확장 키를 유지하고, 편집기는 변경한 종류의 데이터만 전송하세요. 알려진 필드의 검증과 그림의 선택적 pinId 제거 동작은 유지하세요. 번들 가져오기부터 실제 데몬 명령과 재내보내기까지 테스트하세요.
Was this helpful? React with 👍 or 👎 to provide feedback.
| ? `<h3>${escapeXml(block.text)}${mark}</h3>` | ||
| : `<p>${multiline(block.text)}${mark}${meta}</p>`; | ||
| const figure=block.type==='figure'?block.data?.figure:undefined; | ||
| const body=figure ? (overlay&&figure.screenId===screen.id ? `<p><ac:image ac:alt="${escapeXml(figure.alt)}"><ri:attachment ri:filename="${escapeXml(overlay.fileName)}" /></ac:image></p><p>${escapeXml(figure.alt)}${figure.pinId?' · '+escapeXml(figure.pinId):''}</p>` : '<p>연결된 화면 캡처 첨부를 사용할 수 없습니다.</p>') : renderRichBlock(block,screen); |
There was a problem hiding this comment.
🔴 Confluence에 발행한 그림에서 본문 누락
그림 블록의 내용란에 설명을 쓰고 Confluence에 발행하면, 그림과 대체 텍스트만 표시되고 설명은 빠집니다. 캡처를 표시할 수 없는 경우에도 설명이 빠집니다.
Learn more
그림 블록 편집기는 대체 텍스트와 별도로 블록의 내용란을 제공합니다. 정적 그림 렌더러는 이미지가 있든 없든 내용란의 텍스트를 그림 캡션에 넣습니다. Confluence의 그림 전용 분기는 첨부 파일을 사용할 수 있으면 대체 텍스트와 핀 ID만 쓰고, 사용할 수 없으면 안내 문구만 쓰므로 두 경우 모두 텍스트를 잃습니다.
Example: 대체 텍스트가 주문 상세 화면이고 내용란이 결제 실패 시 재시도 버튼을 표시한다인 그림을 발행하면, Confluence 페이지에 결제 실패 규칙이 나오지 않습니다.
Recommended fix: 이미지·대체 안내 분기와 캡션 생성을 분리하세요. 두 분기에서 모두 이스케이프한 block.text를 캡션에 포함하고, 첨부가 있을 때는 ac:image 참조를 유지하세요. 발행 테스트에 비어 있지 않은 그림 본문을 추가하세요.
Was this helpful? React with 👍 or 👎 to provide feedback.
| export function bundleVersion(project: Project):1|2|3 { | ||
| if(project.docs.some(doc=>doc.blocks.some(block=>!['paragraph','heading','list','caption'].includes(block.type)||block.data!==undefined))) return 3; | ||
| return (project.screens?.length??0)>1 ? 2 : 1; |
| const blocks: Block[] = doc.blocks.map((block) => ({ | ||
| ...block, | ||
| id: blockIds.get(block.id)!, | ||
| ...(isKnownBlockType(block.type)&&block.data?.figure?{data:{...block.data,figure:{...block.data.figure,screenId:screenIds.get(block.data.figure.screenId)??block.data.figure.screenId,...(block.data.figure.pinId?{pinId:pinIds.get(block.data.figure.pinId)??block.data.figure.pinId}:{})}}}:{}), |
There was a problem hiding this comment.
🔍 알 수 없는 블록의 ID 재매핑 테스트 누락
저장소 테스트는 ID 재매핑이 끝난 뒤 알 수 없는 블록을 추가합니다. 같은 화면 ID를 참조하는 그림 블록과 알 수 없는 블록을 함께 가져와, 그림 블록의 화면 ID만 바뀌는지 확인하면 원본 보존을 검증할 수 있습니다.
Was this helpful? React with 👍 or 👎 to provide feedback.
Ensure proper formatting by adding a newline at the end of the file.
Summary
Validation
Boundaries
Linear: https://linear.app/developjik/issue/DEV-118/spec-studio-리치-블록-표그림코드-블록을-문서에서-편집렌더