Skip to content

Commit 6da348a

Browse files
authored
Merge pull request #176 from ShipSecAI/@krishna9358/ux-fixes
fixed the position of design and execution tab, changed validation dock to be collapsible.
2 parents 166e289 + d448cf8 commit 6da348a

5 files changed

Lines changed: 47 additions & 18 deletions

File tree

frontend/src/components/layout/AppLayout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ export function AppLayout({ children }: AppLayoutProps) {
151151
<SidebarContext.Provider value={sidebarContextValue}>
152152
<ThemeTransition />
153153
<div className="flex h-screen bg-background">
154-
{/* Sidebar */}
154+
{/* Sidebar - z-[100] ensures it's above all other elements including workflow buttons */}
155155
<Sidebar
156-
className={`fixed md:relative z-40 h-full transition-all duration-300 ${sidebarOpen ? 'w-64' : 'w-0 md:w-16'
156+
className={`fixed md:relative z-[100] h-full transition-all duration-300 ${sidebarOpen ? 'w-64' : 'w-0 md:w-16'
157157
}`}
158158
onMouseEnter={handleMouseEnter}
159159
onMouseLeave={handleMouseLeave}

frontend/src/components/layout/TopBar.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,11 @@ export function TopBar({
165165
}, [metadata.name])
166166

167167
const modeToggle = (
168-
<div className="flex rounded-lg border bg-muted/40 overflow-hidden text-xs font-medium shadow-sm">
168+
<div className="flex rounded-lg border bg-muted/40 overflow-hidden text-xs font-medium shadow-sm flex-shrink-0">
169169
<Button
170170
variant={mode === 'design' ? 'default' : 'ghost'}
171171
size="sm"
172-
className="h-9 px-3 gap-2 rounded-none"
172+
className="h-9 w-[110px] px-3 gap-2 rounded-none justify-center"
173173
onClick={() => {
174174
if (!canEdit || !workflowId) return
175175
// Navigate to design URL - this triggers mode update via useLayoutEffect
@@ -178,7 +178,7 @@ export function TopBar({
178178
disabled={!canEdit}
179179
aria-pressed={mode === 'design'}
180180
>
181-
<PencilLine className="h-4 w-4" />
181+
<PencilLine className="h-4 w-4 flex-shrink-0" />
182182
<span className="flex flex-col leading-tight text-left">
183183
<span className="text-xs font-semibold hidden md:inline">Design</span>
184184
<span
@@ -194,7 +194,7 @@ export function TopBar({
194194
<Button
195195
variant={mode === 'execution' ? 'default' : 'ghost'}
196196
size="sm"
197-
className="h-9 px-3 gap-2 rounded-none border-l border-border/50"
197+
className="h-9 w-[130px] px-3 gap-2 rounded-none border-l border-border/50 justify-center"
198198
onClick={() => {
199199
if (!workflowId) return
200200
// Navigate to execution URL - this triggers mode update via useLayoutEffect
@@ -206,7 +206,7 @@ export function TopBar({
206206
}}
207207
aria-pressed={mode === 'execution'}
208208
>
209-
<MonitorPlay className="h-4 w-4" />
209+
<MonitorPlay className="h-4 w-4 flex-shrink-0" />
210210
<span className="flex flex-col leading-tight text-left">
211211
<span className="text-xs font-semibold hidden md:inline">Execution</span>
212212
<span

frontend/src/components/workflow/ValidationDock.tsx

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { useMemo } from 'react'
2-
import { AlertCircle, CheckCircle2 } from 'lucide-react'
1+
import { useMemo, useState } from 'react'
2+
import { AlertCircle, CheckCircle2, ChevronDown, ChevronUp } from 'lucide-react'
33
import { cn } from '@/lib/utils'
44
import { useComponentStore } from '@/store/componentStore'
55
import { getNodeValidationWarnings } from '@/utils/connectionValidation'
@@ -19,13 +19,16 @@ interface ValidationDockProps {
1919
onNodeClick: (nodeId: string) => void
2020
}
2121

22+
const COLLAPSE_THRESHOLD = 3 // Collapse when more than 3 issues
23+
2224
export function ValidationDock({
2325
nodes,
2426
edges,
2527
mode,
2628
onNodeClick,
2729
}: ValidationDockProps) {
2830
const { getComponent } = useComponentStore()
31+
const [isExpanded, setIsExpanded] = useState(false)
2932

3033
// Only show validation in design mode
3134
const isDesignMode = mode === 'design'
@@ -60,6 +63,7 @@ export function ValidationDock({
6063

6164
const totalIssues = validationIssues.length
6265
const hasIssues = totalIssues > 0
66+
const shouldCollapse = totalIssues > COLLAPSE_THRESHOLD
6367

6468
// Don't show dock if not in design mode
6569
if (!isDesignMode) {
@@ -82,13 +86,38 @@ export function ValidationDock({
8286
>
8387
{hasIssues ? (
8488
<>
85-
<div className="flex items-center gap-2 px-2.5 py-1.5 border-b border-border/50">
86-
<AlertCircle className="h-3 w-3 text-red-500 shrink-0" />
87-
<span className="text-[11px] font-medium">
88-
{totalIssues} {totalIssues === 1 ? 'issue' : 'issues'}
89-
</span>
90-
</div>
91-
<div className="divide-y divide-border/50">
89+
<button
90+
type="button"
91+
onClick={() => shouldCollapse && setIsExpanded(!isExpanded)}
92+
className={cn(
93+
'w-full flex items-center justify-between gap-2 px-2.5 py-1.5 border-b border-border/50',
94+
shouldCollapse && 'cursor-pointer hover:bg-muted/50 transition-colors'
95+
)}
96+
>
97+
<div className="flex items-center gap-2">
98+
<AlertCircle className="h-3 w-3 text-red-500 shrink-0" />
99+
<span className="text-[11px] font-medium">
100+
{totalIssues} {totalIssues === 1 ? 'issue' : 'issues'}
101+
</span>
102+
</div>
103+
{shouldCollapse && (
104+
<div className="flex items-center gap-1 text-muted-foreground">
105+
<span className="text-[10px]">{isExpanded ? 'Collapse' : 'Expand'}</span>
106+
{isExpanded ? (
107+
<ChevronDown className="h-3 w-3" />
108+
) : (
109+
<ChevronUp className="h-3 w-3" />
110+
)}
111+
</div>
112+
)}
113+
</button>
114+
<div
115+
className={cn(
116+
'divide-y divide-border/50 overflow-hidden transition-all duration-200',
117+
shouldCollapse && !isExpanded && 'max-h-0',
118+
(!shouldCollapse || isExpanded) && 'max-h-[300px] overflow-y-auto'
119+
)}
120+
>
92121
{validationIssues.map((issue, index) => (
93122
<button
94123
key={`${issue.nodeId}-${index}`}

frontend/src/components/workflow/WorkflowBuilderShell.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export function WorkflowBuilderShell({
115115
type="button"
116116
variant="secondary"
117117
onClick={onToggleLibrary}
118-
className="absolute z-[60] top-[10px] left-[10px] h-8 px-3 py-1.5 flex items-center gap-2 rounded-md border bg-background text-xs font-medium transition-all duration-200 hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary"
118+
className="absolute z-50 top-[10px] left-[10px] h-8 px-3 py-1.5 flex items-center gap-2 rounded-md border bg-background text-xs font-medium transition-all duration-200 hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary"
119119
aria-expanded={false}
120120
aria-label="Show component library"
121121
title="Show components"

worker/tsconfig.tsbuildinfo

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)