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

Bring back oak and phenio (text annotator) #497

Merged
merged 23 commits into from
Dec 15, 2023

Conversation

vincerubinetti
Copy link
Contributor

@vincerubinetti vincerubinetti commented Dec 11, 2023

Closes #234

Copy link

netlify bot commented Dec 11, 2023

Deploy Preview for monarch-app ready!

Name Link
🔨 Latest commit a4cadf5
🔍 Latest deploy log https://app.netlify.com/sites/monarch-app/deploys/657b277a87d6380008ddef54
😎 Deploy Preview https://deploy-preview-497--monarch-app.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@glass-ships
Copy link
Collaborator

@vincerubinetti @madanucd:

Madan has updated the backend to provide the proper format, tested locally and integrates with the frontend nicely, I'll add some fixture data tomorrow.

One thing I noticed - the API doesn't know how to handle line breaks.
Can (should) we strip newlines from input content before making the API request?
Should the API be adjusted to keep newlines?

@vincerubinetti
Copy link
Contributor Author

For best UX, I think newlines should be preserved. Imagine uploading several separated paragraphs, then getting back a long blob of text. Harder to find the start of sections you want to look at.

I could do some work-arounds and trickery to remember the newlines and re-insert them after the response, but I think it'd be better to have the backend preserve the newlines (and any whitespace in general).

@glass-ships
Copy link
Collaborator

yeah i think that makes sense too. sweet, we'll look at getting that functionality into the backend!

@glass-ships
Copy link
Collaborator

image

So i'm ... closer? but clearly <br> was the wrong thing to use. @vincerubinetti What should i have in { "text": ??? } for newlines?

@vincerubinetti
Copy link
Contributor Author

vincerubinetti commented Dec 13, 2023

<br> is the right tag, it's just that Vue (and any other framework) will escape HTML by default if you just pass it as text. You'd have to use v-html for that. But that sort of defeats the purpose of what we're trying to do here.

The results get shown in a <p class="results"> which has white-space: pre-line, which means it will respect white space. So, you should just need to put new line \n characters there, which is also what should be being passed to the backend through the multi-line textbox.

@vincerubinetti
Copy link
Contributor Author

vincerubinetti commented Dec 13, 2023

See line 604 in the text-annotator.json fixture in this branch for an example.

And the mock on the pr preview:

https://deploy-preview-497--monarch-app.netlify.app/explore?mock=true#text-annotator

@kevinschaper kevinschaper merged commit 7c0ce2b into main Dec 15, 2023
9 checks passed
@kevinschaper kevinschaper deleted the bring-back-oak-and-phenio branch December 15, 2023 18:13
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.

Update text annotation capabilities for Monarch App
4 participants