Skip to content

Commit c2c8455

Browse files
committed
feat(ui): guided "set up a folder" walkthrough + home entry point
New mapping (create path) is now a 3-step walkthrough; editing an existing mapping still uses the inspector. 1. Folder — required; pick via dialog or a detected workspace. 2. Apps — optional; the install panel writes the per-workspace config (X-Mcpmux-Workspace header) so apps route here. 3. Tools — defaults to the Space's Starter so Finish is one click; the binding is created on Finish. Abandoning before Finish is safe (the folder uses the default Starter until mapped, and any installed config still points at it). A "Set up a folder" card on Home opens the walkthrough via a pendingWorkspaceNew store signal (WorkspacesPage launches it on arrival). Tests: wizard walks the 3 steps and Finish creates the binding with the folder path + chosen Space + default Starter; Back navigation. Updated the three store-mocking suites for the new selectors. Claude-Session: https://claude.ai/code/session_01Baan9JmzR43uxxRUh7CAMF Signed-off-by: Mohammod Al Amin Ashik <maa.ashik00@gmail.com>
1 parent cb33a63 commit c2c8455

10 files changed

Lines changed: 544 additions & 24 deletions

File tree

apps/desktop/src/features/home/HomePage.tsx

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,21 @@
1010
* the page that manages what it counts.
1111
*/
1212
import { useEffect, useState, useCallback } from 'react';
13-
import { Server, Wrench, Monitor, Globe, ArrowUpRight, Compass, ArrowRight } from 'lucide-react';
13+
import {
14+
Server,
15+
Wrench,
16+
Monitor,
17+
Globe,
18+
ArrowUpRight,
19+
Compass,
20+
ArrowRight,
21+
FolderPlus,
22+
} from 'lucide-react';
1423
import type { LucideIcon } from 'lucide-react';
1524
import { PageHeader } from '@mcpmux/ui';
1625
import { ConnectionCard } from '@/components/ConnectionCard';
1726
import { useGatewayEvents, useServerStatusEvents, useDomainEvents } from '@/hooks/useDomainEvents';
18-
import { useViewSpace, useNavigateTo } from '@/stores';
27+
import { useViewSpace, useNavigateTo, useSetPendingWorkspaceNew } from '@/stores';
1928
import type { NavItem } from '@/stores/types';
2029
import { spaceAccentColor } from '@/lib/spaceAccent';
2130

@@ -152,6 +161,39 @@ function GetStartedStrip() {
152161
);
153162
}
154163

164+
/**
165+
* Per-folder setup entry point. The ConnectionCard above connects an app to
166+
* the gateway globally; this routes into the Workspaces walkthrough to map a
167+
* specific project and write its per-folder config.
168+
*/
169+
function SetUpFolderCard() {
170+
const navigateTo = useNavigateTo();
171+
const openWizard = useSetPendingWorkspaceNew();
172+
return (
173+
<button
174+
type="button"
175+
onClick={() => {
176+
openWizard(true);
177+
navigateTo('workspaces');
178+
}}
179+
data-testid="home-setup-folder"
180+
className="group flex w-full items-center gap-3 rounded-xl border border-[rgb(var(--border-subtle))] bg-[rgb(var(--card))] p-4 text-left shadow transition-all duration-200 hover:-translate-y-0.5 hover:border-[rgb(var(--border))] hover:shadow-md"
181+
>
182+
<span className="flex h-9 w-9 flex-shrink-0 items-center justify-center rounded-lg bg-[rgb(var(--primary))]/12 text-[rgb(var(--primary))]">
183+
<FolderPlus className="h-5 w-5" />
184+
</span>
185+
<span className="min-w-0 flex-1">
186+
<span className="block text-sm font-semibold">Set up a folder</span>
187+
<span className="block text-xs text-[rgb(var(--muted))]">
188+
Map a project to its tools and connect your apps to it — even ones that don&apos;t report
189+
the folder.
190+
</span>
191+
</span>
192+
<ArrowRight className="h-4 w-4 flex-shrink-0 text-[rgb(var(--muted))] transition-transform group-hover:translate-x-0.5" />
193+
</button>
194+
);
195+
}
196+
155197
export function HomePage() {
156198
const [stats, setStats] = useState({
157199
installedServers: 0,
@@ -233,6 +275,9 @@ export function HomePage() {
233275
pending-approval nudge. */}
234276
<ConnectionCard />
235277

278+
{/* Per-folder setup — opens the Workspaces walkthrough. */}
279+
<SetUpFolderCard />
280+
236281
{/* Stat tiles — each is a shortcut into the page that manages it. */}
237282
<div
238283
className="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-4"

0 commit comments

Comments
 (0)