-
Notifications
You must be signed in to change notification settings - Fork 33
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
fix: Creating a new paragraph at the end of an existing one #40
Conversation
Currently this errors because `wordsAfter.length==0`
Good catch, thank you soo much for trying this out @jshearer ! 🙌 I am sure this happens. But I can't reproduce in the storybook version at https://pietropassarelli.com/slate-transcript-editor so a bit more details context around the example when that happens would be useful to narrow it down/reproduce. oh, Is this issue on I am leaning towards not allowing to hit enter at the end of a paragraph. Coz that would create an empty paragraph and mess up the whole paragraph/block level alignment thing. If that makes sense? Unless I am missing a scenario where that might be useful? |
Interesting, I can't reproduce it there either... I am actually using the tip of the |
I was able to repelicate the issue by chance
Used in pietrop/digital-paper-edit-firebase with GCP STT in Italian language (not that, that's relevant for the issue, but just for context in case it turns out that it is) |
one thing I noticed in firebase/firestore is that my last paragraph does not have a startime. @jshearer are you using GCP STT as well with pietrop/gcp-to-dpe adapter? |
ok try with It doesn't fix this issue #40 (comment) but that might be a problem with the adapter. Looking into it. |
This might fix my problem pietrop/gcp-to-dpe#7 but not 100% sure fixes the overall probl. |
Hopefully this is more substantial to address this issue #42 by refactoring the function to generate previous timings for the words highlighting (via css injection) so that it doesn't rely on actual timings of the words but just does a list of int up to the "current time" this should remove one more possible arbitrary point of failure. |
@jshearer There's a new release |
|
👋 @jshearer Thanks for looking into it, and for closing the issue. Not allowing to insert a blank paragraph is by design. To constraint the edge cases to handle in the attempt to preserve accurate word level timecodes. But let me know if you have an example of when you'd need to insert a blank paragraph? This generally assumes that the STT is decent at the very least at recognizing the majority of the utterances and therefore the times for those could be preserved / used as a starting point alignment and restoring timecodes for accurate/corrected word's text. Curious whether there might be an edge case I haven't considered yet. |
Currently, trying to add a paragraph by pressing enter with the cursor at the end of an existing paragraph fails with the following error:
Which is actually this line:
slate-transcript-editor/src/components/slate-helpers/handle-split-paragraph/index.js
Line 65 in 0607306
because there are no words after the cursor in the current paragraph.
Describe what the PR does
I figured that a decent solution would be to just take the end time of the most recent previous word. Thooghts?
State whether the PR is ready for review or whether it needs extra work
Ready!