From e26f1d6e25bf7f6d31e402620610967533bc1a0a Mon Sep 17 00:00:00 2001 From: "Manan (via MelvinBot)" Date: Tue, 21 Jul 2026 03:33:00 +0000 Subject: [PATCH] Fix: back button on Add agent rule RHP closes the RHP instead of switching to Suggested tab Co-authored-by: Manan --- src/pages/workspace/rules/AgentRules/AddAgentRulePage.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/pages/workspace/rules/AgentRules/AddAgentRulePage.tsx b/src/pages/workspace/rules/AgentRules/AddAgentRulePage.tsx index f2d69c09adf4..990e7527d976 100644 --- a/src/pages/workspace/rules/AgentRules/AddAgentRulePage.tsx +++ b/src/pages/workspace/rules/AgentRules/AddAgentRulePage.tsx @@ -129,11 +129,9 @@ function AddAgentRulePage({ setActiveTab(key); }; + // The header back button always closes the RHP. Switching between the Suggested and Edit tabs is handled + // by the TabSelector, so the back button must not be repurposed to step between tabs. const handleBackButtonPress = () => { - if (activeTab === CONST.TAB.AGENT_RULE.WRITE) { - setActiveTab(CONST.TAB.AGENT_RULE.SUGGESTIONS); - return; - } Navigation.goBack(); };