fix: wire up maintenance flow creation, editing, and navigation in frontend

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
chihlasm
2026-02-17 18:47:26 -05:00
parent dbe0e9e5b3
commit c8c5fc84db
4 changed files with 61 additions and 21 deletions

View File

@@ -196,7 +196,9 @@ export function TreeLibraryPage() {
}
const handleStartSession = (treeId: string, treeType?: string) => {
if (treeType === 'procedural') {
if (treeType === 'maintenance') {
navigate(`/flows/${treeId}/maintenance`)
} else if (treeType === 'procedural') {
navigate(`/flows/${treeId}/navigate`)
} else {
navigate(`/trees/${treeId}/navigate`)
@@ -267,14 +269,14 @@ export function TreeLibraryPage() {
</div>
{canCreateTrees && (
<Link
to={typeFilter === 'procedural' ? '/flows/new' : '/trees/new'}
to={typeFilter === 'procedural' ? '/flows/new' : typeFilter === 'maintenance' ? '/flows/new?type=maintenance' : '/trees/new'}
className={cn(
'flex items-center gap-2 rounded-md bg-gradient-brand px-4 py-2 text-sm font-medium text-white shadow-lg shadow-primary/20',
'hover:opacity-90'
)}
>
<Plus className="h-4 w-4" />
{typeFilter === 'procedural' ? 'New Project' : 'Create Flow'}
{typeFilter === 'procedural' ? 'New Project' : typeFilter === 'maintenance' ? 'New Maintenance Flow' : 'Create Flow'}
</Link>
)}
</div>