Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "Drafts" to Input #262

Merged
merged 7 commits into from
Mar 13, 2024
Merged

Add "Drafts" to Input #262

merged 7 commits into from
Mar 13, 2024

Conversation

andymandias
Copy link
Collaborator

This PR is to automatically store the contents of the input view, such that non-sent messages will persist when switching between channels/queries/servers. I.e. if I type out a part of a message for a channel, switch to another channel to reference other messages, then when I switch back to the original channel the part of the message that I typed will be restored. Previously, when switching channels the input is cleared and anything that has been typed is lost.

@andymandias andymandias changed the title Add "Drafts" to Buffer Input Add "Drafts" to Input Mar 12, 2024
@casperstorm
Copy link
Member

This looks and feels good, similar to how Discord, Slack and other applications behave.
Didn't really pay too much attention to this before, because I normally run in a split plane without but I welcome this change.
Could you add a entry to CHANGELOG?

@andymandias
Copy link
Collaborator Author

Oops, sorry about that. CHANGELOG entry added.

Happy to provide the single-pane-user perspective.

Copy link
Member

@casperstorm casperstorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll approve, and wait to see if @tarkah has any additional comments.

CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Member

@tarkah tarkah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome as always @andymandias! I've done a little cleanup, mainly removing the unneeded state on input_view::State since we can just update / reference the draft value from our stored history manager -> input widget.

andymandias and others added 5 commits March 13, 2024 08:31
… when switching between channels/queries/servers.
We can use the stored draft data in history::Manager
as the text used by our input view, so we don't need
to also store / update / refrence in the input view
state. This eliminates de-sync risk and cuts out some
unnecessary code.

Also rearranged / renamed things a little.
@casperstorm casperstorm merged commit 7fe42d1 into squidowl:main Mar 13, 2024
1 check passed
@andymandias andymandias deleted the input-draft branch March 15, 2024 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants