mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-04-28 18:06:30 +02:00
Fix name change bug causing agent tab switching
This commit is contained in:
parent
99053c4360
commit
61b811bd35
2 changed files with 2 additions and 15 deletions
|
|
@ -89,19 +89,6 @@ export function AgentConfig({
|
|||
setLocalName(agent.name);
|
||||
}, [agent.name]);
|
||||
|
||||
// Store active tab in URL hash to persist across re-renders
|
||||
useEffect(() => {
|
||||
const hash = window.location.hash.slice(1);
|
||||
if (hash === 'instructions' || hash === 'configurations') {
|
||||
setActiveTab(hash as TabType);
|
||||
}
|
||||
}, []);
|
||||
|
||||
const handleTabChange = (tab: TabType) => {
|
||||
setActiveTab(tab);
|
||||
window.location.hash = tab;
|
||||
};
|
||||
|
||||
// Track changes in RAG datasources
|
||||
useEffect(() => {
|
||||
const currentSources = agent.ragDataSources || [];
|
||||
|
|
@ -211,7 +198,7 @@ export function AgentConfig({
|
|||
{(['instructions', 'configurations'] as TabType[]).map((tab) => (
|
||||
<button
|
||||
key={tab}
|
||||
onClick={() => handleTabChange(tab)}
|
||||
onClick={() => setActiveTab(tab)}
|
||||
className={clsx(
|
||||
"px-4 py-2 text-sm font-medium transition-colors relative",
|
||||
activeTab === tab
|
||||
|
|
|
|||
|
|
@ -1018,7 +1018,7 @@ export function WorkflowEditor({
|
|||
projectTools={projectTools}
|
||||
/>
|
||||
{state.present.selection?.type === "agent" && <AgentConfig
|
||||
key={state.present.selection.name}
|
||||
key={`agent-${state.present.workflow.agents.findIndex(agent => agent.name === state.present.selection!.name)}`}
|
||||
projectId={state.present.workflow.projectId}
|
||||
workflow={state.present.workflow}
|
||||
agent={state.present.workflow.agents.find((agent) => agent.name === state.present.selection!.name)!}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue