fix: invisible-layer severity blocking→suggestion + slot recommendation (#23)#24
fix: invisible-layer severity blocking→suggestion + slot recommendation (#23)#24
Conversation
…ation (#23) Hidden layers are a normal Figma workflow (version history, A/B options, state layers) and don't block implementation — design-tree already skips them. Changed from blocking/-10 to suggestion/-1. When a frame has 3+ hidden siblings (likely state layers), the message now suggests using Figma's Slot feature for cleaner state management. - severity: blocking → suggestion - score: -10 → -1 - Updated rule definition (why/impact/fix) to reflect actual impact - 7 new tests - 302 total tests passing Closes #23 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
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 docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/core/rules/ai-readability/index.ts`:
- Around line 213-225: Extract the hardcoded threshold "3" into rule-config.ts
and read it here via the existing rule options helper: add an
options.slotRecommendationThreshold entry under the "invisible-layer" rule in
rule-config.ts, then replace the literal 3 in the check that computes
hiddenSiblingCount with a call to getRuleOption/getRuleConfig (or the project's
options helper) to fetch "slotRecommendationThreshold" (provide a sensible
default like 3). Update the conditional that returns the invisibleLayerDef
suggestion to use that fetched threshold so hiddenSiblingCount >=
slotRecommendationThreshold drives the recommendation.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: a5aa6ea9-8031-4d32-a021-00c629e6ee49
📒 Files selected for processing (4)
docs/REFERENCE.mdsrc/core/rules/ai-readability/index.tssrc/core/rules/ai-readability/invisible-layer.test.tssrc/core/rules/rule-config.ts
Move hardcoded hidden sibling threshold (3) to configurable slotRecommendationThreshold in rule-config.ts per review feedback. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
hidden layer 룰의 심각도를 현실에 맞게 조정하고, 상태 레이어가 많을 때 Slot 사용을 추천.
변경 사항
심각도 조정
visible: falseskip → 코드 생성에 영향 없음메시지 개선
Slot 추천 (신규)
3개 이상의 hidden sibling이 있으면 상태 관리 목적일 가능성이 높으므로:
룰 정의 업데이트
Test plan
pnpm test:run— 302 tests passed (7 new)pnpm lint— cleanCloses #23
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Changes
Tests