Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 7 additions & 14 deletions src/view/onboarding/BuiltinAnnouncementStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,11 @@ import { InlineLink } from '../../components/InlineLink';
const PROVIDER_ID_BUILTIN = 'builtin';

/**
* Destination for the "Learn more" link. Points at the product site today;
* repoint to the v0.15 built-in-engine blog post once it is published.
* The v0.15 built-in-engine launch blog post. Shared by both links: the
* subtitle "v0.15" anchor and the footer "Learn more" link.
*/
const LEARN_MORE_URL = 'https://www.thuki.app';

/**
* GitHub release page for the version that introduced the built-in engine.
* Linked from the subtitle; the tag is not cut yet, so the page 404s until the
* v0.15.0 release is published.
*/
const RELEASE_TAG_URL =
'https://github.com/quiet-node/thuki/releases/tag/v0.15.0';
const BLOG_POST_URL =
'https://www.thuki.app/blog/thuki-built-in-local-ai-engine';

/** Hugging Face home, opened from the "Total AI model freedom" point. */
const HUGGING_FACE_URL = 'https://huggingface.co';
Expand Down Expand Up @@ -174,8 +167,8 @@ export function BuiltinAnnouncementStep() {
>
Since{' '}
<InlineLink
url={RELEASE_TAG_URL}
ariaLabel="View the v0.15 release on GitHub"
url={BLOG_POST_URL}
ariaLabel="Read about the v0.15 built-in engine"
style={{ fontWeight: 600 }}
>
v0.15
Expand Down Expand Up @@ -286,7 +279,7 @@ export function BuiltinAnnouncementStep() {
>
Added in v0.15 &middot;{' '}
<InlineLink
url={LEARN_MORE_URL}
url={BLOG_POST_URL}
ariaLabel="Learn more about the built-in engine"
>
Learn more ↗
Expand Down
18 changes: 11 additions & 7 deletions src/view/onboarding/__tests__/BuiltinAnnouncementStep.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,30 @@ describe('BuiltinAnnouncementStep', () => {
invoke.mockResolvedValue(undefined);
});

it('renders the version pill, title and subtitle with the release link', () => {
it('renders the version pill, title and subtitle with the blog link', () => {
render(<BuiltinAnnouncementStep />);
expect(screen.getByText('NEW')).toBeInTheDocument();
expect(screen.getByText('Local AI, now built in')).toBeInTheDocument();
// The subtitle text is split by the embedded "v0.15" release link.
// The subtitle text is split by the embedded "v0.15" blog link.
expect(
screen.getByText(/ships its own inference engine/),
).toBeInTheDocument();
expect(
screen.getByRole('button', { name: 'View the v0.15 release on GitHub' }),
screen.getByRole('button', {
name: 'Read about the v0.15 built-in engine',
}),
).toBeInTheDocument();
});

it('opens the v0.15 release on GitHub from the subtitle link', () => {
it('opens the blog post from the subtitle v0.15 link', () => {
render(<BuiltinAnnouncementStep />);
fireEvent.click(
screen.getByRole('button', { name: 'View the v0.15 release on GitHub' }),
screen.getByRole('button', {
name: 'Read about the v0.15 built-in engine',
}),
);
expect(invoke).toHaveBeenCalledWith('open_url', {
url: 'https://github.com/quiet-node/thuki/releases/tag/v0.15.0',
url: 'https://www.thuki.app/blog/thuki-built-in-local-ai-engine',
});
});

Expand Down Expand Up @@ -137,7 +141,7 @@ describe('BuiltinAnnouncementStep', () => {
);

expect(invoke).toHaveBeenCalledWith('open_url', {
url: 'https://www.thuki.app',
url: 'https://www.thuki.app/blog/thuki-built-in-local-ai-engine',
});
});

Expand Down
Loading