feat: add snippet sorting by size and update help section with sorting instructions

This commit is contained in:
2025-10-17 00:49:00 +03:00
parent e2b4b77478
commit 02fcfc1833
3 changed files with 13 additions and 1 deletions

View File

@@ -225,6 +225,12 @@ const SnippetStorage = {
case 'created':
comparison = new Date(a.created) - new Date(b.created);
break;
case 'size':
// Calculate size for both snippets
const sizeA = new Blob([JSON.stringify(a)]).size;
const sizeB = new Blob([JSON.stringify(b)]).size;
comparison = sizeA - sizeB;
break;
case 'modified':
default:
comparison = new Date(a.modified) - new Date(b.modified);