[BUG] Focus lost in the prompt editing text area onblur
dandv opened this issue · comments
Description
If I edit the prompt and click on another tab, the editing mode will end and the prompt will be Markdown-rendered.
I expect to stay in edit mode, as is the case when I type/edit a prompt in the bottom chat area and click on another tab: when I return to the big-AGI tab, the textarea is still in edit mode.
Device and browser
Firefox 123 on Fedora Linux
Screenshots and more
Willingness to Contribute
- 🙋♂️ Yes, I would like to contribute a fix.
@dandv to fix this, we'll need to have 'save/cancel' button on the prompt editing, and don't really know where to place them on both mobile and desktop (they could be at the top, or bottom, but on mobile they'll be a wide scroll distance away, so blur was the solution.
A more serious bug here: I was in editing mode and pressed Esc to exit editing mode. There WAS a warning but my eyes anticipated it was about losing the changes to the prompt I was editing; instead, all the chats from the beam were lost!
Would the user actually ever want to lose the model outputs in a beam when pressing Esc? There's also no Undo.