feat: Add Changelog Viewer to Concept Version List - #31
Conversation
* Add changelog action for source versions when a previous version exists * Fetch and render version-to-version changelog in dialog with markdown support * Improve version handling with safe HEAD detection, loading state, error handling, and fullscreen toggle
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9aa48e227d
ℹ️ 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".
| .then(response => { | ||
| const markdown = get(response, 'data.markdown') || get(response, 'markdown') | ||
|
|
||
| if(markdown) { | ||
| setChangelogMarkdown(markdown) |
There was a problem hiding this comment.
Guard changelog state updates against stale requests
When a user opens a changelog, closes it, and quickly opens another version, the earlier request can resolve after the newer one and still call setChangelogMarkdown/setChangelogError (and later setIsChangelogLoading(false)), so the dialog may display the wrong version’s content or hide the loading spinner while the active request is still pending. This path has no request identity check or cancellation, so late responses can overwrite state for the currently selected version.
Useful? React with 👍 / 👎.
* Extract changelog markdown parsing and rendering into shared ChangelogMarkdown component * Use previous_version_url to resolve version diffs instead of relying on list order * Simplify dialog title by deriving previous version label from URL
* fix(common): prevent stale changelog responses * Add request tracking to ignore late changelog responses after dialog close or newer request start * Ignore local .env files in version control * fix(common): prevent duplicate source changelog links and reset dialog state * Skip changelog generation when normalized previous version URL matches unversioned source URL * Reset loading, markdown, and error state on dialog close to avoid stale UI state
Summary
Adds a Changelog button (newspaper icon) to each source version row in
ConceptContainerVersionList. The button is only displayed for non-HEAD versions that have a previous version available for comparison.Clicking the button opens a Material UI dialog that fetches and renders a markdown changelog between the selected version and its immediate predecessor using the
/sources/$changelog/endpoint with:verbosity=4output=markdownIntroduces a
ChangelogMarkdownrenderer usingReactMarkdown+remark-gfm, including custom handling for:<a id="..."></a>) normalized into proper heading IDs#linksThe dialog supports fullscreen mode and displays a patience/loading message after 10 seconds if the changelog is still processing.
Refactors HEAD version detection into a shared
isHeadVersionhelper for consistency across the application.Adds
CustomMarkdown.scssto provide markdown-specific styling for changelog rendering.