From f2cf81e7ff92a0ff4d5d6d61b473f5edc36e0fa2 Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Wed, 5 Aug 2026 17:10:52 +0530 Subject: [PATCH] chore: use `SidePanel` component for the article diff panel (#15333) # Pull Request Template ## Description The unsaved changes panel in the Help Center article editor now uses the shared `SidePanel` component instead of its own custom drawer. It now matches the rest of the dashboard, with the same slide-in animation, backdrop, and close button for a consistent experience. ## Type of change - [x] New feature (non-breaking change which adds functionality) ## How Has This Been Tested? ### Screenshots **Before** image **After** image ## 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 --- .../ArticleEditorPage/ArticleDiffPanel.vue | 145 +++++++----------- .../Pages/ArticleEditorPage/ArticleEditor.vue | 8 +- .../ArticleEditorPage/ArticleEditorHeader.vue | 1 - 3 files changed, 61 insertions(+), 93 deletions(-) diff --git a/app/javascript/dashboard/components-next/HelpCenter/Pages/ArticleEditorPage/ArticleDiffPanel.vue b/app/javascript/dashboard/components-next/HelpCenter/Pages/ArticleEditorPage/ArticleDiffPanel.vue index 050ccda06..be4f82e17 100644 --- a/app/javascript/dashboard/components-next/HelpCenter/Pages/ArticleEditorPage/ArticleDiffPanel.vue +++ b/app/javascript/dashboard/components-next/HelpCenter/Pages/ArticleEditorPage/ArticleDiffPanel.vue @@ -1,16 +1,13 @@ diff --git a/app/javascript/dashboard/components-next/HelpCenter/Pages/ArticleEditorPage/ArticleEditor.vue b/app/javascript/dashboard/components-next/HelpCenter/Pages/ArticleEditorPage/ArticleEditor.vue index 6540b6460..cea89857b 100644 --- a/app/javascript/dashboard/components-next/HelpCenter/Pages/ArticleEditorPage/ArticleEditor.vue +++ b/app/javascript/dashboard/components-next/HelpCenter/Pages/ArticleEditorPage/ArticleEditor.vue @@ -53,7 +53,7 @@ const hasPendingChanges = computed( const localTitle = ref(effectiveTitle()); const localContent = ref(effectiveContent()); -const isDiffPanelOpen = ref(false); +const diffPanelRef = ref(null); // Autosave 500ms after the last edit. It sends both title and content so an // edit to one never drops a recent edit to the other. `stop` cancels a queued @@ -84,7 +84,7 @@ watch( [() => props.article?.id, hasPendingChanges], ([id, pending], [prevId, prevPending]) => { if ((id && id !== prevId) || (prevPending && !pending)) syncLocalState(); - if (prevPending && !pending) isDiffPanelOpen.value = false; + if (prevPending && !pending) diffPanelRef.value?.close(); } ); @@ -156,9 +156,9 @@ const handleCreateArticle = event => { :is-saving="isSaving" @go-back="onClickGoBack" @preview-article="previewArticle" - @show-diff="isDiffPanelOpen = !isDiffPanelOpen" + @show-diff="diffPanelRef?.open()" /> - +