mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-18 11:40:39 +09:00
fix(ui): skip paused dimming on Paused filter tab
On the Paused tab every visible agent is paused, so applying opacity-50 to all of them is redundant and makes the whole view dim. Skip the dimming when tab === "paused" in both list and org chart views. Pass tab prop through to OrgTreeNode for consistency.
This commit is contained in:
parent
acb2bc6b3b
commit
f749efd412
1 changed files with 5 additions and 3 deletions
|
|
@ -291,7 +291,7 @@ export function Agents() {
|
||||||
{effectiveView === "org" && filteredOrg.length > 0 && (
|
{effectiveView === "org" && filteredOrg.length > 0 && (
|
||||||
<div className="border border-border py-1">
|
<div className="border border-border py-1">
|
||||||
{filteredOrg.map((node) => (
|
{filteredOrg.map((node) => (
|
||||||
<OrgTreeNode key={node.id} node={node} depth={0} agentMap={agentMap} liveRunByAgent={liveRunByAgent} />
|
<OrgTreeNode key={node.id} node={node} depth={0} agentMap={agentMap} liveRunByAgent={liveRunByAgent} tab={tab} />
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
@ -316,11 +316,13 @@ function OrgTreeNode({
|
||||||
depth,
|
depth,
|
||||||
agentMap,
|
agentMap,
|
||||||
liveRunByAgent,
|
liveRunByAgent,
|
||||||
|
tab,
|
||||||
}: {
|
}: {
|
||||||
node: OrgNode;
|
node: OrgNode;
|
||||||
depth: number;
|
depth: number;
|
||||||
agentMap: Map<string, Agent>;
|
agentMap: Map<string, Agent>;
|
||||||
liveRunByAgent: Map<string, { runId: string; liveCount: number }>;
|
liveRunByAgent: Map<string, { runId: string; liveCount: number }>;
|
||||||
|
tab: FilterTab;
|
||||||
}) {
|
}) {
|
||||||
const agent = agentMap.get(node.id);
|
const agent = agentMap.get(node.id);
|
||||||
|
|
||||||
|
|
@ -330,7 +332,7 @@ function OrgTreeNode({
|
||||||
<div style={{ paddingLeft: depth * 24 }}>
|
<div style={{ paddingLeft: depth * 24 }}>
|
||||||
<Link
|
<Link
|
||||||
to={agent ? agentUrl(agent) : `/agents/${node.id}`}
|
to={agent ? agentUrl(agent) : `/agents/${node.id}`}
|
||||||
className={cn("flex items-center gap-3 px-3 py-2 hover:bg-accent/30 transition-colors w-full text-left no-underline text-inherit", agent?.pausedAt && "opacity-50")}
|
className={cn("flex items-center gap-3 px-3 py-2 hover:bg-accent/30 transition-colors w-full text-left no-underline text-inherit", agent?.pausedAt && tab !== "paused" && "opacity-50")}
|
||||||
>
|
>
|
||||||
<span className="relative flex h-2.5 w-2.5 shrink-0">
|
<span className="relative flex h-2.5 w-2.5 shrink-0">
|
||||||
<span className={`absolute inline-flex h-full w-full rounded-full ${statusColor}`} />
|
<span className={`absolute inline-flex h-full w-full rounded-full ${statusColor}`} />
|
||||||
|
|
@ -381,7 +383,7 @@ function OrgTreeNode({
|
||||||
{node.reports && node.reports.length > 0 && (
|
{node.reports && node.reports.length > 0 && (
|
||||||
<div className="border-l border-border/50 ml-4">
|
<div className="border-l border-border/50 ml-4">
|
||||||
{node.reports.map((child) => (
|
{node.reports.map((child) => (
|
||||||
<OrgTreeNode key={child.id} node={child} depth={depth + 1} agentMap={agentMap} liveRunByAgent={liveRunByAgent} />
|
<OrgTreeNode key={child.id} node={child} depth={depth + 1} agentMap={agentMap} liveRunByAgent={liveRunByAgent} tab={tab} />
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue