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

Speaker dropdown select -v2 #210

Closed
wants to merge 22 commits into from

Conversation

pietrop
Copy link
Contributor

@pietrop pietrop commented Oct 8, 2019

Is your Pull Request request related to another issue in this repository ?

Improving #208, #141 - #141 (comment)

alternative approach to #209, with no external dependencies introduced.

Describe what the PR does

when you click on a speaker label, it could also have an autocomplete dropbdown of the speakers that have already been used.

State whether the PR is ready for review or whether it needs extra work

Ready for review + one small draftJs bug #210 (comment)

Additional context

Initially considered to do an auto complete dropdown as suggested by @scentless-apprentice
and tried to use react-select in this PR #209 to help with that. But then decided to scrap it and use html select element directly, combining it with features from #208

Other considerations
  • auto complete is neat, but perhaps out of scope for a version 1. Based on anecdotal evidence from user interview, it's unlikely the number of speakers per transcripts will exceed 5 at most for the majority of use case, with some edge cases where it could go up to 10 (we are talking about audio/video interview for factual/documentary production).
  • There is also further complications in making content of WrapperBlock editable, I think we set the focus of cursor to be on the text of the editor only, and forgot how we did it, to be able to look into how to tweak that. However using select combined with prompt that is not necessary for a first version.

@pietrop pietrop changed the title Speaker dropdown select 2 Speaker dropdown select -v2 Oct 8, 2019
@pietrop
Copy link
Contributor Author

pietrop commented Oct 8, 2019

Nearly there, just have to figure out one small 🐛
select-speaker

@pietrop
Copy link
Contributor Author

pietrop commented Oct 9, 2019

Feature checklist

  • Can change a speaker by creating a new speaker

select-speaker-2

  • Can change all speakers (with a certain label) by creating a new speaker

select-speaker-3

  • Can change a speaker by choosing from dropdown selection

select-speaker-6

  • Can change all speakers (with a certain label) by choosing from dropdown selection

select-speaker-7

Pietro Passarelli added 2 commits October 9, 2019 11:34
selecting new speaker label propagate change
@pietrop
Copy link
Contributor Author

pietrop commented Oct 9, 2019

1. ✅

All seems good, the features seem to be working as expected.

2. 🐛

However when using select inside the WrapperBlock get an error 🤷‍♂

Uncaught TypeError: Cannot read property 'nodeType' of null
    at editOnInput

I think this is a draftJs problem, see facebookarchive/draft-js#1085

Screenshot 2019-10-09 at 12 38 29

3. 🚀

I've also updated draftJs to the latest version as the console kept complaining that current version of draft uses an older version of React.

@pietrop
Copy link
Contributor Author

pietrop commented Oct 9, 2019

Raised issue facebookarchive/draft-js#2204

@emettely
Copy link
Contributor

Sorry capturing GIFs don't work with licecap (probably to do with Firefox...) :( so having to use old school image capturing.

In a more narrow set up (960) the drop-down seems to disappear.

1 Click speaker

1

2 Drop down menu disappears

2

3 ... but not really

Random guess-clicking shows it's still there.
3

@emettely
Copy link
Contributor

emettely commented Oct 10, 2019

Would be nice to fix

Ordering of string "numbers" is 1, 100, 11, 2

Just capturing this: the ordering of numbers is not the greatest, but this is the nature of treating numbers as strings. As @pietrop said, if people are thinking to only have up to 5 speakers (also assuming that they have real names not numbers), it's not a problem.

Screen Shot 2019-10-10 at 16 08 34

Long speaker names overlap with button

Screen Shot 2019-10-10 at 16 32 29

@pietrop
Copy link
Contributor Author

pietrop commented Oct 10, 2019

via @emettely possible fix to investigate

https://draftjs.org/docs/advanced-topics-block-components.html#recommendations-and-other-notes

If your custom block renderer requires mouse interaction, it is often wise to temporarily set your Editor to readOnly={true} during this interaction. In this way, the user does not trigger any selection changes within the editor while interacting with the custom block. This should not be a problem with respect to editor behavior, since interacting with your custom block component is most likely mutually exclusive from text changes within the editor.

@emettely emettely self-requested a review October 10, 2019 15:42
@emettely emettely added the help wanted Extra attention is needed label Oct 10, 2019
@pietrop pietrop closed this Apr 23, 2020
@pietrop pietrop deleted the speaker-dropdown-select-2 branch April 23, 2020 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants