Skip to content

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

When creating the new task, put initial focus on the task title

天舟376ebd3a0ab7
diff --git a/frontend/src/views/TaskDescriptionPanel.vue b/frontend/src/views/TaskDescriptionPanel.vue
index 9f0c88a3f2..e1fb3ceee7 100644
--- a/frontend/src/views/TaskDescriptionPanel.vue
+++ b/frontend/src/views/TaskDescriptionPanel.vue
@@ -138,15 +138,7 @@ export default {
onMounted(() => {
document.addEventListener("keydown", keyboardHandler);
window.addEventListener("resize", resizeTextAreaHandler);
- if (props.new) {
- state.editing = true;
- }
- nextTick(() => {
- sizeToFit(editDescriptionTextArea.value);
- if (props.new) {
- editDescriptionTextArea.value.focus();
- }
- });
+ sizeToFit(editDescriptionTextArea.value);
});
onUnmounted(() => {
diff --git a/frontend/src/views/TaskHighlightPanel.vue b/frontend/src/views/TaskHighlightPanel.vue
index 5bbbbf346f..f3a604dcb8 100644
--- a/frontend/src/views/TaskHighlightPanel.vue
+++ b/frontend/src/views/TaskHighlightPanel.vue
@@ -14,6 +14,7 @@
class="ml-2 my-0.5 w-full text-lg font-bold"
:disabled="!allowEdit"
:required="true"
+ :focusOnMount="$props.new"
:bordered="false"
:value="state.name"
:placeholder="'Task name'"
@@ -41,11 +42,10 @@
</template>
<script lang="ts">
-import { reactive, ref, nextTick, watch, PropType } from "vue";
+import { reactive, watch, PropType } from "vue";
import TaskStatusIcon from "../components/TaskStatusIcon.vue";
import { activeStage } from "../utils";
import { Task } from "../types";
-import { isEmpty } from "lodash";
interface LocalState {
editing: boolean;
@@ -71,8 +71,6 @@ export default {
},
components: { TaskStatusIcon },
setup(props, { emit }) {
- const nameTextField = ref();
-
const state = reactive<LocalState>({
editing: false,
name: props.task.name,
@@ -92,7 +90,7 @@ export default {
}
};
- return { nameTextField, state, activeStage, trySaveName };
+ return { state, activeStage, trySaveName };
},
};
</script>