Skip to content

Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.

feat(desktop): go back to the sign-in choice from Computer access

leepokaic3e31ab92a4e
diff --git a/apps/desktop/e2e/optional-sign-in.spec.ts b/apps/desktop/e2e/optional-sign-in.spec.ts
index 8deb6e98..2be54b7e 100644
--- a/apps/desktop/e2e/optional-sign-in.spec.ts
+++ b/apps/desktop/e2e/optional-sign-in.spec.ts
@@ -64,6 +64,13 @@ test('the welcome lets you go on without an account, and it stays that way', asy
test.skip(!(await goOn.isVisible({ timeout: 5_000 }).catch(() => false)), 'Needs the app signed out in a build with accounts.')
await goOn.click()
await expect(goOn).toHaveCount(0)
+ // Computer access goes back to the way of signing in.
+ await setPref(page, 'computerAccessSetup', null)
+ await page.getByRole('button', { name: 'Back' }).click()
+ await expect(goOn).toBeVisible()
+ await goOn.click()
+ await expect(goOn).toHaveCount(0)
+ await setPref(page, 'computerAccessSetup', 'later')
await page.reload()
await expect(page.locator('#root')).not.toBeEmpty()
await expect(goOn).toHaveCount(0)
diff --git a/apps/desktop/src/renderer/views/AccountWelcomeView.tsx b/apps/desktop/src/renderer/views/AccountWelcomeView.tsx
index 8bb6ce57..098796b9 100644
--- a/apps/desktop/src/renderer/views/AccountWelcomeView.tsx
+++ b/apps/desktop/src/renderer/views/AccountWelcomeView.tsx
@@ -16,7 +16,7 @@ import './account-welcome.css'
const deviceName = window.codync.platform === 'darwin' ? 'Mac' : 'computer'
-/** Whether the welcome covers the window (`showsWelcome`). `finish`: the first run's choice was made. */
+/** Whether the welcome covers the window (`showsWelcome`). `finish`: the first run's choice was made. `back`: make it again, while signed out. */
export function useWelcomeGate() {
const [onboarded, setOnboarded] = usePref(prefs.onboardingDone)
const [withoutAccount, setWithoutAccount] = usePref(prefs.withoutAccount)
@@ -34,7 +34,8 @@ export function useWelcomeGate() {
useEffect(() => {
if (isSignedIn && withoutAccount) setWithoutAccount(false)
}, [isSignedIn, withoutAccount, setWithoutAccount])
- return { shown: showsWelcome({ onboarded, configured: isConfigured, ready: isReady, signedIn: isSignedIn, withoutAccount }), finish }
+ const back = isConfigured && !isSignedIn ? () => setWithoutAccount(false) : undefined
+ return { shown: showsWelcome({ onboarded, configured: isConfigured, ready: isReady, signedIn: isSignedIn, withoutAccount }), finish, back }
}
/** The welcome: signing in, or going on without an account. A restored session skips it as soon as it is back. */
diff --git a/apps/desktop/src/renderer/views/ChatWindow.tsx b/apps/desktop/src/renderer/views/ChatWindow.tsx
index 53c4367f..5c8a94f9 100644
--- a/apps/desktop/src/renderer/views/ChatWindow.tsx
+++ b/apps/desktop/src/renderer/views/ChatWindow.tsx
@@ -129,7 +129,7 @@ export function ChatWindow() {
<RefreshIndicator />
{!welcome.shown ? (
accessSetup === null ? (
- <AccessOnboarding onContinue={(ready) => finishAccess(ready, true)} />
+ <AccessOnboarding onContinue={(ready) => finishAccess(ready, true)} onBack={welcome.back} />
) : showsChat ? (
<ChatSplitView />
) : (
diff --git a/apps/desktop/src/renderer/views/computer-access/AccessOnboarding.tsx b/apps/desktop/src/renderer/views/computer-access/AccessOnboarding.tsx
index 331587f2..58d231ff 100644
--- a/apps/desktop/src/renderer/views/computer-access/AccessOnboarding.tsx
+++ b/apps/desktop/src/renderer/views/computer-access/AccessOnboarding.tsx
@@ -12,7 +12,8 @@ import { useComputerAccess } from './use-computer-access'
import appIcon from '../../../../resources/icon.png'
import './access-onboarding.css'
-export function AccessOnboarding({ onContinue }: { onContinue: (ready: boolean) => void }) {
+/** `onBack`: back to the way of signing in, from the first page. */
+export function AccessOnboarding({ onContinue, onBack }: { onContinue: (ready: boolean) => void; onBack?: () => void }) {
const access = useComputerAccess()
const tr = useTr()
const star = useStarAsk()
@@ -26,6 +27,7 @@ export function AccessOnboarding({ onContinue }: { onContinue: (ready: boolean)
star.answer(false)
onContinue(ready)
}
+ const back = index > 0 ? () => setSelection(pages[index - 1]!.id) : onBack
return <section className="computer-access access-onboarding" aria-label={tr('Computer access setup')}>
<div className="access-onboarding-content">
@@ -60,6 +62,7 @@ export function AccessOnboarding({ onContinue }: { onContinue: (ready: boolean)
<footer className="access-onboarding-footer">
<Text size="caption" tone="secondary" tabular>{index + 1} / {pages.length}</Text>
<div className="access-onboarding-navigation">
+ {back ? <IconButton title="Back" icon="chevron.left" onClick={back} /> : null}
{selection !== 'star' ? <IconButton title="Check again" icon="arrow.clockwise" onClick={() => void access.refresh()} /> : null}
<Button kind="secondary" onClick={() => selection === 'star' ? finish() : setSelection(pages[index + 1]!.id)}>
{tr(selection === 'star' ? 'Get started' : accessPageReady(selection, access.step, access.screen) ? 'Continue' : 'Set up later')}<Icon name="arrow.right" size={12} />