Skip to content

TagSpaces is an offline, open source, document manager with tagging support

chore: limit the characters in the document.title property

Ilian Sapundshievb707de7478b0
diff --git a/src/renderer/hooks/OpenedEntryContextProvider.tsx b/src/renderer/hooks/OpenedEntryContextProvider.tsx
index 5514d956f..e4b90cec9 100644
--- a/src/renderer/hooks/OpenedEntryContextProvider.tsx
+++ b/src/renderer/hooks/OpenedEntryContextProvider.tsx
@@ -621,7 +621,12 @@ export const OpenedEntryContextProvider = ({
const locationName = loc ? loc.name : 'TagSpaces'; // TODO get it later from app config
- document.title = fsEntry.name + ' | ' + locationName;
+ const entryNameForTitle =
+ fsEntry.name.length > 40
+ ? fsEntry.name.substring(0, 40) + '...'
+ : fsEntry.name;
+
+ document.title = entryNameForTitle + ' | ' + locationName;
// update history window.location.href - used for shared link generation
updateHistory(