Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Thumbnail.tsx, useDocument.ts, DocumentManager.ts, index.ts): ad…
…d DocumentMetadata type and generateWhiteboardName function feat(locales): add new fields for document name and metadata in English and French locales The DocumentMetadata type was added to handle additional metadata for documents, such as the document name. The generateWhiteboardName function was created to generate random, creative names for new whiteboards. This enhances user experience by providing unique, auto-generated names for each new document. The locales were updated to include new fields for document name and metadata in both English and French, ensuring that these new features are properly localized. feat(DocumentList.tsx): refactor List component to use DocumentItem component for better code organization feat(DocumentList.tsx): use useDocument hook to fetch document data for better data handling style(DocumentList.tsx): change navbar background color to bg-base-200/50 for better visibility The List component has been refactored to use a new DocumentItem component. This change improves code organization and readability by separating the concerns of the list and individual document items. The useDocument hook is now used to fetch document data, which improves data handling and allows for more efficient updates. The navbar background color has been changed to bg-base-200/50 to improve visibility and user experience. feat(ShareModal.tsx): add support for document metadata in ShareModal refactor(ShareModal.tsx): change allowedClients to allowedClientKeys for better semantics refactor(DocumentRegistry.ts): add support for document metadata in DocumentRegistry The changes in ShareModal.tsx allow users to view and edit document metadata, providing more context about the document. The renaming of allowedClients to allowedClientKeys in ShareModal.tsx improves the semantics of the code, making it clearer that these are keys, not client objects. The changes in DocumentRegistry.ts allow the creation and retrieval of documents with metadata, enhancing the functionality of the DocumentRegistry. feat(DocumentSharingClient.ts, Document.ts): add support for Metadata type in Document and DocumentSharingClient The changes introduce support for a Metadata type in the Document and DocumentSharingClient classes. This allows for more flexibility and extensibility in handling documents, as additional metadata can now be associated with each document. This can be useful for storing additional information about the document, such as its creation date, author, or other relevant data. refactor(DocumentHeader.ts): streamline import statements for better readability feat(DocumentHeader.ts): add metadata field to DocumentHeaderData type for additional data storage The import statements have been refactored into a single line for better readability and to reduce clutter. A new field, 'metadata', has been added to the DocumentHeaderData type. This allows for the storage of additional, flexible data associated with a document, enhancing the versatility of the document handling system. refactor(DocumentHeader.ts): enhance DocumentHeader class with improved semantics and functionality The DocumentHeader class has been refactored to improve semantics and functionality. The class now includes a helper function to validate and convert an array of client keys. The constructor has been updated to compute fields and freeze objects for better immutability. The update method has been added to create a new DocumentHeader with provided metadata and allowed clients. The verifyOwnerPrivateKey method has been added to verify the owner's private key. The create method has been updated to create a new instance of DocumentHeader with provided private key, allowed clients, and metadata. The import method has been added to construct a DocumentHeader instance from binary data. This refactoring enhances the readability, maintainability, and functionality of the DocumentHeader class. refactor(DocumentHeader): replace import method with upgrade method for better version handling The import method was replaced with an upgrade method to better handle version changes in DocumentHeader. This change allows for compatibility checks between old and new headers, and throws an error if they are not compatible. If the versions are the same, the new header is returned. Otherwise, a new DocumentHeader instance is created with the new data and signature. This change improves the robustness of the code when dealing with different versions of DocumentHeader. refactor(DocumentHeader.ts): remove upgrade method from DocumentHeader class The upgrade method was removed from the DocumentHeader class because it was not being used and was adding unnecessary complexity to the code. This change simplifies the DocumentHeader class and makes it easier to maintain. feat(ddnet): add DocumentHeader to exports in index.ts feat(ddnet): introduce ConcurrencyLimiter in utils.ts refactor(Storage.ts): enhance loadBinary method to handle loading failures The DocumentHeader is now exported from index.ts to make it accessible for other modules. A new ConcurrencyLimiter class is introduced in utils.ts to limit the execution of a certain number of tasks at the same time. This is useful to prevent overloading the system with too many concurrent tasks. The loadBinary method in Storage.ts is refactored to handle loading failures more gracefully. If loading the full document fails, it tries to discard one chunk at a time from the end until successful. If loading is successful after discarding, it saves a fresh version with cleared chunks. This approach ensures that the application can recover from loading failures and continue to function correctly.
- Loading branch information
c47cce4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
describble – ./
describble-git-main-maxscharwath.vercel.app
describble.vercel.app
describble-maxscharwath.vercel.app
describble.io