From 9249a7df557f842dced8b8efa46f6cf8fe94850c Mon Sep 17 00:00:00 2001 From: redatman Date: Wed, 7 Aug 2024 18:22:31 +0800 Subject: [PATCH] Fix: Truncate long note bodies in quick panel The note body in the quick panel was not truncated when it exceeded a certain length, making it difficult to read. This commit truncates the note body to 120 characters and appends an ellipsis if necessary. --- lib/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core.py b/lib/core.py index c0a37d6..c214dbb 100644 --- a/lib/core.py +++ b/lib/core.py @@ -221,7 +221,7 @@ def show_quick_panel(first_sync: bool = False): note, note.title, [ - note.body, + note.body[:120] + "..." if len(note.body) > 120 else note.body, # f"tags: {note.d.tags}", ], # type: ignore f"version:{note.v} | update:{datetime.fromtimestamp(note.d.modificationDate).strftime('%Y-%m-%d %H:%M:%S')}",