From 7f81b839550d822d48e23fae3574acc19afd8776 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Thu, 20 Nov 2025 20:13:20 +0200 Subject: [PATCH] chore(print/list): get note titles to render --- .../src/widgets/collections/NoteList.tsx | 8 ++++++-- .../collections/legacy/ListOrGridView.tsx | 20 +++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/apps/client/src/widgets/collections/NoteList.tsx b/apps/client/src/widgets/collections/NoteList.tsx index 1d5a96810..860886a0f 100644 --- a/apps/client/src/widgets/collections/NoteList.tsx +++ b/apps/client/src/widgets/collections/NoteList.tsx @@ -2,7 +2,7 @@ import { allViewTypes, ViewModeMedia, ViewModeProps, ViewTypeOptions } from "./i import { useNoteContext, useNoteLabel, useNoteLabelBoolean, useTriliumEvent } from "../react/hooks"; import FNote from "../../entities/fnote"; import "./NoteList.css"; -import { ListView, GridView } from "./legacy/ListOrGridView"; +import { ListView, GridView, ListPrintView } from "./legacy/ListOrGridView"; import { useEffect, useRef, useState } from "preact/hooks"; import GeoView from "./geomap"; import ViewModeStorage from "./view_mode_storage"; @@ -103,7 +103,11 @@ export function CustomNoteList({ note, viewType, isEnabled: shouldEnable, notePa function getComponentByViewType(viewType: ViewTypeOptions, props: ViewModeProps) { switch (viewType) { case "list": - return ; + if (props.media !== "print") { + return ; + } else { + return ; + } case "grid": return ; case "geoMap": diff --git a/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx b/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx index ef37b6685..db5a88593 100644 --- a/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx +++ b/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx @@ -11,6 +11,7 @@ import tree from "../../../services/tree"; import link from "../../../services/link"; import { t } from "../../../services/i18n"; import attribute_renderer from "../../../services/attribute_renderer"; +import froca from "../../../services/froca"; export function ListView({ note, noteIds: unfilteredNoteIds, highlightedTokens }: ViewModeProps<{}>) { const [ isExpanded ] = useNoteLabelBoolean(note, "expanded"); @@ -34,6 +35,25 @@ export function ListView({ note, noteIds: unfilteredNoteIds, highlightedTokens } ); } +export function ListPrintView({ note, noteIds: unfilteredNoteIds, highlightedTokens }: ViewModeProps<{}>) { + const noteIds = useFilteredNoteIds(note, unfilteredNoteIds); + const [ notes, setNotes ] = useState(); + + useEffect(() => { + froca.getNotes(noteIds).then(setNotes); + }, [noteIds]); + + return ( +
+ +
+ ); +} + export function GridView({ note, noteIds: unfilteredNoteIds, highlightedTokens }: ViewModeProps<{}>) { const noteIds = useFilteredNoteIds(note, unfilteredNoteIds); const { pageNotes, ...pagination } = usePagination(note, noteIds);