From e411f9932f48a4b73695145b7b8ecd1ec97a1b77 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Fri, 4 Jul 2025 18:13:07 +0300 Subject: [PATCH] feat(views/table): display note title when editing relation --- apps/client/src/widgets/view_widgets/table_view/data.ts | 2 -- .../src/widgets/view_widgets/table_view/relation_editor.ts | 7 ++++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/client/src/widgets/view_widgets/table_view/data.ts b/apps/client/src/widgets/view_widgets/table_view/data.ts index 37240e71c..2afd7b851 100644 --- a/apps/client/src/widgets/view_widgets/table_view/data.ts +++ b/apps/client/src/widgets/view_widgets/table_view/data.ts @@ -159,8 +159,6 @@ export async function buildRowDefinitions(parentNote: FNote, notes: FNote[], inf }); } - console.log("Built row definitions", definitions); - return definitions; } diff --git a/apps/client/src/widgets/view_widgets/table_view/relation_editor.ts b/apps/client/src/widgets/view_widgets/table_view/relation_editor.ts index c6049026a..9db63af14 100644 --- a/apps/client/src/widgets/view_widgets/table_view/relation_editor.ts +++ b/apps/client/src/widgets/view_widgets/table_view/relation_editor.ts @@ -1,6 +1,7 @@ import { CellComponent } from "tabulator-tables"; import note_autocomplete from "../../../services/note_autocomplete"; import { loadReferenceLinkTitle } from "../../../services/link"; +import froca from "../../../services/froca"; export function RelationEditor(cell: CellComponent, onRendered, success, cancel, editorParams){ //cell - the cell component for the editable cell @@ -20,7 +21,11 @@ export function RelationEditor(cell: CellComponent, onRendered, success, cancel, editor.style.boxSizing = "border-box"; //Set value of editor to the current value of the cell - editor.value = cell.getValue(); + const noteId = cell.getValue(); + if (noteId) { + const note = froca.getNoteFromCache(noteId); + editor.value = note.title; + } //set focus on the select box when the editor is selected onRendered(function(){