Release link and updater toast touchups on Nightly (#6881)

pierremtb/adhoc/clean-up-nightly-on-merge-more
This commit is contained in:
Pierre Jacquier
2025-05-12 16:20:12 -04:00
committed by GitHub
parent 1a8f80a7dc
commit 818d9a0d77
3 changed files with 29 additions and 22 deletions

View File

@ -12,11 +12,11 @@ import { NetworkHealthIndicator } from '@src/components/NetworkHealthIndicator'
import { NetworkMachineIndicator } from '@src/components/NetworkMachineIndicator' import { NetworkMachineIndicator } from '@src/components/NetworkMachineIndicator'
import Tooltip from '@src/components/Tooltip' import Tooltip from '@src/components/Tooltip'
import { useAbsoluteFilePath } from '@src/hooks/useAbsoluteFilePath' import { useAbsoluteFilePath } from '@src/hooks/useAbsoluteFilePath'
import { openExternalBrowserIfDesktop } from '@src/lib/openWindow'
import { PATHS } from '@src/lib/paths' import { PATHS } from '@src/lib/paths'
import { APP_VERSION, getReleaseUrl } from '@src/routes/utils' import { APP_VERSION, getReleaseUrl } from '@src/routes/utils'
import { billingActor } from '@src/lib/singletons' import { billingActor } from '@src/lib/singletons'
import { ActionButton } from '@src/components/ActionButton'
export function LowerRightControls({ export function LowerRightControls({
children, children,
@ -52,15 +52,16 @@ export function LowerRightControls({
<BillingDialog billingActor={billingActor} /> <BillingDialog billingActor={billingActor} />
</Popover.Panel> </Popover.Panel>
</Popover> </Popover>
<a <ActionButton
onClick={openExternalBrowserIfDesktop(getReleaseUrl())} Element="externalLink"
href={getReleaseUrl()} to={getReleaseUrl()}
target="_blank" className={
rel="noopener noreferrer" '!no-underline !border-none font-mono text-xs' +
className={'!no-underline font-mono text-xs ' + linkOverrideClassName} linkOverrideClassName
}
> >
v{APP_VERSION} v{APP_VERSION}
</a> </ActionButton>
<Link <Link
to={ to={
location.pathname.includes(PATHS.FILE) location.pathname.includes(PATHS.FILE)

View File

@ -5,7 +5,7 @@ import toast from 'react-hot-toast'
import { ActionButton } from '@src/components/ActionButton' import { ActionButton } from '@src/components/ActionButton'
import { SafeRenderer } from '@src/lib/markdown' import { SafeRenderer } from '@src/lib/markdown'
import { openExternalBrowserIfDesktop } from '@src/lib/openWindow' import { openExternalBrowserIfDesktop } from '@src/lib/openWindow'
import { getReleaseUrl } from '@src/routes/utils' import { getReleaseUrl, IS_NIGHTLY_OR_DEBUG } from '@src/routes/utils'
export function ToastUpdate({ export function ToastUpdate({
version, version,
@ -41,16 +41,20 @@ export function ToastUpdate({
v{version} v{version}
</span> </span>
<p className="ml-4 text-md text-bold"> <p className="ml-4 text-md text-bold">
A new update has downloaded and will be available next time you A new update is available.
start the app. You can view the release notes{' '} {!IS_NIGHTLY_OR_DEBUG && (
<a <span>
onClick={openExternalBrowserIfDesktop(getReleaseUrl(version))} You can view the release notes{' '}
href={getReleaseUrl(version)} <a
target="_blank" onClick={openExternalBrowserIfDesktop(getReleaseUrl(version))}
rel="noreferrer" href={getReleaseUrl(version)}
> target="_blank"
here on GitHub. rel="noreferrer"
</a> >
here on GitHub.
</a>
</span>
)}
</p> </p>
</div> </div>
{releaseNotes && ( {releaseNotes && (

View File

@ -22,7 +22,9 @@ export const IS_NIGHTLY_OR_DEBUG =
IS_NIGHTLY || APP_VERSION === '0.0.0' || APP_VERSION === '11.22.33' IS_NIGHTLY || APP_VERSION === '0.0.0' || APP_VERSION === '11.22.33'
export function getReleaseUrl(version: string = APP_VERSION) { export function getReleaseUrl(version: string = APP_VERSION) {
return `https://github.com/KittyCAD/modeling-app/releases/tag/${ if (IS_NIGHTLY_OR_DEBUG || version === 'main') {
IS_NIGHTLY ? 'nightly-' : '' return 'https://github.com/KittyCAD/modeling-app/commits/main'
}v${version}` }
return `https://github.com/KittyCAD/modeling-app/releases/tag/v${version}`
} }