order spans by their start index, return start index to the UI#259
Merged
order spans by their start index, return start index to the UI#259
Conversation
liujch1998
approved these changes
Mar 27, 2025
mtblanton
added a commit
to allenai/olmo-ui
that referenced
this pull request
Mar 27, 2025
## Description Closes allenai/playground-issues-repo#156 Depends on allenai/olmo-api#259 This PR fixes the overlapping span issue. The issue was caused by two things: * Our regex was global, making it replace every instance of a span instead of just the first * Our regex didn't match the current state of attribution highlights, which now use HTML elements instead of Markdown directives. I've addressed both of those issues in this PR. ## Testing Plan Tested locally. Added mocks for a response that has this problem. ## Output / Screenshots ### Before I forgot to take a screenshot of the before state of the test response I have and it's hard to get now so you'll have to trust me on this one ### After 
mtblanton
added a commit
that referenced
this pull request
Jun 13, 2025
Addresses allenai/playground-issues-repo#156 This PR ensures that spans are sorted by their `start_index` (left) before being returned to the UI. This allows the UI to iterate through the spans one at a time, only adding highlights for the first span. It also returns the `start_index` to the UI. That's not essential, but may be nice in the future or while debugging!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses https://github.com/allenai/playground-issues-repo/issues/156
This PR ensures that spans are sorted by their
start_index(left) before being returned to the UI. This allows the UI to iterate through the spans one at a time, only adding highlights for the first span.It also returns the
start_indexto the UI. That's not essential, but may be nice in the future or while debugging!