mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-04 11:07:40 +01:00
fix(control): hide Bootstrap-with-AI on cloud where the API always 503s
Onboarding-funnel dead-end. A brand-new cockpitapp.vercel.app user lands
on /control, sees the existing empty state's "Bootstrap new project →"
primary button, types a project idea, clicks Generate — and gets a 503
from /api/project/ai-brief because that route requires
isRuntimeAvailable() (true only on local dev where the claude CLI is
on $PATH). Cloud users have no path forward on the Bootstrap button
ever; the only working option is "Register existing project."
ProjectFleetView didn't know whether the runtime was available, so it
showed Bootstrap unconditionally. Threaded the existing runtimeAvailable
flag from useControlData → ControlPanel → ProjectFleetView and:
• Hide the Bootstrap button entirely when runtimeAvailable is false.
• Promote Register existing project to the primary button (was
secondary alongside Bootstrap) so cloud users get one clear CTA.
• Add a one-line helper underneath: "Bootstrap-with-AI is available
once the local daemon + claude CLI are installed (see the 'Finish
setup' banner above)." — sets expectations without dumping a wall
of text into the empty state.
On local dev (RUNTIME_AVAILABLE=true) the empty state looks unchanged:
Bootstrap stays primary, Register stays secondary, no helper text.
tsc + eslint + build clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2 files changed
+22
-5
No files matched your search
@@ -336,6 +336,7 @@ export function ControlPanel() {
|
||||
cardProps={cardProps}
|
||||
onBootstrap={() => setBootstrapOpen(true)}
|
||||
onNewProject={() => setNewProjectOpen(true)}
|
||||
runtimeAvailable={runtimeAvailable}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -38,6 +38,10 @@ interface ProjectFleetViewProps {
|
||||
onNewProject: () => void;
|
||||
/** Fired after a Stale tile's inline Remove succeeds — caller refreshes the fleet. */
|
||||
onProjectRemoved: () => void;
|
||||
/** True iff the server reports RUNTIME_AVAILABLE=true (local dev). False on
|
||||
* the cloud control plane (cockpitapp.vercel.app), where AI-bootstrap is
|
||||
* unavailable because /api/project/ai-brief requires the local claude CLI. */
|
||||
runtimeAvailable: boolean;
|
||||
}
|
||||
|
||||
export function ProjectFleetView({
|
||||
@@ -62,6 +66,7 @@ export function ProjectFleetView({
|
||||
cardProps,
|
||||
onBootstrap,
|
||||
onNewProject,
|
||||
runtimeAvailable,
|
||||
onProjectRemoved,
|
||||
}: ProjectFleetViewProps) {
|
||||
const collapseTab = (tab: string) =>
|
||||
@@ -95,15 +100,26 @@ export function ProjectFleetView({
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex flex-wrap justify-center gap-3">
|
||||
<button onClick={onBootstrap} className="ui-btn-primary gap-2">
|
||||
<Sparkles className="h-3.5 w-3.5" />
|
||||
Bootstrap new project →
|
||||
</button>
|
||||
<button onClick={onNewProject} className="ui-btn-secondary gap-1.5">
|
||||
{/* Bootstrap calls /api/project/ai-brief which requires the local
|
||||
claude CLI; it always 503s in cloud mode. Hide the button on
|
||||
cockpitapp so new users don't hit a meaningless error — they
|
||||
get the Register flow instead, which works DB-side. */}
|
||||
{runtimeAvailable && (
|
||||
<button onClick={onBootstrap} className="ui-btn-primary gap-2">
|
||||
<Sparkles className="h-3.5 w-3.5" />
|
||||
Bootstrap new project →
|
||||
</button>
|
||||
)}
|
||||
<button onClick={onNewProject} className={runtimeAvailable ? "ui-btn-secondary gap-1.5" : "ui-btn-primary gap-1.5"}>
|
||||
<Plus className="h-3.5 w-3.5" />
|
||||
Register existing project
|
||||
</button>
|
||||
</div>
|
||||
{!runtimeAvailable && (
|
||||
<p className="max-w-sm text-xs leading-relaxed text-text-muted">
|
||||
Bootstrap-with-AI is available once the local daemon + claude CLI are installed (see the “Finish setup” banner above).
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user