From cf8063f311664cd5c45b8dc345e120bdc92ae2d9 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 14 Jul 2025 23:23:25 +0300 Subject: [PATCH] feat(views/table): format note ID as monospace --- apps/client/src/widgets/view_widgets/table_view/columns.ts | 5 +++-- .../client/src/widgets/view_widgets/table_view/formatters.ts | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/client/src/widgets/view_widgets/table_view/columns.ts b/apps/client/src/widgets/view_widgets/table_view/columns.ts index 560efdf4b..7a8348e4e 100644 --- a/apps/client/src/widgets/view_widgets/table_view/columns.ts +++ b/apps/client/src/widgets/view_widgets/table_view/columns.ts @@ -1,6 +1,6 @@ import { RelationEditor } from "./relation_editor.js"; -import { NoteFormatter, NoteTitleFormatter, RowNumberFormatter } from "./formatters.js"; -import type { ColumnDefinition, Tabulator } from "tabulator-tables"; +import { MonospaceFormatter, NoteFormatter, NoteTitleFormatter, RowNumberFormatter } from "./formatters.js"; +import type { ColumnDefinition } from "tabulator-tables"; import { LabelType } from "../../../services/promoted_attribute_definition_parser.js"; type ColumnType = LabelType | "relation"; @@ -55,6 +55,7 @@ export function buildColumnDefinitions(info: AttributeDefinitionInformation[], m { field: "noteId", title: "Note ID", + formatter: MonospaceFormatter, visible: false }, { diff --git a/apps/client/src/widgets/view_widgets/table_view/formatters.ts b/apps/client/src/widgets/view_widgets/table_view/formatters.ts index 15701bc5c..07c9d1060 100644 --- a/apps/client/src/widgets/view_widgets/table_view/formatters.ts +++ b/apps/client/src/widgets/view_widgets/table_view/formatters.ts @@ -47,6 +47,10 @@ export function RowNumberFormatter(draggableRows: boolean) { }; } +export function MonospaceFormatter(cell: CellComponent) { + return `${cell.getValue()}`; +} + function buildNoteLink(noteId: string) { const $noteRef = $(""); const href = `#root/${noteId}`;