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

Simplified search input & fixed chinese character input #3037

Merged
merged 6 commits into from
Jun 28, 2019

Conversation

AWolf81
Copy link
Contributor

@AWolf81 AWolf81 commented May 25, 2019

Description

  • Reduced complexity in seach input string handling & removed some states
  • Tested chinese character search entry
  • Fixed focus issue that occured if your doing fast typing and backspace delete. That caused the editor area to be focused instead of the search input.

There are mutliple open PRs that are related to search input:

We should check if all of them are fixed with this PR.

Issue fixed

#2925, #3030, #2843

Type of changes

  • 🔘 Bug fix (Change that fixed an issue)
  • ⚪ Breaking change (Change that can cause existing functionality to change)
  • ⚪ Improvement (Change that improves the code. Maybe performance or development improvement)
  • ⚪ Feature (Change that adds new functionality)
  • ⚪ Documentation change (Change that modifies documentation. Maybe typo fixes)

Checklist:

  • 🔘 My code follows the project code style
  • ⚪ I have written test for my code and it has been tested
  • 🔘 All existing tests have been passed
  • ⚪ I have attached a screenshot/video to visualize my change if possible

Screenshot

Note just some chinese letters in there to show that you can now enter these characters
grafik

Todos:

  • Remove state variables isAlphabet, isIME, isConfirmTranslation (if it's OK to simplify this, see question below)
  • Add enter key handling to re-apply search term - handy if you navigate away and you want to use the same search term

Discussion

  • Is it OK to change the search input to not check the character range? I think that check is not really needed and just adds complexity. But please let me know if there is a reason I'm missing or a case that's not working with my change.
  • Please double check the chinese character entry. It should work but it's a bit difficult to test on a German laptop.
  • How can I test if my change to switchPreview === 'BLUR' || switchPreview === 'DBL_CLICK' is working? That change was needed to fix the focus loss but I'm not sure where it is used.
  • Fast typing issue: I'm not sure if it's fixed here because it could be related to notebook size. I have just a few notes and so searching is pretty fast. How can I debug this?

IssueHunt Summary

IssueHunt has been backed by the following sponsors. Become a sponsor

@ZeroX-DG ZeroX-DG added the awaiting review ❇️ Pull request is awaiting a review. label May 25, 2019
@amedora
Copy link
Contributor

amedora commented May 28, 2019

Unfortunately this changes break MS-IME behavior.
I can no longer input Japanese correctly... (tested on Win7/64)
ime

@AWolf81
Copy link
Contributor Author

AWolf81 commented May 28, 2019

Oh, OK, can you please test if the following demo is working for you?
That seems to work & maybe we can use it or implement it directly. What do you think? Is it OK to use that component from npm?

It is using composition events to trigger the change event once the IME is done. I would use it as it's easier to read.

@amedora
Copy link
Contributor

amedora commented May 28, 2019

Oh, OK, can you please test if the following demo is working for you?

works nice 👍
inputdemo

I'm not sure it's ok or not to use that component, but looks good.

@AWolf81
Copy link
Contributor Author

AWolf81 commented May 28, 2019

@amedora can you please give it another try? I've added the composition input.
I have one point in the code where I'm not sure. I'll add an inline comment.

@@ -165,7 +129,7 @@ class TopBar extends React.Component {
}

handleCodeInit () {
ee.emit('top:search', this.refs.searchInput.value)
ee.emit('top:search', this.refs.searchInput.value || '')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why is this emit there? With out adding the || '' I've got an error from CodeEditor.js because it seems that the value is undefined here.
How can I test this?

Copy link
Member

Choose a reason for hiding this comment

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

LGTM. I didn't notice that it can be undefined.

search: keyword
})
ee.emit('top:search', keyword)
const keyword = e.target.value
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here I wanted to use this.refs.searchInput.value but it wasn't working - maybe there is an issue with CInput and the ref but with event.target.value it is woking.
So that's OK and I just wanted to mention it.

@amedora
Copy link
Contributor

amedora commented May 29, 2019

LGTM. works like a charm 👍

@Rokt33r
Copy link
Member

Rokt33r commented Jun 3, 2019

@ZeroX-DG Could you test this too? I want to merge this soon. :)

@ZeroX-DG ZeroX-DG added approved 👍 Pull request has been approved by sufficient reviewers. and removed awaiting review ❇️ Pull request is awaiting a review. labels Jun 9, 2019
@ZeroX-DG
Copy link
Member

ZeroX-DG commented Jun 9, 2019

Works great for me!

@Rokt33r Rokt33r merged commit b4251a7 into BoostIO:master Jun 28, 2019
@Rokt33r Rokt33r removed the approved 👍 Pull request has been approved by sufficient reviewers. label Jun 28, 2019
@Rokt33r Rokt33r added this to the v0.12.0 milestone Jun 28, 2019
@AWolf81 AWolf81 deleted the fix-search-issue-unicode branch June 29, 2019 20:39
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.

4 participants