skill(data-viz): lazy init, data-code separation, color contrast, icon semantics, field validation, pre-delivery checklist#434
Conversation
… icon semantics, field validation, pre-delivery checklist Six improvements derived from session learnings — all general, none task-specific: - component-guide: lazy chart initialization pattern for multi-tab dashboards (Chart.js/Recharts/Nivo all render blank in display:none containers) - component-guide: data-code separation for programmatic HTML generation (f-string + JS curly braces cause silent parse failures) - SKILL.md Design Principles: dynamic color safety rule for external/brand colors - SKILL.md Design Principles: icon semantics check - SKILL.md Anti-Patterns: warn against filtering on unvalidated data fields - SKILL.md: pre-delivery checklist (tabs, fields, contrast, icons, tooltips, mobile)
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review.
Tip: disable this comment in your organization's Code Review settings.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughDocumentation updates to the data visualization skill module adding design guidance on color safety and icon semantics, validation best practices, pre-delivery checklist requirements, and implementation patterns for lazy chart initialization and programmatic dashboard generation. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Six general improvements to the
data-vizskill identified from a session review. None are task-specific — all apply to any dashboard build.Changes
component-guide.md— 2 new sectionsMulti-Tab Dashboard — Lazy Chart Initialization
Chart.js, Recharts, and Nivo all read container dimensions at mount time. Charts initialized inside a
display:nonetab container measure0×0and render blank. Documents the lazy-init pattern (make visible first, then init) and library-specific notes for each.Programmatic Dashboard Generation — Data-Code Separation
Embedding JSON data in a Python f-string that also contains JavaScript causes curly-brace collisions and silent JS parse failures. Documents the correct pattern: write data to a separate
data.jsfile, keepapp.jsstatic.SKILL.md— 4 additionsDesign Principles — Dynamic color safety
External/brand colors applied directly as text color on dark backgrounds can be invisible. Rule: use external colors only for non-text elements (borders, dots); always use
var(--text)for labels.Design Principles — Icon semantics
Verify icons match their label's actual meaning. Common traps: 📈 for metrics where lower is better; 🏆 for plain counts.
Anti-Patterns — Unvalidated field filter
Filtering or mapping over a field not confirmed to exist in the data export produces empty arrays or NaN silently. Added to anti-patterns list.
Pre-Delivery Checklist (new section)
7-item checklist: tabs render, fields validated, text contrast, icon semantics, tooltips, empty-state handling, mobile overflow.
Token impact
SKILL.mdcomponent-guide.mdSummary by CodeRabbit