fix: design-tree property loss — 4 fixes (#15)#21
Conversation
1. fill.visible=false: skip invisible fills instead of rendering them 2. individualStrokeWeights: output per-side borders (border-bottom etc) instead of always border: 1px solid 3. textDecoration: output text-decoration for UNDERLINE/STRIKETHROUGH 4. IMAGE fill type: output background-image: [IMAGE] marker Also: - Add strokeWeight/individualStrokeWeights to AnalysisNode schema - Add these fields to figma-transformer extraction - Fill opacity now outputs rgba() when < 1 - 7 new tests Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR fixes four Figma property loss issues during design-tree conversion: invisible fill handling, per-side stroke weights, text decoration rendering, and IMAGE fill type support. The schema is extended with stroke properties, and the transformation logic is updated to preserve and correctly process these attributes in CSS output. Changes
Sequence DiagramsequenceDiagram
participant Figma as Figma JSON
participant Adapter as Transformer
participant Engine as Design Tree
participant Output as CSS Output
Figma->>Adapter: strokeWeight, individualStrokeWeights, fill.visible
activate Adapter
Adapter->>Adapter: Copy stroke properties conditionally
Adapter-->>Engine: AnalysisNode with stroke data
deactivate Adapter
Figma->>Engine: fill[], textDecoration
activate Engine
Engine->>Engine: Check fill.visible === false
alt Invisible Fill
Engine->>Engine: Skip fill
else Visible Fill
alt SOLID fill with opacity
Engine->>Engine: Convert to rgba()
else IMAGE fill
Engine->>Engine: Collect background-image
else Standard color
Engine->>Engine: Use hex color
end
end
Engine->>Engine: Check individualStrokeWeights
alt Per-side weights exist
Engine->>Engine: Emit border-top/right/bottom/left
else Uniform weight
Engine->>Engine: Emit border: Npx solid
end
Engine->>Engine: TEXT node + textDecoration?
alt textDecoration present
Engine->>Engine: Emit text-decoration style
end
Engine-->>Output: CSS with fills, borders, decoration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Addresses docstring coverage check (16.67% → 80%+ threshold). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
design-tree 변환 시 Figma JSON 속성이 손실되는 4건 수정.
1. fill.visible=false 무시
visible: false인 fill은 skip2. individualStrokeWeights per-side stroke 손실
border: 1px solidindividualStrokeWeights있으면border-bottom: 1px solid등 per-side 출력strokeWeight값도 반영 (기본 1px)3. textDecoration 속성 누락
UNDERLINE,STRIKETHROUGH출력 (NONE은 skip)text-decoration: underline✅4. IMAGE fill type 누락
background-image: [IMAGE]마커 출력background-image: [IMAGE]✅추가
strokeWeight,individualStrokeWeights를 AnalysisNode 스키마 + transformer에 추가rgba()형식 출력Test plan
pnpm test:run— 277 tests passed (7 new)pnpm lint— cleanCloses #15
🤖 Generated with Claude Code
Summary by CodeRabbit