mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-05-02 11:52:38 +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);
|
setLocalName(agent.name);
|
||||||
}, [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
|
// Track changes in RAG datasources
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const currentSources = agent.ragDataSources || [];
|
const currentSources = agent.ragDataSources || [];
|
||||||
|
|
@ -211,7 +198,7 @@ export function AgentConfig({
|
||||||
{(['instructions', 'configurations'] as TabType[]).map((tab) => (
|
{(['instructions', 'configurations'] as TabType[]).map((tab) => (
|
||||||
<button
|
<button
|
||||||
key={tab}
|
key={tab}
|
||||||
onClick={() => handleTabChange(tab)}
|
onClick={() => setActiveTab(tab)}
|
||||||
className={clsx(
|
className={clsx(
|
||||||
"px-4 py-2 text-sm font-medium transition-colors relative",
|
"px-4 py-2 text-sm font-medium transition-colors relative",
|
||||||
activeTab === tab
|
activeTab === tab
|
||||||
|
|
|
||||||
|
|
@ -1018,7 +1018,7 @@ export function WorkflowEditor({
|
||||||
projectTools={projectTools}
|
projectTools={projectTools}
|
||||||
/>
|
/>
|
||||||
{state.present.selection?.type === "agent" && <AgentConfig
|
{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}
|
projectId={state.present.workflow.projectId}
|
||||||
workflow={state.present.workflow}
|
workflow={state.present.workflow}
|
||||||
agent={state.present.workflow.agents.find((agent) => agent.name === state.present.selection!.name)!}
|
agent={state.present.workflow.agents.find((agent) => agent.name === state.present.selection!.name)!}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue