From 416ac8660f7b7a06b6d1b1f20a376c24ceed322a Mon Sep 17 00:00:00 2001
From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Date: Thu, 13 Aug 2026 12:39:56 +0530
Subject: [PATCH] fix: fit the reply editor to Copilot suggestions (#15428)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
# Pull Request Template
## Description
This PR fixes the reply editor staying at its default height when
Copilot generates a suggestion, causing longer suggestions to be clipped
after a line or two.
The editor now automatically grows to fit the suggestion, up to a
maximum of 350px, and returns to the height it had before the suggestion
when it is accepted or discarded. Manual resizing continues to work as
expected and always takes priority.
### How to reproduce
1. Open a conversation and generate a Copilot suggestion (✨ → Summarize
the conversation).
2. The reply editor stays at its default height and the suggestion gets
clipped after a line or two.
3. Resize the reply editor, generate another suggestion, and discard it.
The editor no longer returns to the height you set.
### What changed
* `CopilotEditor` measures the rendered suggestion and requests enough
space to display it, capped at 350px. The requested height is released
when the suggestion is gone.
* `ResizableEditorWrapper` handles this requested height separately from
the manually dragged height, so the suggestion can grow the editor
without overriding the user's preferred height.
* The loading and suggestion states now cross-fade in place while the
editor resizes, instead of briefly switching through an empty card.
### Type of change
- [x] Bug fix (non-breaking change which fixes an issue)
## How Has This Been Tested?
### Screencast
https://github.com/user-attachments/assets/d9a5dab9-6206-4333-92d1-d3f710f9022e
## Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [x] 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
---
.../widgets/WootWriter/CopilotEditor.vue | 43 ++++++++-
.../conversation/CopilotEditorSection.vue | 88 +++++++++++--------
.../conversation/ResizableEditorWrapper.vue | 71 +++++++++------
3 files changed, 137 insertions(+), 65 deletions(-)
diff --git a/app/javascript/dashboard/components/widgets/WootWriter/CopilotEditor.vue b/app/javascript/dashboard/components/widgets/WootWriter/CopilotEditor.vue
index 4ff819d6e..f7d091ec8 100644
--- a/app/javascript/dashboard/components/widgets/WootWriter/CopilotEditor.vue
+++ b/app/javascript/dashboard/components/widgets/WootWriter/CopilotEditor.vue
@@ -1,5 +1,14 @@
-
+
-
+
-import { ref } from 'vue';
+import { ref, inject } from 'vue';
import CopilotEditor from 'dashboard/components/widgets/WootWriter/CopilotEditor.vue';
import CaptainLoader from 'dashboard/components/widgets/conversation/copilot/CaptainLoader.vue';
-defineProps({
+const props = defineProps({
showCopilotEditor: {
type: Boolean,
default: false,
@@ -16,6 +16,10 @@ defineProps({
type: String,
default: '',
},
+ placeholder: {
+ type: String,
+ default: undefined,
+ },
});
const emit = defineEmits([
@@ -26,8 +30,15 @@ const emit = defineEmits([
'send',
]);
+const requestEditorHeight = inject('requestEditorHeight', () => {});
+
const copilotEditorContent = ref('');
+// The loader needs no room of its own, the suggestion asks for its own
+const onStateEnter = () => {
+ if (props.isGeneratingContent) requestEditorHeight(0);
+};
+
const onFocus = () => {
emit('focus');
};
@@ -47,46 +58,49 @@ const onSend = () => {
-
-
-