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

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/desktop/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Instrument+Serif:ital@0;1&display=swap"
/>
<script type="module" crossorigin src="/assets/index-CmJQg31q.js"></script>
<script type="module" crossorigin src="/assets/index-BeymWJKf.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-B5v3W6Qd.css">
</head>
<body>
Expand Down
10 changes: 6 additions & 4 deletions apps/desktop/src/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,17 @@ describe("Stay GUI", () => {
expect(await screen.findByText("Stay with this meeting?")).toBeInTheDocument();
});

it("waits for a complete setup PIN instead of submitting invalid input", async () => {
it("shows only PIN setup before setup and waits for a complete PIN", async () => {
const user = userEvent.setup();
const client = createMockStayClient();
client.focusMeeting();

renderApp(client);

expect(await screen.findByText("Stay with this meeting?")).toBeInTheDocument();
expect(screen.getByRole("button", { name: "Stay" })).toBeDisabled();
expect(await screen.findByLabelText("Set a four digit PIN")).toBeInTheDocument();
expect(screen.getByText("PIN needed")).toBeInTheDocument();
expect(screen.queryByText("Stay with this meeting?")).not.toBeInTheDocument();
expect(screen.queryByRole("button", { name: "Stay" })).not.toBeInTheDocument();

const pinInput = screen.getByLabelText("Set a four digit PIN");
const keepButton = screen.getByRole("button", { name: "Keep" });
Expand All @@ -129,7 +131,7 @@ describe("Stay GUI", () => {

expect(client.commandLog).not.toContain("set_pin");
expect(screen.queryByText("PIN must be exactly four digits")).not.toBeInTheDocument();
expect(screen.getByText("Stay with this meeting?")).toBeInTheDocument();
expect(screen.queryByText("Stay with this meeting?")).not.toBeInTheDocument();
});

it("shows the first-launch intro when enabled and dismisses it", async () => {
Expand Down
15 changes: 9 additions & 6 deletions apps/desktop/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,33 +114,36 @@ export function App({ client, showLaunchIntro: showLaunchIntroOverride }: AppPro

const setupError = actionError?.target === "setup" ? actionError.message : null;
const modeError = actionError?.target === "mode" ? actionError.message : null;
const needsPinSetup = !isLoading && !view.pin_configured;
const canShowModePanels = !isLoading && view.pin_configured;
const shellMode = view.pin_configured ? view.mode : "idle";
const completeLaunchIntro = useCallback(() => {
markLaunchIntroSeen();
setShowLaunchIntro(false);
}, []);

return (
<>
<StatusShell mode={view.mode} status={status}>
<StatusShell mode={shellMode} status={status}>
{isLoading ? (
<section className="mode-panel quiet-state">
<p className="kicker">Opening</p>
<h2>Stay is opening.</h2>
</section>
) : null}

{!isLoading && !view.pin_configured ? (
{needsPinSetup ? (
<PinSetup error={setupError} onSave={(pin) => runCommand(() => client.setPin(pin), "setup")} />
) : null}

{!isLoading && view.mode === "idle" && view.pin_configured ? (
{canShowModePanels && view.mode === "idle" ? (
<section className="mode-panel quiet-state">
<p className="kicker">Ready</p>
<h2>Stay is waiting.</h2>
</section>
) : null}

{!isLoading && view.mode === "meeting_candidate" ? (
{canShowModePanels && view.mode === "meeting_candidate" ? (
<MeetingPrompt
candidate={view.candidate}
canAccept={view.pin_configured}
Expand All @@ -154,7 +157,7 @@ export function App({ client, showLaunchIntro: showLaunchIntroOverride }: AppPro
/>
) : null}

{!isLoading && view.mode === "guarding" ? (
{canShowModePanels && view.mode === "guarding" ? (
<GuardingStatus
meeting={view.meeting}
error={modeError}
Expand All @@ -164,7 +167,7 @@ export function App({ client, showLaunchIntro: showLaunchIntroOverride }: AppPro
/>
) : null}

{!isLoading && view.mode === "locked" ? (
{canShowModePanels && view.mode === "locked" ? (
<LockScreen view={view} error={modeError} onSubmit={(pin) => runCommand(() => client.submitPin(pin))} />
) : null}
</StatusShell>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading