From 593a79e1e19d66339304b23636a0a1c0c04358d2 Mon Sep 17 00:00:00 2001 From: Eddie Abbondanzio Date: Sun, 25 Dec 2022 23:25:21 -0500 Subject: [PATCH] Truncate notes in search (#28) --- src/renderer/components/SidebarSearch.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/renderer/components/SidebarSearch.tsx b/src/renderer/components/SidebarSearch.tsx index 048564f9..d2157f2a 100644 --- a/src/renderer/components/SidebarSearch.tsx +++ b/src/renderer/components/SidebarSearch.tsx @@ -74,7 +74,7 @@ export function SidebarSearch(props: SidebarSearchProps): JSX.Element { }) } > - {n.name} + {n.name} ); }); @@ -195,6 +195,7 @@ const SearchResult = styled.div<{ selected: boolean }>` align-items: center; font-size: 1.4rem; ${px3} + min-width: 0; background-color: ${p => p.selected ? THEME.sidebar.search.selectedResult : ""} !important; @@ -204,6 +205,12 @@ const SearchResult = styled.div<{ selected: boolean }>` } `; +const TruncatedText = styled.div` + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +`; + export function searchNotes(notes: Note[], searchString?: string): Note[] { // Don't bother searching if string is empty or just whitespace if (isBlank(searchString)) {