[WEB-65] [EDITOR] Make blog title editable within editor #374
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.
Why the changes are needed
Currently there is no way to edit a document's filename while inside the editor.
Changes
I took inspiration from Google Docs and made it so that when a user hovers over the filename in the editor, the cursor turns into an I-beam and the title slightly enlarges. This indicates to the user that the title is editable. Then upon clicking, the title visibly becomes a text box which users can write into. Once they are done renaming, they click out of the text box and the new filename is saved :D
File changes summary
frontend/src/cse-ui-kit/EditableTitle_textbox/*
- new component defining the custom text box for the editable file namefrontend/src/packages/editor/index.tsx
- integrated code to support file renaming. Reused code fromfrontend/src/packages/dashboard/components/FileRenderer/Renamable.tsx
to update the redux state to ensure the new file name is propagated globally.Demo
React.App.-.Google.Chrome.2023-06-18.01-40-52.mp4