Skip to content

Add outdated version check to options page and bug report form#9068

Merged
SunsetTechuila merged 8 commits into
mainfrom
copilot/add-version-check-banners
Mar 10, 2026
Merged

Add outdated version check to options page and bug report form#9068
SunsetTechuila merged 8 commits into
mainfrom
copilot/add-version-check-banners

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 10, 2026

Shows a subtle warning when the installed extension version is older than 20 days (50 for Safari, where releases are monthly), prompting users to check for updates before filing bugs or assuming they have the latest features.

  • source/helpers/outdated-version.ts — new shared helper returning version age in days if it exceeds the browser-specific threshold (20d Chrome/Firefox, 50d Safari), undefined otherwise; skips dev builds (0.0.0). Uses month - 1 when constructing the release date because JavaScript's Date constructor takes 0-based months.
  • source/options/version-info.svelte — new <rgh-version> Svelte custom element that renders an <output> showing the current version and, when outdated, an inline "— A newer version may be available" link pointing to the readme's install section
  • source/options.html — replaced the manual <output id="version"> + hidden anchor with <rgh-version> inline
  • source/features/rgh-improve-new-issue-form.tsx — prepends a flash-warn banner to the bug report form when the version is stale, showing exact age in days; selector and style reuse existing patterns from the same file

Test URLs

Screenshot

Original prompt

This section details on the original issue you should resolve

<issue_title>Add version check to options and bug report</issue_title>
<issue_description>See #8670

There's an API to check if new versions are available, but as far as I know it only works if the browser has already downloaded it. I don't know how well it works in Safari.

The check must be browser-specific since the version for Safari is updated about once a month rather than 2/3 times

Pages

  • banner in options
  • banner in bug report page</issue_description>

<agent_instructions>The version of the extension is the release date. Use it as defined in my last comment to display an information banner in the options under the debugging section. Maybe it shouldn't even be a banner, just show a text next to the version pointing to the GitHub's readme section that has the various version badges </agent_instructions>

Comments on the Issue (you are @copilot in this section)

@SunsetTechuila > There's an API to check if new versions are available

runtime.onUpdateAvailable

but as far as I know it only works if the browser has already downloaded it.

Yes

I don't know how well it works in Safari.

It doesn't

But using this API doesn't make much sense:

If the extension is not listening for this event when an update becomes available, the extension is reloaded immediately and the update is applied.

There is another API that is supported only by Chromium: runtime.RequestUpdateCheckStatus, which can be used</comment_new>
<comment_new>@SunsetTechuila
I suggest to create an endpoint that returns the latest available extension version for the user's browser</comment_new>
<comment_new>@SunsetTechuila

There is another API that is supported only by Chromium: runtime.RequestUpdateCheckStatus, which can be used

SunsetTechuila@b8df425</comment_new>
<comment_new>@fregante
We should keep it simple:

  • if version is older than 20 days, display banner to check for updates as a new version may be available

Make it 50 days for Safari.

As you mentioned the native API has very limited applications, for example it fails if chrome just decides to not download updates (I've seen it happen) and by the looks of it it's rather complex.

Also as far as I know the options page has access to all APIs available in the background page, so no messaging should be necessary. </comment_new>


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add version check banners to options and bug report Add outdated version check to options page and bug report form Mar 10, 2026
@fregante
Copy link
Copy Markdown
Member

@copilot make it part of the setVersion() output tag. Actually just create a svelte component and use it inline showing both the current version and that a new version may be available.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 10, 2026

@copilot make it part of the setVersion() output tag. Actually just create a svelte component and use it inline showing both the current version and that a new version may be avail...

Done in 8c4ed82. Created source/options/version-info.svelte as a <rgh-version> custom element that renders an <output> showing the version and, when outdated, an inline "— A newer version may be available" link. The options page now uses <rgh-version> directly, removing the manual JS that was setting the version text and toggling the hidden anchor.

@fregante fregante marked this pull request as ready for review March 10, 2026 14:39
@github-actions github-actions Bot added meta Related to Refined GitHub itself labels Mar 10, 2026
Copy link
Copy Markdown
Member

@fregante fregante left a comment

Choose a reason for hiding this comment

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

It looks ok to me as a first pass. We can review the version fetching in a followup PR as described in the original issue.

Comment thread source/features/rgh-improve-new-issue-form.tsx Outdated
@fregante
Copy link
Copy Markdown
Member

@copilot run Prettier with --write and then add instructions to the repo so that copilot remembers to always run npm run lint before committing.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 10, 2026

@copilot run Prettier with --write and then add instructions to the repo so that copilot remembers to always run npm run lint before committing.

Done in 7247d2b — Prettier reformatted version-info.svelte (the Svelte template HTML layout). Also stored a memory so future sessions always run npm run lint before committing.

@fregante
Copy link
Copy Markdown
Member

@SunsetTechuila thoughts on the style and location? This is the version that will most likely appear in the next release. Using badges.io introduces all sorts of issues that I don't want to deal with in a release for Safari.

Basically I only release to Safari when the extension doesn't have any glaring bugs. This is because it's actually Sindre that takes care of it about once a month and it's a pain to create releases on the App Store.

@SunsetTechuila
Copy link
Copy Markdown
Member

thoughts on the style and location?

Making changes

Comment thread source/helpers/outdated-version.ts Outdated
@fregante
Copy link
Copy Markdown
Member

Code LGTM. Would be good to get a screenshot for future reference. Can be merged.

@SunsetTechuila
Copy link
Copy Markdown
Member

SunsetTechuila commented Mar 10, 2026

image image

(I've edited getExtensionReleaseDate to make these screenshots)

@fregante
Copy link
Copy Markdown
Member

:shipit:

@SunsetTechuila
Copy link
Copy Markdown
Member

Good enough

@SunsetTechuila SunsetTechuila merged commit fb5efcc into main Mar 10, 2026
8 checks passed
@SunsetTechuila SunsetTechuila deleted the copilot/add-version-check-banners branch March 10, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

meta Related to Refined GitHub itself

Development

Successfully merging this pull request may close these issues.

Add version check to options and bug report

3 participants