Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

Remove the SQL highlighting on description and comment field for now

天舟c719b6f0f144
diff --git a/frontend/src/views/TaskActivityPanel.vue b/frontend/src/views/TaskActivityPanel.vue
index 69563834ed..7f3590f162 100644
--- a/frontend/src/views/TaskActivityPanel.vue
+++ b/frontend/src/views/TaskActivityPanel.vue
@@ -172,38 +172,35 @@
</div>
</div>
</div>
- <template
- v-if="
- state.editCommentMode &&
- state.activeActivity.id == activity.id
- "
- >
- <label for="comment" class="sr-only">Edit Comment</label>
- <textarea
- ref="editCommentTextArea"
- class="textarea block w-full resize-none mt-1 text-sm text-control whitespace-pre-wrap"
- placeholder="Add a note..."
- v-model="editComment"
- @input="
- (e) => {
- sizeToFit(e.target);
- }
- "
- @focus="
- (e) => {
- sizeToFit(e.target);
- }
+ <div class="mt-2 text-sm text-control whitespace-pre-wrap">
+ <template
+ v-if="
+ state.editCommentMode &&
+ state.activeActivity.id == activity.id
"
- ></textarea>
- </template>
- <!-- The margin value is intentionally set to avoid flickering when switching between edit mode. -->
- <div
- v-else-if="activity.comment"
- class="text-sm ml-1.5 mt-2 mb-0.5 whitespace-pre-wrap"
- >
- <div v-highlight>
+ >
+ <label for="comment" class="sr-only">Edit Comment</label>
+ <textarea
+ ref="editCommentTextArea"
+ rows="3"
+ class="textarea block w-full resize-none"
+ placeholder="Leave a comment..."
+ v-model="editComment"
+ @input="
+ (e) => {
+ sizeToFit(e.target);
+ }
+ "
+ @focus="
+ (e) => {
+ sizeToFit(e.target);
+ }
+ "
+ ></textarea>
+ </template>
+ <template v-else>
{{ activity.comment }}
- </div>
+ </template>
</div>
</div>
</div>
diff --git a/frontend/src/views/TaskDescriptionPanel.vue b/frontend/src/views/TaskDescriptionPanel.vue
index 6eab39cb84..22a692a9c2 100644
--- a/frontend/src/views/TaskDescriptionPanel.vue
+++ b/frontend/src/views/TaskDescriptionPanel.vue
@@ -41,39 +41,32 @@
</div>
<!-- Description -->
<label for="description" class="sr-only">Edit Description</label>
- <!-- TODO: Has control flickering switching between edit/non-edit mode -->
- <template v-if="state.edit">
- <textarea
- ref="editDescriptionTextArea"
- :rows="$props.new ? 10 : 5"
- class="whitespace-pre-wrap mt-2 w-full focus:ring-control focus-visible:ring-2 resize-none border-white focus:border-white outline-none"
- placeholder="Add some description..."
- v-model="state.editDescription"
- @input="
- (e) => {
- sizeToFit(e.target);
- // When creating the task, we will emit the event on keystroke to update the in-memory state.
- if ($props.new) {
- $emit('update-description', state.editDescription);
- }
- }
- "
- @focus="
- (e) => {
- sizeToFit(e.target);
- }
- "
- ></textarea>
- </template>
- <div
- v-else
- class="mt-4"
- style="margin-left: 5px; margin-top: 9px; margin-bottom: 23px"
- >
- <div v-highlight class="whitespace-pre-wrap">
- {{ state.editDescription }}
- </div>
- </div>
+ <!-- Use border-white focus:border-white to have the invisible border width
+ otherwise it will have 1px jiggling switching between focus/unfocus state -->
+ <textarea
+ ref="editDescriptionTextArea"
+ :rows="$props.new ? 10 : 5"
+ class="mt-2 w-full resize-none whitespace-pre-wrap border-white focus:border-white outline-none"
+ :class="state.edit ? 'focus:ring-control focus-visible:ring-2' : ''"
+ :style="
+ state.edit
+ ? ''
+ : '-webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none'
+ "
+ placeholder="Add some description..."
+ :readonly="!state.edit"
+ v-model="state.editDescription"
+ @input="
+ (e) => {
+ sizeToFit(e.target);
+ }
+ "
+ @focus="
+ (e) => {
+ sizeToFit(e.target);
+ }
+ "
+ ></textarea>
</template>
<script lang="ts">
@@ -136,9 +129,7 @@ export default {
};
const resizeTextAreaHandler = () => {
- if (state.edit) {
- sizeToFit(editDescriptionTextArea.value);
- }
+ sizeToFit(editDescriptionTextArea.value);
};
onMounted(() => {
@@ -148,9 +139,9 @@ export default {
state.edit = true;
}
nextTick(() => {
+ sizeToFit(editDescriptionTextArea.value);
if (props.new) {
editDescriptionTextArea.value.focus();
- sizeToFit(editDescriptionTextArea.value);
}
});
});
@@ -175,9 +166,7 @@ export default {
(curTask, prevTask) => {
state.editDescription = curTask.description;
nextTick(() => {
- if (state.edit) {
- sizeToFit(editDescriptionTextArea.value);
- }
+ sizeToFit(editDescriptionTextArea.value);
});
}
);