feat(views/board): use same note title editing mechanism for insert above/below

This commit is contained in:
Elian Doran
2025-07-21 14:32:03 +03:00
parent 96ca3d5e38
commit d0ea6d9e8d
3 changed files with 29 additions and 6 deletions

View File

@@ -311,7 +311,8 @@ export default class BoardView extends ViewMode<BoardData> {
setupContextMenu({
$container: this.$container,
api: this.api
api: this.api,
boardView: this
});
// Setup column title editing and add column functionality
@@ -437,6 +438,23 @@ export default class BoardView extends ViewMode<BoardData> {
}
}
async insertItemAtPosition(column: string, relativeToBranchId: string, direction: "before" | "after"): Promise<void> {
try {
// Create the note without opening it
const newNote = await this.api?.insertRowAtPosition(column, relativeToBranchId, direction, false);
if (newNote) {
// Refresh the board to show the new item
await this.renderList();
// Start inline editing of the newly created card
this.startInlineEditingCard(newNote.noteId);
}
} catch (error) {
console.error("Failed to insert new item:", error);
}
}
private startInlineEditingCard(noteId: string) {
this.renderer?.startInlineEditing(noteId);
}