fix(agent-list): close sidebar immediately on agent tap
Move onAgentSelect callback before navigation so the sidebar closes instantly instead of waiting for the navigation to complete. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
020d244b26
commit
344ef87b10
@@ -59,6 +59,7 @@ export function AgentList({ agents, isRefreshing = false, onRefresh, selectedAge
|
||||
});
|
||||
const shouldReplace = pathname.startsWith("/agent/");
|
||||
const navigate = shouldReplace ? router.replace : router.push;
|
||||
onAgentSelect?.();
|
||||
navigate({
|
||||
pathname: "/agent/[serverId]/[agentId]",
|
||||
params: {
|
||||
@@ -66,7 +67,6 @@ export function AgentList({ agents, isRefreshing = false, onRefresh, selectedAge
|
||||
agentId,
|
||||
},
|
||||
});
|
||||
onAgentSelect?.();
|
||||
},
|
||||
[isActionSheetVisible, pathname, onAgentSelect]
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user