Skip to content

Add translation search highlights#785

Draft
philmcmahon wants to merge 8 commits into
mainfrom
add-highlights
Draft

Add translation search highlights#785
philmcmahon wants to merge 8 commits into
mainfrom
add-highlights

Conversation

@philmcmahon

Copy link
Copy Markdown
Contributor

What does this change?

This PR wires in the various bits and pieces needed to show highlights for search results from inside translated text.

As part of this work I've ended up abandoning the dropdown switcher for viewing translations introduced in #780 and instead made the translation views just more tabs in the bottom right. I think the UX here could use some work (as you can get a lot of tabs) but didn't want to put time into dealing with highlights and url query syncing for the translation viewer as part of this bit of work, instead putting it off for some future UX overhaul (hopefully post full typescriptification).

Depends on #783 which should be merged and rebased into this before this is reviewed - it was too awkward working with a js PreviewSwitcher.

The main changes:

  • new HighlightableLanguageData which has HighlightableText instead of just string types (the standard LanguageData type is used for to/from elasticsearch, HighlightableLanguageData is constructed based off search results from elastic
  • New 'translated body text' chip - we currently don't have an OCR text chip so I just did body text for now. (Pending @hoyla's mega chips overhaul)
  • Various helper functions for digging out the heavily nested languageData.text.translation field
2026-07-16 17 20 42

How has this change been tested?

  • Tested locally
  • Tested on playground

@philmcmahon philmcmahon added the feature Departmental tracking: work on a new feature label Jul 16, 2026
@philmcmahon philmcmahon changed the title Add highlights Add translation search highlights Jul 16, 2026
@philmcmahon philmcmahon self-assigned this Jul 16, 2026
Base automatically changed from translation-extractor to main July 21, 2026 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Departmental tracking: work on a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants