Skip to content

fix: window.ERAS initialization + dynamic key-person callout#43

Merged
simongonzalezdc merged 1 commit into
mainfrom
fix/era-initialization-and-dynamic-callout
May 27, 2026
Merged

fix: window.ERAS initialization + dynamic key-person callout#43
simongonzalezdc merged 1 commit into
mainfrom
fix/era-initialization-and-dynamic-callout

Conversation

@simongonzalezdc
Copy link
Copy Markdown
Member

@simongonzalezdc simongonzalezdc commented May 27, 2026

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 because window.ERAS was always empty. Added initEras() IIFE that runs on load and on data-loaded event, reading from telemetry_visualizations.commit_eras with 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 when LEARNING.keyPerson is set in the project's data.json. Projects without this key see no callout.


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag @codesmith with what you need. Autofix is disabled.

Summary by CodeRabbit

New Features

  • Learning Curve section now dynamically renders key person callouts populated from project-specific configuration data, replacing previously static and hardcoded content to provide greater flexibility

Bug Fixes

  • Fixed Development Eras visualization to properly handle and support multiple data format structures, improving reliability and compatibility across diverse project data configurations

Review Change Stack

…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)
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 27, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 3fc1ebb4-4025-40ea-bb14-f73f2b0ee75a

📥 Commits

Reviewing files that changed from the base of the PR and between 93267f5 and bc377c0.

📒 Files selected for processing (1)
  • archaeology/visualization/template.html

📝 Walkthrough

Walkthrough

Single-file template update that adds runtime injection of callout and era data from window.PROJECT_DATA with flexible shape handling, removing hardcoded markup and direct property access patterns in favor of adaptive data extraction.

Changes

Dynamic PROJECT_DATA shape handling

Layer / File(s) Summary
Dynamic key person callout rendering
archaeology/visualization/template.html
Learning Curve chapter callout is now injected at runtime based on window.PROJECT_DATA.learning.keyPerson, replacing static "Jake Van Clief" markup.
Global era initialization from PROJECT_DATA
archaeology/visualization/template.html
window.ERAS is populated at runtime supporting multiple commit_eras data shapes (telemetry_visualizations.commit_eras as array or { eras: [...] }, or fallback to D.commit_eras) with fixed color/hex palette assignment; runs on immediate availability or data-loaded event.
Era card data extraction with shape flexibility
archaeology/visualization/template.html
Era card eraData safely extracts commit_eras supporting multiple shapes (bare array, { eras: [...] }, or D.commit_eras), replacing direct .commit_eras.eras access.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • KyaniteLabs/devarch-framework#41: Both PRs update archaeology/visualization/template.html to replace hardcoded/static era and callout data with runtime population from PROJECT_DATA shapes, so the changes overlap in era initialization and data sourcing patterns.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/era-initialization-and-dynamic-callout

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

@simongonzalezdc simongonzalezdc merged commit 4f5a2b1 into main May 27, 2026
2 of 12 checks passed
@simongonzalezdc simongonzalezdc deleted the fix/era-initialization-and-dynamic-callout branch May 27, 2026 03:20
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +447 to +448
var kp = ((window.PROJECT_DATA || {}).learning || {}).keyPerson;
if (!kp) return;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

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