fix: window.ERAS initialization + dynamic key-person callout#43
Conversation
…rson callout
- window.ERAS was declared empty but never populated — era map charts always blank.
Added initEras() IIFE that reads from PROJECT_DATA on load + data-loaded event.
Supports both {eras:[]} and bare list shapes in commit_eras.
- Era card section: fixed data path to handle both shapes
- Replace hardcoded personal narrative callout with dynamic LEARNING.keyPerson block
(renders only if learning.keyPerson is set in data.json; hidden otherwise)
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughSingle-file template update that adds runtime injection of callout and era data from ChangesDynamic PROJECT_DATA shape handling
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bc377c0a15
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| var kp = ((window.PROJECT_DATA || {}).learning || {}).keyPerson; | ||
| if (!kp) return; |
There was a problem hiding this comment.
Render key-person callout after data load
When data.json is loaded via the asynchronous fetch above, this inline script runs while the HTML is still being parsed and window.PROJECT_DATA is usually unset, so kp is falsy and the script returns permanently. For projects that do provide learning.keyPerson in data.json, the new dynamic callout never appears; this needs to render from a data-loaded handler or shared initialization path.
Useful? React with 👍 / 👎.
Two template fixes:\n\nwindow.ERAS initialization\n\nERAS was declared as empty
[]but never populated from PROJECT_DATA. Every era-dependent chart (era map, era cards, sparklines) was blank becausewindow.ERASwas always empty. AddedinitEras()IIFE that runs on load and ondata-loadedevent, reading fromtelemetry_visualizations.commit_eraswith fallbacks for both list and{eras:[]}shapes.\n\nDynamic key-person callout\n\nReplaced hardcoded HTML narrative callout with a JS block that renders only whenLEARNING.keyPersonis set in the project's data.json. Projects without this key see no callout.Need help on this PR? Tag
@codesmithwith what you need. Autofix is disabled.Summary by CodeRabbit
New Features
Bug Fixes