Skip to content

Core: In app hint to discover v1 beta#1749

Merged
arnestrickmann merged 2 commits intomainfrom
feat/v1-beta-entry-point
Apr 22, 2026
Merged

Core: In app hint to discover v1 beta#1749
arnestrickmann merged 2 commits intomainfrom
feat/v1-beta-entry-point

Conversation

@arnestrickmann
Copy link
Copy Markdown
Contributor

@arnestrickmann arnestrickmann commented Apr 22, 2026

CleanShot 2026-04-22 at 13 42 04@2x

Summary

  • add a v1 beta badge to the app titlebar that routes users to the beta download page
  • reuse the same beta destination in the existing in-app beta entry points
  • extend the shared badge primitive for link rendering and add regression coverage

Validation

  • pnpm run format
  • pnpm run lint (existing warnings only)
  • pnpm run type-check
  • pnpm exec vitest run

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 22, 2026

Greptile Summary

This PR adds a v1 beta badge to the app titlebar and consolidates the beta destination URL across existing in-app entry points (changelog modal and notification card), backed by a new withUtmParams / getEmdashV1BetaUrl utility and the asChild pattern on the shared Badge primitive. All changes are straightforward and well-tested.

Confidence Score: 5/5

Safe to merge; all findings are P2 style suggestions with no correctness or data-integrity concerns.

The implementation is correct — Electron-safe link handling, proper Radix Slot pattern, existing tests updated, and new tests added. The only open items are a cosmetic campaign name and a trivial missing useMemo, both P2.

src/shared/urls.ts — minor campaign name clarification worth considering before the analytics data accumulates.

Important Files Changed

Filename Overview
src/shared/urls.ts Adds EMDASH_DOWNLOAD_URL constant, withUtmParams helper, and getEmdashV1BetaUrl factory; campaign value 'v0-banner-link' is misleading for a v1-beta promotion
src/renderer/components/ui/badge.tsx Extended Badge with asChild/Slot pattern using standard Radix UI approach; clean and correct
src/renderer/components/titlebar/Titlebar.tsx Adds v1 beta badge to titlebar using asChild Badge + anchor with Electron-safe openExternal handler; betaUrl could be memoized
src/renderer/components/ChangelogModal.tsx Swaps static EMDASH_WEBSITE_URL for tracked beta URL via getEmdashV1BetaUrl; straightforward and correct
src/renderer/components/sidebar/ChangelogNotificationCard.tsx Same URL swap as ChangelogModal for the sidebar notification card; no issues
src/renderer/components/ProjectMainView.tsx Project header layout updated to flex-col/sm:flex-row for responsive wrapping; visual-only change
src/test/renderer/Badge.test.tsx New test verifying asChild renders an anchor with correct href and class; adequate coverage
src/test/shared/urls.test.ts Tests UTM param construction and preservation of pre-existing query params; good coverage

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User clicks beta link] --> B{Entry point}
    B --> |Titlebar Badge| C["getEmdashV1BetaUrl('titlebar-badge')"]
    B --> |Changelog Modal| D["getEmdashV1BetaUrl('changelog-modal')"]
    B --> |Notification Card| E["getEmdashV1BetaUrl('changelog-notification-card')"]
    C --> F["withUtmParams(EMDASH_DOWNLOAD_URL, utm)"]
    D --> F
    E --> F
    F --> G["URL with utm_source=emdash-app, utm_medium=in-app, utm_campaign=v0-banner-link, utm_content=entry-point"]
    G --> H["window.electronAPI.openExternal(url)"]
    H --> I[System browser → emdash.sh/download]
Loading
Prompt To Fix All With AI
This is a comment left during a code review.
Path: src/shared/urls.ts
Line: 29

Comment:
**Campaign name mismatch**

The campaign value is `'v0-banner-link'`, but `getEmdashV1BetaUrl` is used in three call sites (titlebar badge, changelog modal, and changelog notification card) — only the titlebar badge could be described as a "banner." More importantly, the campaign name reads as if it belongs to a v0 product while the function explicitly promotes the v1 beta. Analytics dashboards will attribute all three entry points to "v0-banner-link," which could make it harder to reason about the campaign's performance.

```suggestion
    campaign: 'v1-beta-download',
```

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: src/renderer/components/titlebar/Titlebar.tsx
Line: 137

Comment:
**URL constructed on every render**

`getEmdashV1BetaUrl` allocates a `URL` object and calls `searchParams.set` on every render of `Titlebar`. Since the result is a deterministic constant, wrapping it in `useMemo` (or hoisting it outside the component) avoids unnecessary allocations on each render cycle.

```suggestion
  const betaUrl = useMemo(() => getEmdashV1BetaUrl('titlebar-badge'), []);
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "Add a subtle v1 beta entry point" | Re-trigger Greptile

Comment thread src/shared/urls.ts
return withUtmParams(EMDASH_DOWNLOAD_URL, {
source: 'emdash-app',
medium: 'in-app',
campaign: 'v0-banner-link',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Campaign name mismatch

The campaign value is 'v0-banner-link', but getEmdashV1BetaUrl is used in three call sites (titlebar badge, changelog modal, and changelog notification card) — only the titlebar badge could be described as a "banner." More importantly, the campaign name reads as if it belongs to a v0 product while the function explicitly promotes the v1 beta. Analytics dashboards will attribute all three entry points to "v0-banner-link," which could make it harder to reason about the campaign's performance.

Suggested change
campaign: 'v0-banner-link',
campaign: 'v1-beta-download',
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/shared/urls.ts
Line: 29

Comment:
**Campaign name mismatch**

The campaign value is `'v0-banner-link'`, but `getEmdashV1BetaUrl` is used in three call sites (titlebar badge, changelog modal, and changelog notification card) — only the titlebar badge could be described as a "banner." More importantly, the campaign name reads as if it belongs to a v0 product while the function explicitly promotes the v1 beta. Analytics dashboards will attribute all three entry points to "v0-banner-link," which could make it harder to reason about the campaign's performance.

```suggestion
    campaign: 'v1-beta-download',
```

How can I resolve this? If you propose a fix, please make it concise.

const [isHeaderHovered, setIsHeaderHovered] = useState(false);
const feedbackButtonRef = useRef<HTMLButtonElement | null>(null);
const headerRef = useRef<HTMLElement | null>(null);
const betaUrl = getEmdashV1BetaUrl('titlebar-badge');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 URL constructed on every render

getEmdashV1BetaUrl allocates a URL object and calls searchParams.set on every render of Titlebar. Since the result is a deterministic constant, wrapping it in useMemo (or hoisting it outside the component) avoids unnecessary allocations on each render cycle.

Suggested change
const betaUrl = getEmdashV1BetaUrl('titlebar-badge');
const betaUrl = useMemo(() => getEmdashV1BetaUrl('titlebar-badge'), []);
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/renderer/components/titlebar/Titlebar.tsx
Line: 137

Comment:
**URL constructed on every render**

`getEmdashV1BetaUrl` allocates a `URL` object and calls `searchParams.set` on every render of `Titlebar`. Since the result is a deterministic constant, wrapping it in `useMemo` (or hoisting it outside the component) avoids unnecessary allocations on each render cycle.

```suggestion
  const betaUrl = useMemo(() => getEmdashV1BetaUrl('titlebar-badge'), []);
```

How can I resolve this? If you propose a fix, please make it concise.

@arnestrickmann arnestrickmann changed the title Make it easier to try the v1 beta from the app Core: Hint to discover v1 beta from in app Apr 22, 2026
@arnestrickmann arnestrickmann changed the title Core: Hint to discover v1 beta from in app Core: In app hint to discover v1 beta Apr 22, 2026
@arnestrickmann arnestrickmann merged commit 0012f5b into main Apr 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant