fix(potd): include language segment in GitHub source links#5663
Merged
Conversation
Plot-of-the-day links pointed to plots/{spec}/implementations/{lib}.py,
which 404s after the path migration that introduced the per-language
subfolder. Insert {language} before {library} so links resolve to
plots/{spec}/implementations/{language}/{library}.py.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes the Plot of the Day GitHub source links so they match the repository’s language-prefixed implementation layout (plots/{spec}/implementations/{language}/{library}.py). It aligns the homepage POTD components with the codebase’s per-language path migration and prevents the current 404s from broken source links.
Changes:
- Updated the standard POTD card to include
data.languagein the GitHub implementation URL. - Updated the terminal-style POTD card to include
potd.languagein the GitHub implementation URL. - Left the rest of the POTD navigation behavior unchanged.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
app/src/components/PlotOfTheDay.tsx |
Fixes the homepage POTD source-link href to point at the language-scoped implementation path. |
app/src/components/PlotOfTheDayTerminal.tsx |
Fixes the terminal POTD GitHub source URL to use the language-scoped implementation path. |
| <Typography | ||
| component="a" | ||
| href={`${GITHUB_URL}/blob/main/plots/${data.spec_id}/implementations/${data.library_id}.py`} | ||
| href={`${GITHUB_URL}/blob/main/plots/${data.spec_id}/implementations/${data.language}/${data.library_id}.py`} |
| const displayFilename = `plots/${potd.spec_id}/${potd.library_id}.py`; | ||
| const implPath = specPath(potd.spec_id, potd.language, potd.library_id); | ||
| const githubFileUrl = `${GITHUB_URL}/blob/main/plots/${potd.spec_id}/implementations/${potd.library_id}.py`; | ||
| const githubFileUrl = `${GITHUB_URL}/blob/main/plots/${potd.spec_id}/implementations/${potd.language}/${potd.library_id}.py`; |
The previous tests clicked the source/GitHub links to verify analytics but never asserted the rendered href, so a regression to the old language-less path would have gone unnoticed. Pin the URL shape with a regex match in both component tests, and add the missing language field to PlotOfTheDay's mock data.
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
The "plot of the day" component links to the implementation file on GitHub, but the URL was not updated for the per-language path migration. Links currently 404 because they point to
plots/{spec}/implementations/{library}.py(e.g.plots/indicator-rsi/implementations/plotly.py) instead of the correctplots/{spec}/implementations/{language}/{library}.py(e.g.plots/indicator-rsi/implementations/python/plotly.py).This adds the missing
{language}segment in both potd components.Changes
app/src/components/PlotOfTheDay.tsx— insert${data.language}/before the library file in the GitHubhref.app/src/components/PlotOfTheDayTerminal.tsx— same fix forgithubFileUrl.Test plan
/implementations/python/and resolves on GitHub.Generated by Claude Code