feat(views/table): format note ID as monospace

This commit is contained in:
Elian Doran 2025-07-14 23:23:25 +03:00
parent aa8902f5b9
commit cf8063f311
No known key found for this signature in database
2 changed files with 7 additions and 2 deletions

View file

@ -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
},
{

View file

@ -47,6 +47,10 @@ export function RowNumberFormatter(draggableRows: boolean) {
};
}
export function MonospaceFormatter(cell: CellComponent) {
return `<code>${cell.getValue()}</code>`;
}
function buildNoteLink(noteId: string) {
const $noteRef = $("<span>");
const href = `#root/${noteId}`;