-
-
Notifications
You must be signed in to change notification settings - Fork 829
Conversation
…atrix-react-sdk into langleyd/rte_drafts
@@ -154,6 +182,52 @@ export class MessageComposer extends React.Component<IProps, IState> { | |||
SettingsStore.monitorSetting("feature_wysiwyg_composer", null); | |||
} | |||
|
|||
private get editorStateKey(): string { | |||
let key = `mx_wysiwyg_state_${this.props.room.roomId}`; |
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.
Given there's no code to clean up drafts from rooms which you are no longer in can we move it to IDB where we have less space pressure?
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.
@t3chguy IDB appears to be a bit slower for small values than localstorage and because it's async setting the initial content outside of the constructor makes the initialisation of the editor feel a bit slow/janky. And introduced a weird issue where the initial text is sometimes selected.
Maybe we could stick with localstorage for consistency between it and CIDER but then look to add the cleanup for both? Is it just clearing the data when we leave or are kicked from a room?
Any other ideas?
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.
It'd have to be a periodic scan comparing the drafts stored vs known rooms at a known good client state, as the client may not receive kicks/leaves depending on if the room was forgotten via another client before it syncs
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.
Added
…atrix-react-sdk into langleyd/rte_drafts
This introduced a flaky test, and failed in the merge queue. @florianduros Is going to take a look at it next week. |
…atrix-react-sdk into langleyd/rte_drafts
What's container in the PR
Add drafts to the rich text editor so that changing rooms or closing the browsers saves/restores the message typed in the composer.
Supports:
How it looks:
Screen.Recording.2024-06-25.at.15.25.20.mov