Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Restore Composer History under shift-up & down #3098

Merged
merged 4 commits into from
Jun 18, 2019

Conversation

t3chguy
Copy link
Member

@t3chguy t3chguy commented Jun 12, 2019

Fixes element-hq/element-web#9977

Shift-up is imperfect as spamming shift-up will not go up multiple history entries as it'll highlight a line in your history instead, maybe an alternative modifier would be better

Signed-off-by: Michael Telatynski [email protected]

@turt2live turt2live requested a review from a team June 12, 2019 21:20
@bwindels bwindels requested review from bwindels and removed request for a team June 13, 2019 14:06
Copy link
Contributor

@bwindels bwindels left a comment

Choose a reason for hiding this comment

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

Code looks good, but agree shift+up is suboptimal as it'll select the line, at which point you need to deselect the line to go back another step... wdyt @lampholder ?

@bwindels
Copy link
Contributor

So, after some discussion (on the internal room, sorry, should have taken riot-dev) we've decided we can steal the alt+up/down shortcut from moving between rooms, as that is unusable as it is anyway. You want to make that change, or shall I finish it off?

@t3chguy
Copy link
Member Author

t3chguy commented Jun 14, 2019

I will make it within a couple of hours :)

@bwindels
Copy link
Contributor

I will make it within a couple of hours :)

Sure, thanks!

…thub.com:matrix-org/matrix-react-sdk into t3chguy/restore_composer_history

# Conflicts:
#	src/components/views/rooms/MessageComposerInput.js
Copy link
Contributor

@bwindels bwindels left a comment

Choose a reason for hiding this comment

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

thanks for the changes! One suggestion for making onVerticalArrow a bit more readable perhaps.

src/components/views/rooms/MessageComposerInput.js Outdated Show resolved Hide resolved
Signed-off-by: Michael Telatynski <[email protected]>
@t3chguy t3chguy requested a review from bwindels June 15, 2019 14:10
Copy link
Contributor

@bwindels bwindels left a comment

Choose a reason for hiding this comment

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

thanks for the changes! two more things though :)

const selection = this.state.editorState.selection;
if (e.altKey) {
// Try select composer history
const selected = this.selectHistory(up);
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't this also only happen if the selection is collapsed?


// and we must be at the edge of the document (up=start, down=end)
if (up) {
// and we must be at the edge of the document (up=start, down=end)
if (!selection.anchor.isAtStartOfNode(document)) return;

if (!e.altKey) {
Copy link
Contributor

Choose a reason for hiding this comment

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

this is redundant now

@bwindels bwindels merged commit 32840fc into develop Jun 18, 2019
@bwindels
Copy link
Contributor

merged this, as I need to bring the history back as part of feature guarding up-to-edit ...

@t3chguy
Copy link
Member Author

t3chguy commented Jun 18, 2019

Sorry about not having time to bring it up to scratch. I'm future feel free to commit onto my branches to keep the changes consistent. Thanks for taking this on

@bwindels
Copy link
Contributor

Sorry about not having time to bring it up to scratch. I'm future feel free to commit onto my branches to keep the changes consistent. Thanks for taking this on

All good, will do 👍

@t3chguy t3chguy deleted the t3chguy/restore_composer_history branch May 25, 2020 18:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add modifier key to get old up arrow behavior
2 participants