markm208 / storyteller

Telling stories about how code evolves
MIT License
173 stars 13 forks source link

Unable to comment within playback #6

Closed reZach closed 5 years ago

reZach commented 5 years ago

v. 0.0.8

Steps to reproduce:

  1. Create a new directory
  2. Create an index.html file
  3. Start tracking this directory as a Storyteller project
  4. Begin editing the index.html file
  5. Save index.html
  6. From the VSCode command palette, click Storyteller: Comment
  7. Notice a new tab opens up in an browser with the playback
  8. Type in text and click Add Comment
  9. There is an error in the browser that reads: SyntaxError: The string did not match the expected pattern.
markm208 commented 5 years ago

Can I ask how you created the new directory? Did you use your file explorer or did you do it in VS Code?

reZach commented 5 years ago

I created the new directory in the file explorer.

markm208 commented 5 years ago

Is what you did any different from this video? If so, which part?

zachtest

reZach commented 5 years ago

Ah, I see now. When I was adding a developer to the story, I just typed in my email and not

FirstName LastName Email.

I assume because I only added an email, your pattern matching was unable to pull what it needs and that is why the Add Comment button bugs out.

Edit I am also on OSX here, not sure if that has anything to do with it. Let me try on my Windows side tomorrow to see if I'm able to repro

markm208 commented 5 years ago

Hmmm... even with just an email it worked on my machine. Can you try with your full name and email and see if that makes a difference?

reZach commented 5 years ago

It looks like everything is working as expected in Chrome, but I am unable to add a comment in my Safari browser. Upon a bit of searching it appears you just need to update your selector in this statement to include the closing ] bracket. All other browsers handle this gracefully except Safari.

Change document.querySelectorAll("[class*=beginSelectedCode-")

to document.querySelectorAll("[class*=beginSelectedCode-]")

I would also look globally and add other instances of where this could be the case likewise.

reZach commented 5 years ago

Created a pull request with these changes, see below.

https://github.com/markm208/storyteller/pull/7

markm208 commented 5 years ago

I updated the extension. Can you start up VS Code and accept the update and verify that all is good! Thanks again.

reZach commented 5 years ago

Comments are now added in safari, thanks for merging in the pull request!