chore(ggplot2): follow-up Copilot review fixes after #6944 merge#6947
Merged
Conversation
Three Copilot review comments on PR #6944 that arrived after the merge: 1. PlotOfTheDayTerminal (#discussion_r3253434308) The terminal-style chip in the POTD card had a hardcoded "python" prompt even though the filename already flipped to .R for ggplot2. Result would read "python plots/<spec>/ggplot2.R" which is wrong. Now derives a `runner` token from `potd.language` (Rscript for r, python otherwise) alongside the existing ext switch. 2. prompts/plot-generator.md (#discussion_r3253434312) The "Forbidden (Python)" list said "Type hints or docstrings (keep it simple)" while the same prompt elsewhere requires a 4-line module-header docstring at the top of every Python impl. Contradictory guidance can make generators omit the required header. Clarified: header docstring is mandatory, additional docstrings (function/class level) are forbidden. Added the R equivalent of the rule for roxygen #' blocks. 3. .github/workflows/impl-review.yml (#discussion_r3253434319) The Python branch of the header-rewrite step ran re.sub on a triple- quoted docstring pattern but had no fallback if the impl file lacked a header — silently leaving the file without anyplot metadata. Mirrors the R branch behaviour: re.match first, prepend if no header is present. Out of scope for this follow-up (still tracked): - SHA-pinning r-lib/actions/setup-r and setup-renv (would need a verified upstream SHA; let Dependabot pin them on its next run, consistent with how the rest of the repo's action refs landed).
Contributor
There was a problem hiding this comment.
Pull request overview
Small follow-up to PR #6944 (R/ggplot2 support) addressing three Copilot review comments: fix a hardcoded python label in the POTD terminal chip, clarify contradictory docstring guidance in the plot-generator prompt, and add a prepend fallback to the Python header-rewrite step in impl-review.
Changes:
- POTD terminal now derives
runner(Rscriptvspython) frompotd.language, matching the existing.R/.pyextension switch. - Plot-generator prompt clarifies that the 4-line module header is mandatory while extra docstrings/roxygen blocks are forbidden (Python + R).
impl-review.ymlPython header rewrite usesre.matchfirst and prepends the canonical header if absent, mirroring the R branch.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| app/src/components/PlotOfTheDayTerminal.tsx | Derive runner from language; replace hardcoded python chip text. |
| prompts/plot-generator.md | Resolve contradiction: mandatory header docstring, no extra docstrings/roxygen. |
| .github/workflows/impl-review.yml | Add prepend fallback when Python impl has no leading triple-quoted docstring. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This was referenced May 22, 2026
MarkusNeusinger
added a commit
that referenced
this pull request
May 22, 2026
) Closes #7612. Adds **Julia** as anyplot's third language with **Makie.jl** (CairoMakie backend) as its first library entry. Generalizes the multi-language plumbing introduced for R/ggplot2 in #6944 + follow-ups (#6947, #6961, #7066) so every `python | r` dispatch now handles `python | r | julia` uniformly. ## Phase ordering — heads-up This ships **Phase 5 (Julia) before Phases 1+2 (JavaScript family)**, which the issue called out explicitly. The multi-language pipeline is already proven on R; shipping Julia next provides a cheap second non-Python validation that surfaces multi-language gaps the JS work would otherwise hit cold. The JavaScript phases remain planned in unchanged order. See `docs/concepts/library-expansion.md` §9. ## Why Makie over Plots.jl Distinct scientific stack (not a wrapper), ~45 % share within Julia, MIT-licensed. CairoMakie is the right backend for CI — pure-Cairo, headless, no GPU / GLFW window. `PlotlyJS.jl` is a plotly.js wrapper (already covered via Python Plotly). Plots.jl is the alternative; revisit only if Plausible data flips. `GLMakie` / `WGLMakie` interactive backends are out of scope; `INTERACTIVE_LIBRARIES` intentionally excludes Makie. ## What's in the PR ### Constants + registry - `core/constants.py`: add `julia` language, `makie` library - `tests/unit/core/test_constants.py`: assert `julia` + `makie` ### CI runtime - `.github/actions/setup-julia/action.yml`: install Julia 1.11, restore from `Project.toml` / `Manifest.toml`, smoke-test a CairoMakie render - `Project.toml`: pin CairoMakie + Makie + dataset packages (CSV, Colors, ColorSchemes, DataFrames, PalmerPenguins, RDatasets, Random, Statistics) **`Manifest.toml` is intentionally not committed** — it gets resolved by the first CI run; the action falls back to `Pkg.add(...)` when `Manifest.toml` is absent so first-run doesn't hard-fail. (Same model as `renv.lock` had pre-bump on the R rollout.) ### Workflows Each workflow derives `LANGUAGE` + `EXT` from `LIBRARY` via a case statement. Every case now has `matplotlib→python`, `ggplot2→r`, `makie→julia`: - `impl-generate.yml`, `impl-repair.yml`, `impl-review.yml`, `impl-merge.yml`: add the `makie→julia` arm; install `setup-julia` when `language==julia`; detect Julia version via `julia -e 'print(VERSION)'`; detect Makie version via `Pkg.dependencies()` - `impl-review.yml`: - extend canvas-gate library-cause map with a Makie entry (`Figure(resolution=(1600,900)) + px_per_unit=2` → 3200×1800; `resolution=(1200,1200)` → 2400×2400) - extend header-rewrite step to handle `#`-prefixed Julia comment blocks, with prepend fallback when missing (same fix as #6947 did for Python / R) - `bulk-generate.yml`: add `makie` to `library` choices and `ALL_LIBRARIES` - `impl-merge.yml`: completion total now derives from the actual library list rather than hardcoding 9 ### Prompts - **`prompts/library/makie.md`** (new): no-workarounds policy, NOT_FEASIBLE for primary-interactivity specs, canvas hard rule, `ANYPLOT_THEME` mapping, forbidden patterns (no `Plots.jl`, no `display(fig)`, no `GLMakie`/`WGLMakie`), `# `-comment header style - `plot-generator.md`: extend lead, available environment, forbidden patterns with Julia/Makie section - `quality-evaluator.md`, `workflow-prompts/ai-quality-review.md`: extend the AR-08 static-libraries list with `makie`; extend the language allow-list with `julia` - `workflow-prompts/impl-generate-claude.md`, `impl-repair-claude.md`: add the `julia | .jl | julia --project=.` row to the (language, ext, runner) table; add Julia run + format sections - `workflow-prompts/impl-similarity-claude.md`: third arm for `julia` in the `{language}` mapping ### Frontend (avoids the two-follow-up-PR pattern from #6961 / #7066) - `app/src/constants/index.ts`: add `makie` to `LIBRARIES`, `LIB_ABBREV: 'mk'`, `LIB_TO_LANG: 'julia'`, `LANG_DISPLAY: 'Julia'`, `LANG_EXT: 'jl'` - `app/src/components/CodeHighlighter.tsx`: register `julia` Prism grammar - `app/src/types/react-syntax-highlighter.d.ts`: declare the `prism/julia` module locally — **TS7016 fix in same PR, not deferred** (the issue specifically called this out as a gap not to repeat) - `app/src/components/LibraryCard.tsx`: description for makie - `app/src/components/PlotOfTheDay.tsx`, `PlotOfTheDayTerminal.tsx`: `julia --project=.` runner token + `.jl` extension when language is julia - `app/src/pages/LibrariesPage.tsx`, `AboutPage.tsx`, `PlotsPage.tsx`: meta-description copy bumped to "Eleven libraries across Python, R, and Julia" - `app/src/pages/DebugPage.tsx`: `makie` column in `SpecStatus` interface (the grid template uses `LIBRARIES.length` so the matrix grows automatically) ### Backend - `api/routers/debug.py`: `SpecStatusItem` and `library_names` entries for makie - `api/routers/specs.py`: doc comment updated to note `makie is Julia` ### Tests - `app/src/components/CodeHighlighter.test.tsx`: julia-grammar case - `app/src/hooks/useCodeFetch.test.ts`: julia `?language=` case + three-language cache-key test - `app/src/pages/DebugPage.test.tsx`: `makie` field on fixture ### Docs - `docs/concepts/library-expansion.md`: §1 current-state table grows to 11 entries; §8 Phase 5 marked **shipped**; §9 records the phase-skip rationale, Makie-over-Plots.jl decision, and CairoMakie-only scope - `docs/reference/repository.md`: `implementations/` layout shows `python/` + `r/` + `julia/` siblings - `docs/concepts/vision.md`, `docs/reference/style-guide.md`: pipeline-story copy ("eleven libraries in three languages") - `docs/reference/plausible.md`: language slug list now includes `julia` - `prompts/README.md`, `agentic/docs/project-guide.md`: Makie added ## Verified - ✅ `core/constants.py` loads: `len(SUPPORTED_LIBRARIES)=11`, `SUPPORTED_LANGUAGES={'python','r','julia'}` - ✅ `pytest tests/unit/core tests/unit/api/test_routers.py tests/unit/api/test_debug.py tests/unit/api/test_schemas.py` — **213 passed**, no regressions - ✅ `Project.toml` valid TOML, deps load - Frontend tests are wired but I couldn't run `yarn test` in this environment (no node_modules). Code follows the existing patterns from the R rollout. ## Post-merge follow-ups (called out in the issue) 1. Run `uv run python -m automation.scripts.label_manager sync` once so `library:makie`, `generate:makie`, `impl:makie:{pending,done,failed}` labels appear. 2. First CI run of `setup-julia` will resolve `Manifest.toml` — commit that lockfile in a tiny follow-up so subsequent runs use `Pkg.instantiate()` instead of the `Pkg.add` fallback. 3. Trigger `bulk-generate.yml -f library=makie` to fill the catalog (separate from this infra PR — the issue called this out as "Out of scope" / handled by the regular flow). 4. Optional `julia.anyplot.ai` marketing subdomain (mentioned in the issue's "Out of scope" section; small follow-up modeled on `python.anyplot.ai`). --- _Generated by [Claude Code](https://claude.ai/code/session_01AzjPDEE5aY2LYR5tcK3faj)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three Copilot review comments arrived on #6944 just before/after it was merged. Picking up the actionable ones in a small follow-up.
What's fixed
1.
PlotOfTheDayTerminal— hardcodedpythonprompt (#discussion_r3253434308)The terminal-style chip in the POTD card had a hardcoded
pythonlabel even though the filename now flips to.Rfor ggplot2. Output would readpython plots/<spec>/ggplot2.R— wrong. Now derives arunnertoken frompotd.language(Rscriptforr,pythonotherwise) alongside the existingextswitch.2.
prompts/plot-generator.md— contradictory docstring rule (#discussion_r3253434312)The "Forbidden (Python)" list said "Type hints or docstrings (keep it simple)" while the same prompt elsewhere requires a 4-line module-header docstring at the top of every Python impl. Contradictory guidance can make generators omit the required header. Clarified: header docstring is mandatory, additional docstrings are forbidden. Added the R equivalent for roxygen
#'blocks so the rule symmetric.3.
impl-review.yml— Python header rewrite needs a prepend fallback (#discussion_r3253434319)The Python branch of the header-rewrite step ran
re.subon a triple-quoted docstring pattern and silently left the file unchanged if there was no header. Mirrors the R branch behaviour now:re.matchfirst, prepend the canonical header if absent.Deliberately not in this PR
r-lib/actions/setup-randsetup-renv(#discussion_r3253434287, #discussion_r3253434297). Pinning is correct policy, but pushing a SHA I haven't verified would re-introduce the bogus-SHA blocker that feat(ggplot2): add R/ggplot2 library + multi-language pipeline #6944 already had to fix. Dependabot will pin them to a verified SHA on its next run, the same way every other action ref in the repo got there.Test plan
python3 -c "import yaml; ..."on impl-review.yml — parseshttps://claude.ai/code/session_01Kb7b7QZi3ohtSTbd39poFV
Generated by Claude Code