From 5bf39d20e5709ff264b0ea900a21832d313bd035 Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Fri, 7 Nov 2025 06:01:23 +0530 Subject: [PATCH] feat: Update Captain navigation structure (#12761) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Pull Request Template ## Description This PR includes an update to the Captain navigation structure. ## Route Structure ```javascript 1. captain_assistants_responses_index → /captain/:assistantId/faqs 2. captain_assistants_documents_index → /captain/:assistantId/documents 3. captain_assistants_scenarios_index → /captain/:assistantId/scenarios 4. captain_assistants_playground_index → /captain/:assistantId/playground 5. captain_assistants_inboxes_index → /captain/:assistantId/inboxes 6. captain_tools_index → /captain/tools 7. captain_assistants_settings_index → /captain/:assistantId/settings 8. captain_assistants_guardrails_index → /captain/:assistantId/settings/guardrails 9. captain_assistants_guidelines_index → /captain/:assistantId/settings/guidelines 10. captain_assistants_index → /captain/:navigationPath ``` **How it works:** 1. User clicks sidebar item → Routes to `captain_assistants_index` with `navigationPath` 2. `AssistantsIndexPage` validates route and gets last active assistant, if not redirects to assistant create page. 3. Routes to actual page: `/captain/:assistantId/:page` 4. Page loads with correct assistant context Fixes https://linear.app/chatwoot/issue/CW-5832/updating-captain-navigation ## Type of change - [x] New feature (non-breaking change which adds functionality) ## How Has This Been Tested? ## Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my code - [ ] I have commented on my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules --------- Co-authored-by: Pranav Co-authored-by: Sojan Jose --- .../components-next/captain/PageLayout.vue | 115 +++++- .../captain/SettingsPageLayout.vue | 91 ----- .../captain/assistant/AssistantCard.vue | 7 +- .../captain/assistant/AssistantPlayground.vue | 16 +- .../pageComponents/AssistantSelector.vue | 68 ---- .../assistant/CreateAssistantDialog.vue | 16 +- .../assistant/EditAssistantForm.vue | 333 ------------------ .../settings/AssistantSystemSettingsForm.vue | 37 +- .../document/CreateDocumentDialog.vue | 13 +- .../pageComponents/document/DocumentForm.vue | 37 +- .../response/CreateResponseDialog.vue | 12 +- .../pageComponents/response/ResponseForm.vue | 34 +- .../switcher/AssistantSwitcher.vue | 143 ++++++++ .../copilot/CopilotEmptyState.vue | 6 +- .../components-next/sidebar/Sidebar.vue | 60 +++- .../components-next/sidebar/provider.js | 39 +- .../i18n/locale/en/integrations.json | 38 +- .../dashboard/i18n/locale/en/settings.json | 4 + .../dashboard/captain/assistants/Edit.vue | 86 ----- .../dashboard/captain/assistants/Index.vue | 93 +---- .../captain/assistants/guardrails/Index.vue | 37 +- .../captain/assistants/guidelines/Index.vue | 37 +- .../captain/assistants/inboxes/Index.vue | 30 +- .../captain/assistants/playground/Index.vue | 24 ++ .../captain/assistants/scenarios/Index.vue | 38 +- .../captain/assistants/settings/Settings.vue | 219 +++++++----- .../dashboard/captain/captain.routes.js | 204 +++++------ .../dashboard/captain/documents/Index.vue | 36 +- .../captain/pages/AssistantsIndexPage.vue | 89 +++++ .../captain/pages/CaptainPageRouteView.vue | 30 ++ .../dashboard/captain/responses/Index.vue | 160 +++------ .../dashboard/captain/responses/Pending.vue | 197 ++++------- .../routes/dashboard/captain/tools/Index.vue | 1 + .../store/captain/storeFactory.spec.js | 2 +- .../store/captain/storeFactoryHelper.js | 2 +- 35 files changed, 994 insertions(+), 1360 deletions(-) delete mode 100644 app/javascript/dashboard/components-next/captain/SettingsPageLayout.vue delete mode 100644 app/javascript/dashboard/components-next/captain/pageComponents/AssistantSelector.vue delete mode 100644 app/javascript/dashboard/components-next/captain/pageComponents/assistant/EditAssistantForm.vue create mode 100644 app/javascript/dashboard/components-next/captain/pageComponents/switcher/AssistantSwitcher.vue delete mode 100644 app/javascript/dashboard/routes/dashboard/captain/assistants/Edit.vue create mode 100644 app/javascript/dashboard/routes/dashboard/captain/assistants/playground/Index.vue create mode 100644 app/javascript/dashboard/routes/dashboard/captain/pages/AssistantsIndexPage.vue create mode 100644 app/javascript/dashboard/routes/dashboard/captain/pages/CaptainPageRouteView.vue diff --git a/app/javascript/dashboard/components-next/captain/PageLayout.vue b/app/javascript/dashboard/components-next/captain/PageLayout.vue index c394f1b6b..4b6760f98 100644 --- a/app/javascript/dashboard/components-next/captain/PageLayout.vue +++ b/app/javascript/dashboard/components-next/captain/PageLayout.vue @@ -1,11 +1,17 @@ diff --git a/app/javascript/dashboard/components-next/captain/SettingsPageLayout.vue b/app/javascript/dashboard/components-next/captain/SettingsPageLayout.vue deleted file mode 100644 index 7a2232305..000000000 --- a/app/javascript/dashboard/components-next/captain/SettingsPageLayout.vue +++ /dev/null @@ -1,91 +0,0 @@ - - - diff --git a/app/javascript/dashboard/components-next/captain/assistant/AssistantCard.vue b/app/javascript/dashboard/components-next/captain/assistant/AssistantCard.vue index 222baaecd..7e80cd32c 100644 --- a/app/javascript/dashboard/components-next/captain/assistant/AssistantCard.vue +++ b/app/javascript/dashboard/components-next/captain/assistant/AssistantCard.vue @@ -76,12 +76,11 @@ const handleAction = ({ action, value }) => { - - -