Skip to content

chore(ggplot2): follow-up Copilot review fixes after #6944 merge#6947

Merged
MarkusNeusinger merged 1 commit into
mainfrom
chore/ggplot2-followup
May 16, 2026
Merged

chore(ggplot2): follow-up Copilot review fixes after #6944 merge#6947
MarkusNeusinger merged 1 commit into
mainfrom
chore/ggplot2-followup

Conversation

@MarkusNeusinger
Copy link
Copy Markdown
Owner

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 — hardcoded python prompt (#discussion_r3253434308)
The terminal-style chip in the POTD card had a hardcoded python label even though the filename now flips to .R for ggplot2. Output would read python plots/<spec>/ggplot2.R — wrong. Now derives a runner token from potd.language (Rscript for r, python otherwise) alongside the existing ext switch.

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.sub on a triple-quoted docstring pattern and silently left the file unchanged if there was no header. Mirrors the R branch behaviour now: re.match first, prepend the canonical header if absent.

Deliberately not in this PR

  • SHA-pinning r-lib/actions/setup-r and setup-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 — parses
  • CI: ci-lint, ci-tests, frontend tsc + vitest
  • One real impl-review run that exercises the Python prepend fallback (will happen organically the next time a Python impl is reviewed)

https://claude.ai/code/session_01Kb7b7QZi3ohtSTbd39poFV


Generated by Claude Code

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).
Copilot AI review requested due to automatic review settings May 16, 2026 20:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 (Rscript vs python) from potd.language, matching the existing .R/.py extension switch.
  • Plot-generator prompt clarifies that the 4-line module header is mandatory while extra docstrings/roxygen blocks are forbidden (Python + R).
  • impl-review.yml Python header rewrite uses re.match first 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
Copy link
Copy Markdown

codecov Bot commented May 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@MarkusNeusinger MarkusNeusinger merged commit e300005 into main May 16, 2026
13 checks passed
@MarkusNeusinger MarkusNeusinger deleted the chore/ggplot2-followup branch May 16, 2026 20:51
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>
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.

3 participants