Make sidebar resizable, support restore operations and make UI polishes. - #63
Merged
Conversation
Previously, getCloudDocument fetched document details by default without specifying includeTrashed parameter, and restoring a document did not correctly clear the local indexedDB database's metadata columns for trash state (deletedAt and purgeAt) if the document existed locally. Now, modify getCloudDocument to accept includeTrashed as a parameter (which defaults to true), appending the query string when appropriate. In restoreCloudDocumentFromTrash, attempt to update local metadata if the document exists in the local database. Also, clean up unused index definitions in Flyway V4 schema migration.
Previously, the useDocument hook did not expose a restore method to undelete a document, did not sync local state when a document was restored externally (e.g. from the sidebar), and did not restrict cloud metadata syncing when a document was in the trash. Now, add a restore callback to useDocument that calls the document service, clears the deletedAt / purgeAt metadata fields, and updates access level/cache to OWNER. Set up event listeners for documents changed events to automatically update the Redux state and access level to OWNER when an external restore happens.
Now, render a notice banner in the DocToolbar top-right when the document is trashed, offering a "Restore" link to undo deletion. In the Editor, wire up the restore action from the hook, make the document read-only when trashed, and clean up access level checks for guest views.
Previously, the sidebar had a fixed width of 256px that could not be customized. Document action flows in the trash panel required opening the standard document actions dropdown, and various items had a larger border radius (rounded-lg). Now, implement click-and-drag resizing of the sidebar between 256px and 480px, storing the user's preference in localStorage. Apply visual design polish to use rounded-sm instead of rounded-lg for sidebar buttons and popup menu items.
Previously, the Comments icon and Globe icon had non-standard scaling and stroke weights compared to other toolbar icons. The SharePanel button text used a semibold font weight, and some buttons had slightly inconsistent padding. Now, update the Comments icon size to 18px with 1.75 strokeWidth, and the Globe icon size to 16px. Polish padding for buttons in DocToolbar to align icons and text neatly, and set the SharePanel save button font weight to medium -- eventhough the "Done" button has a semibold font weight, this makes it look similar to the "Done" button.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make Ui polishes in the docToolbar icon sizes, padding & button weight and make the sidebar's width resizable by dragging, also fixed the corners were too much rounded in the sidebar elements.
Add trash banner and restrict editing for deleted documents -- and change the access level to OWNER and allow editing upon restoring.