From f2067d0b12f78997ca369ecc7f96cd53f1d170a9 Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Tue, 10 Dec 2024 21:43:23 +0200 Subject: [PATCH 1/7] client: refactor --- src/public/app/services/tree.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/public/app/services/tree.js b/src/public/app/services/tree.js index 2726036b9..e367c3586 100644 --- a/src/public/app/services/tree.js +++ b/src/public/app/services/tree.js @@ -272,8 +272,16 @@ async function getNoteTitleWithPathAsSuffix(notePath) { const $titleWithPath = $('') .append($('').text(title)); + + $titleWithPath.append(formatPath(path)); + + return $titleWithPath; +} + +function formatPath(path) { + const $notePath = $(''); + if (path.length > 0) { - const $notePath = $(''); $notePath.append($(` ()`)); @@ -286,17 +294,17 @@ async function getNoteTitleWithPathAsSuffix(notePath) { } $notePath.append($(`))`)); - - $titleWithPath.append($notePath); } - - return $titleWithPath; + + return $notePath; } function isNotePathInHiddenSubtree(notePath) { return notePath?.includes("root/_hidden"); } + + export default { resolveNotePath, resolveNotePathToSegments, From 0588c91d1d3029b8d22cbeca2168a360cbf1983e Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Tue, 10 Dec 2024 21:49:42 +0200 Subject: [PATCH 2/7] client: refactor --- src/public/app/services/tree.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/public/app/services/tree.js b/src/public/app/services/tree.js index e367c3586..e8423b391 100644 --- a/src/public/app/services/tree.js +++ b/src/public/app/services/tree.js @@ -273,12 +273,12 @@ async function getNoteTitleWithPathAsSuffix(notePath) { .append($('').text(title)); - $titleWithPath.append(formatPath(path)); + $titleWithPath.append(formatNotePath(path)); return $titleWithPath; } -function formatPath(path) { +function formatNotePath(path) { const $notePath = $(''); if (path.length > 0) { @@ -316,5 +316,6 @@ export default { getNoteTitle, getNotePathTitle, getNoteTitleWithPathAsSuffix, - isNotePathInHiddenSubtree + isNotePathInHiddenSubtree, + formatNotePath }; From 2b36bde9a9f85959ca3b7e5527a0351cd85eea1b Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Tue, 10 Dec 2024 22:24:53 +0200 Subject: [PATCH 3/7] client: format the note paths displayed in the note links --- src/public/app/services/link.js | 14 +++++++------- src/public/app/services/tree.js | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/public/app/services/link.js b/src/public/app/services/link.js index 30d30594d..b7e236be5 100644 --- a/src/public/app/services/link.js +++ b/src/public/app/services/link.js @@ -102,15 +102,15 @@ async function createLink(notePath, options = {}) { $container.append($noteLink); if (showNotePath) { - const resolvedNotePathSegments = await treeService.resolveNotePathToSegments(notePath); + const resolvedPathSegments = await treeService.resolveNotePathToSegments(notePath); + resolvedPathSegments.pop(); // Remove last element - if (resolvedNotePathSegments) { - resolvedNotePathSegments.pop(); // remove last element + const resolvedPath = resolvedPathSegments.join("/"); + const pathSegments = await treeService.getNotePathTitleComponents(resolvedPath); - const parentNotePath = resolvedNotePathSegments.join("/").trim(); - - if (parentNotePath) { - $container.append($("").text(` (${await treeService.getNotePathTitle(parentNotePath)})`)); + if (pathSegments) { + if (pathSegments.length) { + $container.append($("").append(treeService.formatNotePath(pathSegments))); } } } diff --git a/src/public/app/services/tree.js b/src/public/app/services/tree.js index e8423b391..1178106e0 100644 --- a/src/public/app/services/tree.js +++ b/src/public/app/services/tree.js @@ -310,6 +310,7 @@ export default { resolveNotePathToSegments, getParentProtectedStatus, getNotePath, + getNotePathTitleComponents, getNoteIdFromUrl, getNoteIdAndParentIdFromUrl, getBranchIdFromUrl, From 431522f5b11095774a63069ba88ce07975cc2944 Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Tue, 10 Dec 2024 23:02:15 +0200 Subject: [PATCH 4/7] style(next): apply style to all note paths, change the delimiter symbol --- src/public/stylesheets/theme-next/shell.css | 43 +++++++++++---------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/src/public/stylesheets/theme-next/shell.css b/src/public/stylesheets/theme-next/shell.css index 2ddfebc8c..239201866 100644 --- a/src/public/stylesheets/theme-next/shell.css +++ b/src/public/stylesheets/theme-next/shell.css @@ -937,27 +937,6 @@ body .calendar-dropdown-widget .calendar-body a:hover { } -.note-tooltip-content .note-title-with-path .path-bracket { - /* Hide the leading and trailing bracket from the path */ - display: none; -} - -.note-tooltip-content .note-title-with-path .path-delimiter { - /* Hide the path delimiters (slashes) */ - display: none; -} - -.note-tooltip-content .note-title-with-path .path-delimiter + span::before { - /* Replace the path delimiters with arrows */ - display: inline-block; - content: "\ebe6"; - padding: 0 4px; - line-height: 1; - vertical-align: bottom; - font-family: boxicons; - opacity: .75; -} - .note-tooltip-content .note-path { display: block; color: var(--muted-text-color); @@ -1190,4 +1169,26 @@ body .calendar-dropdown-widget .calendar-body a:hover { .note-list.grid-view .ck-content figure.image { width: 25%; +} + +/* Note paths */ + +.note-path .path-bracket { + /* Hide the leading and trailing bracket from the path */ + display: none; +} + +.note-path .path-delimiter { + /* Hide the path delimiters (slashes) */ + display: none; +} + +.note-path .path-delimiter + span::before { + /* Replace the path delimiters with arrows */ + display: inline-block; + content: "\ed3b"; + padding: 0 .25em; + font-family: boxicons; + opacity: .75; + transform: translateY(4%); } \ No newline at end of file From 5523e30583541ff16367af12ecd8912796ca3324 Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Tue, 10 Dec 2024 23:08:10 +0200 Subject: [PATCH 5/7] style(next): tweak the note paths from the "Recent Changes" section --- src/public/stylesheets/theme-next/shell.css | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/public/stylesheets/theme-next/shell.css b/src/public/stylesheets/theme-next/shell.css index 239201866..e7dcbacbc 100644 --- a/src/public/stylesheets/theme-next/shell.css +++ b/src/public/stylesheets/theme-next/shell.css @@ -1001,6 +1001,12 @@ body .calendar-dropdown-widget .calendar-body a:hover { position: relative; } +.recent-changes-content ul li .note-path { + margin-left: .5em; + color: var(--muted-text-color); +} + + /* Timeline connector */ .recent-changes-content ul li::before, .recent-changes-content > div > b::before { From 0a02c2538c8ca3d360c692a8eaf8051cc0b7db7d Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Wed, 11 Dec 2024 22:26:19 +0200 Subject: [PATCH 6/7] style(next): use a better layout for the paths displayed in the "Recent Changes" section --- src/public/stylesheets/theme-next.css | 1 + src/public/stylesheets/theme-next/shell.css | 35 +++++++++++++++++---- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/public/stylesheets/theme-next.css b/src/public/stylesheets/theme-next.css index 2c0b089c7..fe410689a 100644 --- a/src/public/stylesheets/theme-next.css +++ b/src/public/stylesheets/theme-next.css @@ -62,6 +62,7 @@ --timeline-left-gap: 20px; --timeline-right-gap: 20px; + --timeline-item-vertical-margin: 4px; --timeline-bullet-size: 10px; --timeline-bullet-vertical-pos: .75em; --timeline-connector-size: 4px; diff --git a/src/public/stylesheets/theme-next/shell.css b/src/public/stylesheets/theme-next/shell.css index e7dcbacbc..14f688ab9 100644 --- a/src/public/stylesheets/theme-next/shell.css +++ b/src/public/stylesheets/theme-next/shell.css @@ -964,10 +964,6 @@ body .calendar-dropdown-widget .calendar-body a:hover { margin: var(--bs-modal-padding); } -.recent-changes-content small { - color: var(--muted-text-color); -} - .recent-changes-content > div { padding-left: var(--timeline-left-gap); } @@ -999,13 +995,40 @@ body .calendar-dropdown-widget .calendar-body a:hover { .recent-changes-content ul li { position: relative; + color: transparent; /* Hide the "-" character */ + padding-top: var(--timeline-item-vertical-margin); + padding-bottom: var(--timeline-item-vertical-margin); +} + +.recent-changes-content ul li span { + /* Ensure spans are not transparent */ + color: var(--active-item-text-color); } .recent-changes-content ul li .note-path { - margin-left: .5em; color: var(--muted-text-color); + font-size: .75em; } +/* Item time */ +.recent-changes-content ul li > span:first-child { + display: inline-block; + min-width: 80px; + vertical-align: top; + color: var(--active-item-text-color); +} + +/* Item title & path container */ +.recent-changes-content ul li > span:nth-child(2) { + display: inline-block; +} + +/* Item path */ +.recent-changes-content ul li > span:nth-child(2) small { + display: block; + line-height: 1; + opacity: .75; +} /* Timeline connector */ .recent-changes-content ul li::before, @@ -1040,7 +1063,7 @@ body .calendar-dropdown-widget .calendar-body a:hover { .recent-changes-content ul li::after { position: absolute; content: ""; - top: var(--timeline-bullet-vertical-pos); + top: calc(var(--timeline-item-vertical-margin) + var(--timeline-bullet-vertical-pos)); left: 0; width: var(--timeline-bullet-size); height: var(--timeline-bullet-size); From 5126cd4a6c660ba194f749a60cafc69c32319bf9 Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Wed, 11 Dec 2024 22:30:04 +0200 Subject: [PATCH 7/7] style(next): tweak the paths displayed in the search section --- src/public/stylesheets/theme-next/shell.css | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/public/stylesheets/theme-next/shell.css b/src/public/stylesheets/theme-next/shell.css index 14f688ab9..8291ee49d 100644 --- a/src/public/stylesheets/theme-next/shell.css +++ b/src/public/stylesheets/theme-next/shell.css @@ -1220,4 +1220,15 @@ body .calendar-dropdown-widget .calendar-body a:hover { font-family: boxicons; opacity: .75; transform: translateY(4%); +} + +/* Search */ + +.search-result-widget-content .note-path .path-bracket { + display: inline; +} + +.search-result-widget-content .note-path { + opacity: .75; + font-weight: normal; } \ No newline at end of file