From 516f0052efcd7f87cd3f66d1e1df50fe257ae964 Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Tue, 17 Feb 2026 20:36:01 +0200 Subject: [PATCH 01/27] ui/grid view: use flex gap instead of margins for cards --- apps/client/src/stylesheets/theme-next/base.css | 1 - apps/client/src/widgets/collections/legacy/ListOrGridView.css | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/client/src/stylesheets/theme-next/base.css b/apps/client/src/stylesheets/theme-next/base.css index 9e39b2f002..f7d65c765f 100644 --- a/apps/client/src/stylesheets/theme-next/base.css +++ b/apps/client/src/stylesheets/theme-next/base.css @@ -655,7 +655,6 @@ li.dropdown-item a.dropdown-item-button:focus-visible { border-radius: 12px; user-select: none; padding: 0; - margin: 5px 10px 5px 0; } :root .note-list .note-book-card:hover { diff --git a/apps/client/src/widgets/collections/legacy/ListOrGridView.css b/apps/client/src/widgets/collections/legacy/ListOrGridView.css index 222682cc9f..adc6c8b2b3 100644 --- a/apps/client/src/widgets/collections/legacy/ListOrGridView.css +++ b/apps/client/src/widgets/collections/legacy/ListOrGridView.css @@ -8,7 +8,6 @@ border-radius: 10px; background-color: var(--accented-background-color); padding: 10px 15px 15px 8px; - margin: 5px 5px 5px 5px; overflow: hidden; display: flex; flex-direction: column; @@ -304,6 +303,7 @@ .note-list.grid-view .note-list-container { display: flex; flex-wrap: wrap; + gap: 10px; } .note-list.grid-view .note-book-card { From 297cbbd8b311711a7ada830de0f4e9b6341efcc5 Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Wed, 18 Feb 2026 09:15:38 +0200 Subject: [PATCH 02/27] ui/grid view: reuse some styles from list view --- .../collections/legacy/ListOrGridView.css | 37 +++++++++++-------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/apps/client/src/widgets/collections/legacy/ListOrGridView.css b/apps/client/src/widgets/collections/legacy/ListOrGridView.css index adc6c8b2b3..6b55c0fade 100644 --- a/apps/client/src/widgets/collections/legacy/ListOrGridView.css +++ b/apps/client/src/widgets/collections/legacy/ListOrGridView.css @@ -99,6 +99,28 @@ overflow: auto; } +.nested-note-list-item, +.note-book-card { + h5 { + display: flex; + align-items: center; + font-size: 1em; + font-weight: normal; + margin: 0; + } + + .tn-icon { + font-size: 1.2em; + } + + .note-book-title { + --link-hover-background: transparent; + --link-hover-color: currentColor; + color: inherit; + font-weight: normal; + } +} + /* #region List view */ @keyframes note-preview-show { @@ -119,13 +141,6 @@ /* List item */ .nested-note-list-item { - h5 { - display: flex; - align-items: center; - font-size: 1em; - font-weight: normal; - margin: 0; - } .note-expander { margin-inline-end: 4px; @@ -136,14 +151,6 @@ .tn-icon { margin-inline-end: 8px; color: var(--note-list-view-icon-color); - font-size: 1.2em; - } - - .note-book-title { - --link-hover-background: transparent; - --link-hover-color: currentColor; - color: inherit; - font-weight: normal; } .note-path { From 5036518458fdfd3c63dce41305ae06fe487a0b4c Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Wed, 18 Feb 2026 09:20:00 +0200 Subject: [PATCH 03/27] ui/grid view: hide attributes --- apps/client/src/widgets/collections/legacy/ListOrGridView.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx b/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx index cdde8a6087..866ec56537 100644 --- a/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx +++ b/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx @@ -163,7 +163,6 @@ function GridNoteCard({ note, parentNote, highlightedTokens, includeArchived }:
-
Date: Wed, 18 Feb 2026 09:31:03 +0200 Subject: [PATCH 04/27] ui/grid view: refactor --- .../collections/legacy/ListOrGridView.tsx | 42 ++++++++++++------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx b/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx index 866ec56537..2d34681666 100644 --- a/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx +++ b/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx @@ -148,27 +148,37 @@ function ListNoteCard({ note, parentNote, highlightedTokens, currentLevel, expan ); } -function GridNoteCard({ note, parentNote, highlightedTokens, includeArchived }: { note: FNote, parentNote: FNote, highlightedTokens: string[] | null | undefined, includeArchived: boolean }) { - const titleRef = useRef(null); - const [ noteTitle, setNoteTitle ] = useState(); - const notePath = getNotePath(parentNote, note); +interface GridNoteCardProps { + note: FNote; + parentNote: FNote; + highlightedTokens: string[] | null | undefined; + includeArchived: boolean +} + +function GridNoteCard(props: GridNoteCardProps) { + const notePath = getNotePath(props.parentNote, props.note); return ( -
link.goToLink(e)} +
link.goToLink(e)} >
- - + +
-
); From e006550b9f50d7832af3d20b653ac3b318cb775d Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Wed, 18 Feb 2026 09:51:18 +0200 Subject: [PATCH 05/27] ui/grid view: add a menu button for grid items --- .../collections/legacy/ListOrGridView.css | 21 +++++++++++---- .../collections/legacy/ListOrGridView.tsx | 27 +++++++++++-------- 2 files changed, 32 insertions(+), 16 deletions(-) diff --git a/apps/client/src/widgets/collections/legacy/ListOrGridView.css b/apps/client/src/widgets/collections/legacy/ListOrGridView.css index 6b55c0fade..3fac974358 100644 --- a/apps/client/src/widgets/collections/legacy/ListOrGridView.css +++ b/apps/client/src/widgets/collections/legacy/ListOrGridView.css @@ -119,6 +119,11 @@ color: inherit; font-weight: normal; } + + .note-book-item-menu { + margin-inline-start: 8px; + flex-shrink: 0; + } } /* #region List view */ @@ -167,11 +172,6 @@ opacity: .75; } - .nested-note-list-item-menu { - margin-inline-start: 8px; - flex-shrink: 0; - } - &.archived { span.tn-icon + span, .tn-icon { @@ -307,6 +307,17 @@ /* #endregion */ /* #region Grid view */ + +.note-book-card { + h5 { + + .tn-icon + span { + flex-grow: 1; + } + } + +} + .note-list.grid-view .note-list-container { display: flex; flex-wrap: wrap; diff --git a/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx b/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx index 2d34681666..8534b8d564 100644 --- a/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx +++ b/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx @@ -1,7 +1,7 @@ import "./ListOrGridView.css"; import { Card, CardSection } from "../../react/Card"; -import { useEffect, useRef, useState } from "preact/hooks"; +import { useCallback, useEffect, useRef, useState } from "preact/hooks"; import FNote from "../../../entities/fnote"; import attribute_renderer from "../../../services/attribute_renderer"; @@ -139,10 +139,7 @@ function ListNoteCard({ note, parentNote, highlightedTokens, currentLevel, expan showNotePath={parentNote.type === "search"} highlightedTokens={highlightedTokens} /> - openNoteMenu(notePath, e)} - /> + ); @@ -174,6 +171,7 @@ function GridNoteCard(props: GridNoteCardProps) { showNotePath={props.parentNote.type === "search"} highlightedTokens={props.highlightedTokens} /> + ); } +function NoteMenuButton(props: {notePath: string}) { + const openMenu = useCallback((e: TargetedMouseEvent) => { + linkContextMenuService.openContextMenu(props.notePath, e); + e.stopPropagation() + }, [props.notePath]); + + return +} + function getNotePath(parentNote: FNote, childNote: FNote) { if (parentNote.type === "search") { // for search note parent, we want to display a non-search path @@ -282,9 +292,4 @@ function useExpansionDepth(note: FNote) { } return parseInt(expandDepth, 10); -} - -function openNoteMenu(notePath, e: TargetedMouseEvent) { - linkContextMenuService.openContextMenu(notePath, e); - e.stopPropagation() -} +} \ No newline at end of file From 75c7d55e016b157eb19d362cd39c066c55b963bc Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Wed, 18 Feb 2026 10:08:50 +0200 Subject: [PATCH 06/27] ui/grid view: tweak style --- .../src/stylesheets/theme-next/base.css | 28 ------------------- .../collections/legacy/ListOrGridView.css | 8 +++++- 2 files changed, 7 insertions(+), 29 deletions(-) diff --git a/apps/client/src/stylesheets/theme-next/base.css b/apps/client/src/stylesheets/theme-next/base.css index f7d65c765f..995e796d73 100644 --- a/apps/client/src/stylesheets/theme-next/base.css +++ b/apps/client/src/stylesheets/theme-next/base.css @@ -678,34 +678,6 @@ li.dropdown-item a.dropdown-item-button:focus-visible { color: inherit !important; } -.note-list-wrapper .note-book-card .note-book-header { - font-size: 1em; - font-weight: bold; - padding: 0.5em 1rem; - border-bottom-color: var(--card-border-color); -} - -.note-list-wrapper .note-book-card .note-book-header .note-icon { - font-size: 17px; - vertical-align: text-bottom; -} - -.note-list-wrapper .note-book-card .note-book-header .note-book-title { - font-size: 1em; - color: var(--active-item-text-color); - vertical-align: middle; -} - -.note-list-wrapper .note-book-card .note-book-header .rendered-note-attributes { - font-size: 0.7em; - font-weight: normal; - margin-bottom: 0; -} - -.note-list-wrapper .note-book-card .note-book-header:last-child { - border-bottom: 0; -} - .note-list-wrapper .note-book-card .note-book-content { padding: 0 !important; font-size: 0.8rem; diff --git a/apps/client/src/widgets/collections/legacy/ListOrGridView.css b/apps/client/src/widgets/collections/legacy/ListOrGridView.css index 3fac974358..3e151d79bf 100644 --- a/apps/client/src/widgets/collections/legacy/ListOrGridView.css +++ b/apps/client/src/widgets/collections/legacy/ListOrGridView.css @@ -309,10 +309,16 @@ /* #region Grid view */ .note-book-card { - h5 { + .note-book-header { + padding: .5em 1em; + padding-inline-end: 8px; + border-bottom-color: var(--card-border-color); .tn-icon + span { flex-grow: 1; + a { + font-weight: 500; + } } } From 419e87b0de1d92c74e9b21575355ad495b14ff7e Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Wed, 18 Feb 2026 10:29:41 +0200 Subject: [PATCH 07/27] ui/grid view: add support for colored notes --- apps/client/src/stylesheets/theme-next-dark.css | 3 ++- apps/client/src/stylesheets/theme-next-light.css | 3 ++- apps/client/src/stylesheets/theme-next/base.css | 4 ---- .../collections/legacy/ListOrGridView.css | 16 ++++++++-------- .../collections/legacy/ListOrGridView.tsx | 2 +- 5 files changed, 13 insertions(+), 15 deletions(-) diff --git a/apps/client/src/stylesheets/theme-next-dark.css b/apps/client/src/stylesheets/theme-next-dark.css index dfdc209040..ab86bcc4bd 100644 --- a/apps/client/src/stylesheets/theme-next-dark.css +++ b/apps/client/src/stylesheets/theme-next-dark.css @@ -314,7 +314,8 @@ */ #left-pane .fancytree-node.tinted, -.nested-note-list-item.use-note-color { +.nested-note-list-item.use-note-color, +.note-book-card.use-note-color { --custom-color: var(--dark-theme-custom-color); /* The background color of the active item in the note tree. diff --git a/apps/client/src/stylesheets/theme-next-light.css b/apps/client/src/stylesheets/theme-next-light.css index 4b6b37718c..ead60aa992 100644 --- a/apps/client/src/stylesheets/theme-next-light.css +++ b/apps/client/src/stylesheets/theme-next-light.css @@ -308,7 +308,8 @@ } #left-pane .fancytree-node.tinted, -.nested-note-list-item.use-note-color { +.nested-note-list-item.use-note-color, +.note-book-card.use-note-color { --custom-color: var(--light-theme-custom-color); /* The background color of the active item in the note tree. diff --git a/apps/client/src/stylesheets/theme-next/base.css b/apps/client/src/stylesheets/theme-next/base.css index 995e796d73..6a0ea97e53 100644 --- a/apps/client/src/stylesheets/theme-next/base.css +++ b/apps/client/src/stylesheets/theme-next/base.css @@ -727,10 +727,6 @@ li.dropdown-item a.dropdown-item-button:focus-visible { margin-bottom: 0; } -.note-list-wrapper .note-book-card .tn-icon { - color: var(--left-pane-icon-color) !important; -} - .note-list.grid-view .note-book-card:hover { filter: contrast(105%); } diff --git a/apps/client/src/widgets/collections/legacy/ListOrGridView.css b/apps/client/src/widgets/collections/legacy/ListOrGridView.css index 3e151d79bf..93af378501 100644 --- a/apps/client/src/widgets/collections/legacy/ListOrGridView.css +++ b/apps/client/src/widgets/collections/legacy/ListOrGridView.css @@ -124,6 +124,14 @@ margin-inline-start: 8px; flex-shrink: 0; } + + &.use-note-color { + span.tn-icon + span, + .tn-icon, + .rendered-note-attributes { + color: var(--custom-color); + } + } } /* #region List view */ @@ -178,14 +186,6 @@ opacity: .6; } } - - &.use-note-color { - span.tn-icon + span, - .nested-note-list:not(.search-results) & .tn-icon, - .rendered-note-attributes { - color: var(--custom-color); - } - } } .nested-note-list:not(.search-results) h5 { diff --git a/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx b/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx index 8534b8d564..dec8934043 100644 --- a/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx +++ b/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx @@ -156,7 +156,7 @@ function GridNoteCard(props: GridNoteCardProps) { const notePath = getNotePath(props.parentNote, props.note); return ( -
Date: Thu, 19 Feb 2026 19:14:01 +0200 Subject: [PATCH 08/27] ui/grid view: add support for search view --- .../src/stylesheets/theme-next-dark.css | 3 +- .../src/stylesheets/theme-next-light.css | 3 +- .../collections/legacy/ListOrGridView.css | 108 +++++++++--------- .../collections/legacy/ListOrGridView.tsx | 2 +- 4 files changed, 58 insertions(+), 58 deletions(-) diff --git a/apps/client/src/stylesheets/theme-next-dark.css b/apps/client/src/stylesheets/theme-next-dark.css index ab86bcc4bd..94f6254d25 100644 --- a/apps/client/src/stylesheets/theme-next-dark.css +++ b/apps/client/src/stylesheets/theme-next-dark.css @@ -366,7 +366,8 @@ body .todo-list input[type="checkbox"]:not(:checked):before { .note-split.with-hue, .quick-edit-dialog-wrapper.with-hue, -.nested-note-list-item.with-hue { +.nested-note-list-item.with-hue, +.note-book-card.with-hue { --note-icon-custom-background-color: hsl(var(--custom-color-hue), 15.8%, 30.9%); --note-icon-custom-color: hsl(var(--custom-color-hue), 100%, 76.5%); --note-icon-hover-custom-background-color: hsl(var(--custom-color-hue), 28.3%, 36.7%); diff --git a/apps/client/src/stylesheets/theme-next-light.css b/apps/client/src/stylesheets/theme-next-light.css index ead60aa992..a4d3eced8a 100644 --- a/apps/client/src/stylesheets/theme-next-light.css +++ b/apps/client/src/stylesheets/theme-next-light.css @@ -336,7 +336,8 @@ .note-split.with-hue, .quick-edit-dialog-wrapper.with-hue, -.nested-note-list-item.with-hue { +.nested-note-list-item.with-hue, +.note-book-card.with-hue { --note-icon-custom-background-color: hsl(var(--custom-color-hue), 44.5%, 43.1%); --note-icon-custom-color: hsl(var(--custom-color-hue), 91.3%, 91%); --note-icon-hover-custom-background-color: hsl(var(--custom-color-hue), 55.1%, 50.2%); diff --git a/apps/client/src/widgets/collections/legacy/ListOrGridView.css b/apps/client/src/widgets/collections/legacy/ListOrGridView.css index 93af378501..cf0187ab89 100644 --- a/apps/client/src/widgets/collections/legacy/ListOrGridView.css +++ b/apps/client/src/widgets/collections/legacy/ListOrGridView.css @@ -57,13 +57,6 @@ content: "\00a0\00a0"; } -.note-book-header .note-icon { - font-size: 100%; - display: inline-block; - padding-inline-end: 7px; - position: relative; -} - .note-book-card .note-book-card { border: 1px solid var(--main-border-color); } @@ -134,6 +127,59 @@ } } +/* Search result view */ +.nested-note-list.search-results .nested-note-list-item, +.note-list-container.search-results .note-book-card .note-book-header { + span.tn-icon + span > span { + display: flex; + flex-direction: column-reverse; + align-items: flex-start; + } + + small { + line-height: .85em; + } + + .note-path { + margin-left: 0; + font-size: .85em; + line-height: .85em; + font-weight: 500; + letter-spacing: .5pt; + } + + .tn-icon { + display: flex; + flex-shrink: 0; + justify-content: center; + align-items: center; + width: 1.75em; + height: 1.75em; + margin-inline-end: 12px; + border-radius: 50%; + background: var(--note-icon-custom-background-color, var(--note-list-view-large-icon-background)); + font-size: 1.2em; + color: var(--note-icon-custom-color, var(--note-list-view-large-icon-color)); + } + + .ck-find-result { + background: var(--note-list-view-search-result-highlight-background); + color: var(--note-list-view-search-result-highlight-color); + font-weight: 600; + text-decoration: underline; + } +} + +.nested-note-list .note-book-content, +.note-list-container .note-book-content { + .ck-find-result { + outline: 2px solid var(--note-list-view-content-search-result-highlight-background); + border-radius: 4px; + background: var(--note-list-view-content-search-result-highlight-background); + color: var(--note-list-view-content-search-result-highlight-color); + } +} + /* #region List view */ @keyframes note-preview-show { @@ -197,47 +243,6 @@ } } -/* List item (search results view) */ -.nested-note-list.search-results .nested-note-list-item { - span.tn-icon + span > span { - display: flex; - flex-direction: column-reverse; - align-items: flex-start; - } - - small { - line-height: .85em; - } - - .note-path { - margin-left: 0; - font-size: .85em; - line-height: .85em; - font-weight: 500; - letter-spacing: .5pt; - } - - .tn-icon { - display: flex; - flex-shrink: 0; - justify-content: center; - align-items: center; - width: 1.75em; - height: 1.75em; - margin-inline-end: 12px; - border-radius: 50%; - background: var(--note-icon-custom-background-color, var(--note-list-view-large-icon-background)); - font-size: 1.2em; - color: var(--note-icon-custom-color, var(--note-list-view-large-icon-color)); - } - - h5 .ck-find-result { - background: var(--note-list-view-search-result-highlight-background); - color: var(--note-list-view-search-result-highlight-color); - font-weight: 600; - text-decoration: underline; - } -} /* Note content preview */ .nested-note-list .note-book-content { @@ -291,13 +296,6 @@ justify-content: center; min-height: 50vh; } - - .ck-find-result { - outline: 2px solid var(--note-list-view-content-search-result-highlight-background); - border-radius: 4px; - background: var(--note-list-view-content-search-result-highlight-background); - color: var(--note-list-view-content-search-result-highlight-color); - } } .note-content-preview:has(.note-book-content:empty) { diff --git a/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx b/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx index dec8934043..2d1c4deb22 100644 --- a/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx +++ b/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx @@ -72,7 +72,7 @@ export function GridView({ note, noteIds: unfilteredNoteIds, highlightedTokens }
{!hasCollectionProperties && } -