Skip to content

fix(graph): resolve color fallback so SVG nodes don't render black#94

Closed
Jose-Gael-Cruz-Lopez wants to merge 1 commit into
mainfrom
fix/graph-color-fallback
Closed

fix(graph): resolve color fallback so SVG nodes don't render black#94
Jose-Gael-Cruz-Lopez wants to merge 1 commit into
mainfrom
fix/graph-color-fallback

Conversation

@Jose-Gael-Cruz-Lopez
Copy link
Copy Markdown
Member

@Jose-Gael-Cruz-Lopez Jose-Gael-Cruz-Lopez commented May 5, 2026

Summary

  • SVG presentation attributes (fill=) don't resolve CSS custom properties — when the backend doesn't supply a per-course color, the var(--c-sage) fallback was rendering black.
  • Adds a deterministic hex palette + paletteFor(seed) helper in lib/data.ts and wires it into the Dashboard, Tree, and KnowledgeGraph fallback paths.
  • Bumps subject-root node radius from 22 → 28 so course family centers read distinctly from concept nodes.

Test plan

  • npx tsc --noEmit in frontend/ — clean
  • Manual: load Dashboard / Tree with a course that has no course_color and confirm nodes render with a stable hue (not black)
  • Manual: confirm subject-root nodes look noticeably larger than concept nodes
  • Manual: same course id always maps to the same palette entry across screens

Note

A sibling fallback exists in screens/Learn.tsx#apiToGraphNode. It's intentionally left untouched here because PR #93 is in flight on that file. Once both land, a one-liner can switch Learn's fallback to paletteFor(...) for consistency.

🤖 Generated with Claude Code

SVG presentation attributes (fill=) don't resolve CSS custom properties,
so a missing per-course color fell through to var(--c-sage) and rendered
as black. Adds a deterministic hex palette + paletteFor(seed) helper and
wires it into the Dashboard, Tree, and KnowledgeGraph fallbacks. Also
bumps subject-root radius from 22 to 28 so course family centers stand
out from concept nodes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

Warning

Rate limit exceeded

@Jose-Gael-Cruz-Lopez has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 57 minutes and 39 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 043bb35c-b363-4768-a23e-25a719776d3d

📥 Commits

Reviewing files that changed from the base of the PR and between 3fb23d3 and 84bb0e4.

📒 Files selected for processing (4)
  • frontend/src/components/KnowledgeGraph.tsx
  • frontend/src/components/screens/Dashboard.tsx
  • frontend/src/components/screens/Tree.tsx
  • frontend/src/lib/data.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/graph-color-fallback

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 5, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
frontend 84bb0e4 Commit Preview URL

Branch Preview URL
May 05 2026, 10:19 PM

@Jose-Gael-Cruz-Lopez
Copy link
Copy Markdown
Member Author

Folded into #93 — keeping rename feature and graph color fix in a single PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant