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
1 change: 0 additions & 1 deletion frontend/src/components/Sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export default function Sidebar({ sources, isLoading }: SidebarProps) {
</Link>
<div className="flex-1 overflow-auto">
{currentSource.tools
.filter((tool) => tool.name !== 'search_objects')
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is already a WIP notice in the tool detail - let's still present it in the sidebar.

.map((tool) => (
<Link
key={tool.name}
Expand Down
127 changes: 75 additions & 52 deletions frontend/src/components/views/SourceDetailView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,69 +183,92 @@ export default function SourceDetailView() {
</h2>
{source.tools.length > 0 ? (
<div className="space-y-4">
{source.tools.map((tool, index) => (
<div key={tool.name}>
{index > 0 && (
<div className="border-t border-border mb-4"></div>
)}
<div className="bg-muted/30 rounded-lg p-4 space-y-3">
<div>
<div className="flex items-baseline gap-2">
<div className="flex items-center gap-1.5">
<div className="text-sm font-semibold text-foreground font-mono">
{tool.name}
{source.tools.map((tool, index) => {
const boundSourceIdParam = tool.parameters.find((p) => p.name === 'source_id');
const displayParams = tool.parameters.filter((p) => p.name !== 'source_id');
const paramCount = displayParams.length + (boundSourceIdParam ? 1 : 0);
return (
<div key={tool.name}>
{index > 0 && (
<div className="border-t border-border mb-4"></div>
)}
<div className="bg-muted/30 rounded-lg p-4 space-y-3">
<div>
<div className="flex items-baseline gap-2">
<div className="flex items-center gap-1.5">
<div className="text-sm font-semibold text-foreground font-mono">
{tool.name}
</div>
{tool.readonly && (
<Lock className="w-3.5 h-3.5 text-muted-foreground" />
)}
</div>
<div className="text-xs text-muted-foreground">
({paramCount} {paramCount === 1 ? 'parameter' : 'parameters'})
</div>
{tool.readonly && (
<Lock className="w-3.5 h-3.5 text-muted-foreground" />
)}
</div>
<div className="text-xs text-muted-foreground">
({tool.parameters.length} {tool.parameters.length === 1 ? 'parameter' : 'parameters'})
<div className="mt-1.5 text-sm text-muted-foreground leading-relaxed">
{tool.description}
</div>
</div>
<div className="mt-1.5 text-sm text-muted-foreground leading-relaxed">
{tool.description}
</div>
</div>

{tool.parameters.length > 0 && (
<div className="pt-2 border-t border-border/50">
<div className="text-xs font-medium text-muted-foreground uppercase tracking-wide mb-2.5">
Parameters
</div>
<ul className="space-y-3">
{tool.parameters.map((param) => (
<li key={param.name} className="text-sm bg-background/50 rounded p-2.5">
<div className="flex items-baseline gap-2 flex-wrap">
<span className="font-mono text-foreground font-medium">
{param.name}
</span>
<span className="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-primary/10 text-primary">
{param.type}
</span>
{param.required ? (
<span className="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-destructive/10 text-destructive">
required
{(displayParams.length > 0 || boundSourceIdParam) && (
<div className="pt-2 border-t border-border/50">
<div className="text-xs font-medium text-muted-foreground uppercase tracking-wide mb-2.5">
Parameters
</div>
<ul className="space-y-3">
{boundSourceIdParam && (
<li className="text-sm bg-background/50 rounded p-2.5 opacity-60">
<div className="flex items-baseline gap-2 flex-wrap">
<span className="font-mono text-foreground font-medium">
source_id
</span>
<span className="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-primary/10 text-primary">
string
</span>
) : (
<span className="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-muted text-muted-foreground">
optional
bound: {source.id}
</span>
)}
</div>
{param.description && (
</div>
<div className="mt-2 text-xs text-muted-foreground leading-relaxed">
{param.description}
{boundSourceIdParam.description}
</div>
)}
</li>
))}
</ul>
</div>
)}
</li>
)}
{displayParams.map((param) => (
<li key={param.name} className="text-sm bg-background/50 rounded p-2.5">
<div className="flex items-baseline gap-2 flex-wrap">
<span className="font-mono text-foreground font-medium">
{param.name}
</span>
<span className="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-primary/10 text-primary">
{param.type}
</span>
{param.required ? (
<span className="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-destructive/10 text-destructive">
required
</span>
) : (
<span className="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-muted text-muted-foreground">
optional
</span>
)}
</div>
{param.description && (
<div className="mt-2 text-xs text-muted-foreground leading-relaxed">
{param.description}
</div>
)}
</li>
))}
</ul>
</div>
)}
</div>
</div>
</div>
))}
);
})}
</div>
) : (
<div className="text-sm text-muted-foreground">
Expand Down
Loading
Loading