Skip to content
Open
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
60 changes: 32 additions & 28 deletions src/components/pages/PhasesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,13 @@ export default function PhasesPage() {
/>
</div>

{/* Table + Dependency Panel side by side */}
<div className="grid grid-cols-1 xl:grid-cols-2 gap-6">
{/* Phase Table */}
<div className={card.padded}>
<h2 className="text-sm font-semibold text-verde mb-4 flex items-center gap-1">
All Phases
<InfoTooltip content="Click a phase in the graph to manage its dependencies." />
</h2>
<div className="overflow-auto">
{/* Phase Table — full width */}
<div className={card.padded}>
<h2 className="text-sm font-semibold text-verde mb-4 flex items-center gap-1">
All Phases
<InfoTooltip content="Click a phase (here or in the graph) to manage its dependencies." />
</h2>
<div className="overflow-auto">
<table className="w-full text-sm">
<thead>
<tr className="border-b border-areia/20">
Expand Down Expand Up @@ -211,7 +209,7 @@ export default function PhasesPage() {
"border-t border-areia/10 hover:bg-surface-alt/50 transition-colors cursor-pointer",
selectedPhaseId === phase.id && "bg-surface-alt",
)}
onClick={() => setSelectedPhaseId(selectedPhaseId === phase.id ? null : phase.id)}
onClick={() => setSelectedPhaseId(phase.id)}
>
<td className="px-3 py-3 font-medium text-preto">
{phase.name}
Expand Down Expand Up @@ -247,24 +245,6 @@ export default function PhasesPage() {
</tbody>
</table>
</div>
</div>

{/* Dependency Panel */}
<div>
{selectedPhase ? (
<DependencyPanel
selectedPhase={selectedPhase}
phases={phases}
dependencies={allDeps.get(selectedPhaseId!) ?? []}
onAddDependency={handleAddDependency}
onRemoveDependency={handleRemoveDependency}
/>
) : (
<div className={cn(card.padded, "flex items-center justify-center text-sm text-verde/50")} style={{ minHeight: 120 }}>
Select a phase to manage its dependencies
</div>
)}
</div>
</div>
</div>
)}
Expand Down Expand Up @@ -322,6 +302,30 @@ export default function PhasesPage() {
</DialogContent>
</Dialog>

{/* Dependency Management */}
<Dialog
open={selectedPhase !== null}
onOpenChange={(open) => { if (!open) setSelectedPhaseId(null) }}
>
<DialogContent>
<DialogHeader>
<DialogTitle>{selectedPhase?.name}</DialogTitle>
<DialogDescription>
Manage which phases must be completed before this one can start.
</DialogDescription>
</DialogHeader>
{selectedPhase && (
<DependencyPanel
selectedPhase={selectedPhase}
phases={phases}
dependencies={allDeps.get(selectedPhase.id) ?? []}
onAddDependency={handleAddDependency}
onRemoveDependency={handleRemoveDependency}
/>
)}
</DialogContent>
</Dialog>

{/* Delete Confirmation */}
<ConfirmDialog
open={!!deleteTarget}
Expand Down
7 changes: 3 additions & 4 deletions src/components/pages/phases/DependencyPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { X } from "lucide-react"
import type { PhaseResponse } from "@/types"
import { card } from "@/styles"
import { Button } from "@/components/ui/button"
import {
Select,
Expand Down Expand Up @@ -31,9 +30,9 @@ export function DependencyPanel({
)

return (
<div className={card.padded}>
<h4 className="text-sm font-semibold text-preto mb-3">
Dependencies for &ldquo;{selectedPhase.name}&rdquo;
<div>
<h4 className="text-xs font-semibold text-verde/70 uppercase tracking-wide mb-2">
Dependencies
</h4>

{depPhases.length > 0 ? (
Expand Down
Loading