Skip to content

feat: in-app changelog#309

Merged
robinebers merged 14 commits intorobinebers:mainfrom
hearsilent:feat/changelog
Mar 21, 2026
Merged

feat: in-app changelog#309
robinebers merged 14 commits intorobinebers:mainfrom
hearsilent:feat/changelog

Conversation

@hearsilent
Copy link
Contributor

@hearsilent hearsilent commented Mar 18, 2026

Description

This PR introduces the in-app changelog dialog:

  • Add an in-app ChangelogDialog component that:
    • Fetches releases from the openusage GitHub repository.
    • Matches the current app version against GitHub release tag_name / name (with and without v prefix).
    • Renders release notes with a lightweight markdown renderer that supports:
      • Links ([label](url)), bold/italic text, PR numbers (#123), GitHub usernames (@user), and short commit hashes.
      • Section headers (##, ###), bullet lists, and horizontal rules.
    • Provides shortcuts to open the current release on GitHub and to view the full changelog.
    • Handles loading, error, “no matching release” states, and closes via Escape key.
  • Add a useChangelog hook that fetches releases from the GitHub API and exposes { releases, loading, error } with proper error handling and cleanup on unmount.
  • Add a dedicated Vitest + React Testing Library test suite src/components/changelog-dialog.test.tsx that covers:
    • Loading, error, matching-release, and no-matching-release UI states.
    • Markdown parsing and all link/button click behaviors (release link, full changelog, PR, user, commit, and generic URLs).
    • Navigation callbacks and close interactions (Back button, Close button, Escape key).

Related Issue

Type of Change

  • Bug fix
  • New feature
  • New provider plugin
  • Documentation
  • Performance improvement
  • Other (describe below)

Testing

  • I ran bun run build and it succeeded
  • I ran bun run test and all tests pass (including src/components/changelog-dialog.test.tsx)
  • I tested the change locally with bun tauri dev

Screenshots

image image

Checklist

  • I read CONTRIBUTING.md
  • My PR targets the main branch
  • I did not introduce new dependencies without justification

Summary by cubic

Adds an in-app changelog to view release notes for the current version with quick links and a simple markdown renderer. Fetches only the current GitHub release (with v/non-v fallback) and improves Escape/back behavior in dialogs.

  • New Features

    • ChangelogDialog for robinebers/openusage that loads the current release by tag (tries vX.Y.Z and X.Y.Z).
    • Lightweight markdown: links, bold/italic, headers, lists, rules; auto-links PRs (#123), users (@user), short commits, and plain URLs.
    • Actions: open current release and full changelog; loading, error, and no-match states; About dialog adds “View Changelog” with back navigation.
  • Bug Fixes

    • Escape handling: About listens for Escape only in the About view; in changelog, Escape returns to About; removed header Close to avoid double Escape.
    • Safe rendering and state: handle null fields, use UTC date formatting, and clear stale changelog data on refetch.
    • Hardened link parsing: avoid nested buttons, improve plain URL auto-linking, and preserve ? and () in links.

Written for commit 3510d28. Summary will update on new commits.

- Implement useChangelog hook to fetch GitHub releases
- Create ChangelogDialog with current version filtering
- Add interactive markdown parsing for links, bolds, PRs, and users
Add Vitest/RTL coverage for changelog dialog states and link behaviors.
@augmentcode
Copy link

augmentcode bot commented Mar 18, 2026

🤖 Augment PR Summary

Summary: Adds an in-app changelog experience that surfaces GitHub release notes directly inside the app.

Changes:

  • Updates AboutDialog with a “View Changelog” CTA and view switching into a new dialog.
  • Adds ChangelogDialog overlay that loads GitHub releases, matches the current app version to tag_name/name (with/without v), and renders release notes.
  • Implements a lightweight markdown renderer for links, emphasis, headers, lists, separators, and GitHub-style PR/user/commit references.
  • Introduces useChangelog hook to fetch releases and expose { releases, loading, error } with unmount safety.
  • Adds a comprehensive Vitest + React Testing Library suite validating UI states, markdown/link behaviors, and close/navigation interactions.

Technical Notes: Uses the public GitHub Releases API and @tauri-apps/plugin-opener for opening external links.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 4 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

2 issues found across 4 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/components/changelog-dialog.tsx">

<violation number="1" location="src/components/changelog-dialog.tsx:86">
P1: Recursive parsing of link labels creates nested `<button>` elements when labels contain PR numbers, usernames, or commit hashes (e.g., `[#123](url)` produces a button inside a button). This invalid HTML causes React DOM warnings and unpredictable click behavior.</violation>

<violation number="2" location="src/components/changelog-dialog.tsx:248">
P1: SimpleMarkdown will crash if release.body is null/undefined from GitHub API. Add a nullish fallback when passing content to the component.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@davidarny
Copy link
Collaborator

@codex review

Copy link

@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: 0ffd9c11d0

ℹ️ 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".

Ensure AboutDialog only listens for Escape in the about view, wire ChangelogDialog Escape to go back to About, remove the redundant Close button in the changelog header, and update dialog tests to match the new navigation behavior.
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

3 issues found across 6 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/hooks/use-changelog.ts">

<violation number="1" location="src/hooks/use-changelog.ts:61">
P2: Failed refetches keep old `releases` state, leaving stale changelog data alongside a new error for a different version.</violation>
</file>

<file name="src/components/changelog-dialog.tsx">

<violation number="1" location="src/components/changelog-dialog.tsx:29">
P2: Plain URL auto-linking is incorrect: URL detection runs too late and the regex captures trailing punctuation, causing broken/split clickable links.</violation>
</file>

<file name="src/components/about-dialog.test.tsx">

<violation number="1" location="src/components/about-dialog.test.tsx:48">
P2: The new Escape-navigation test enters the real changelog flow without mocking `useChangelog`/`fetch`, so it can rely on live network behavior and become flaky.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 3 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/components/changelog-dialog.tsx">

<violation number="1" location="src/components/changelog-dialog.tsx:19">
P1: The URL regex pattern incorrectly truncates valid URLs ending with characters like `)` or `?`. The pattern `/(https?:\/\/[^\s<]+[^.,:;?!"'\s<)])/g` requires the final character to NOT be from `.,:;?!"')`, which breaks valid URLs like Wikipedia paths with parentheses or empty query strings. Replace with a pattern that only trims trailing punctuation when it appears to be sentence punctuation, not part of the URL itself.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Copy link
Collaborator

@davidarny davidarny left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Owner

@robinebers robinebers left a comment

Choose a reason for hiding this comment

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

LGTM

@robinebers robinebers merged commit 0bfcaa3 into robinebers:main Mar 21, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants