Full document, spreadsheet, slideshow, and diagram tooling
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: trash list display, filename on import, title select-all on focus

- Trash: explicitly set display='' when expanded so items are visible
(was hidden from previous render's display=none)
- Import: use filename (minus extension) as document name instead of
"Untitled Document/Spreadsheet"
- Title: select all text on focus when clicking the document title
in both docs and sheets editors

+12 -2
+4
src/docs/main.ts
··· 903 903 } 904 904 loadTitle(); 905 905 906 + titleInput.addEventListener('focus', () => { 907 + (titleInput as HTMLInputElement).select(); 908 + }); 909 + 906 910 let titleSaveTimeout: ReturnType<typeof setTimeout>; 907 911 titleInput.addEventListener('input', () => { 908 912 clearTimeout(titleSaveTimeout);
+4 -2
src/landing.ts
··· 528 528 return; 529 529 } 530 530 531 + trashListEl.style.display = ''; 531 532 let html = '<div class="doc-list">'; 532 533 for (const doc of trashedDocs) { 533 534 const name = doc._decryptedName || 'Encrypted Document'; ··· 697 698 const key = await generateKey(); 698 699 const keyStr = await exportKey(key); 699 700 700 - // Encrypt the default document name 701 - const defaultName = docType === 'doc' ? 'Untitled Document' : 'Untitled Spreadsheet'; 701 + // Use filename (without extension) as the document name 702 + const fileBaseName = file.name.replace(/\.[^.]+$/, ''); 703 + const defaultName = fileBaseName || (docType === 'doc' ? 'Untitled Document' : 'Untitled Spreadsheet'); 702 704 const nameBytes = new TextEncoder().encode(defaultName); 703 705 const { encrypt } = await import('./lib/crypto.js'); 704 706 const encryptedName = await encrypt(nameBytes, key);
+4
src/sheets/main.ts
··· 1512 1512 } 1513 1513 loadTitle(); 1514 1514 1515 + titleInput.addEventListener('focus', () => { 1516 + (titleInput as HTMLInputElement).select(); 1517 + }); 1518 + 1515 1519 let titleSaveTimeout; 1516 1520 titleInput.addEventListener('input', () => { 1517 1521 clearTimeout(titleSaveTimeout);