Skip to content

fix: BL-15920 reopening with selected script#136

Merged
andrew-polk merged 1 commit intomainfrom
BL-15920_fix_reopen_with_script
Feb 19, 2026
Merged

fix: BL-15920 reopening with selected script#136
andrew-polk merged 1 commit intomainfrom
BL-15920_fix_reopen_with_script

Conversation

@nabalone
Copy link
Collaborator

@nabalone nabalone commented Feb 19, 2026

This change is Reviewable

rawResults.map((r) => r.item),
code
)[0]
? deepStripDemarcation(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like our bracket demarcation (for bolding the substring that matches the query) is specific to our "defaultSearchResultModifier" and I don't like that it is getting baked in everywhere. It keeps tripping me up. If I were starting over I would try to see if we can do it at card render time instead. But here we are, it is already baked in in a lot of places

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And devin has just reported that there is real language data with square brackets...
So we should definitely look into revamping this...


components/language-chooser/common/find-language/searchForLanguage.ts:R114-119

deepStripDemarcation uses bracket characters that exist in real language data

The demarcation markers [ and ] (defined in matchingSubstringDemarcation.ts:5-6) are stripped from ALL string fields by deepStripDemarcation. Two entries in languageData.json contain legitimate brackets: Hebrew (heb) has a name ivrít ḥadašá[h] and Khalaj (kjf) has exonym Khalaj [Indo-Iranian]. When getLanguageBySubtag is called with a searchResultModifier for either of these languages, deepStripDemarcation at searchForLanguage.ts:114 would corrupt those fields (e.g., Khalaj Indo-Iranian instead of Khalaj [Indo-Iranian]). This is a pre-existing design issue with the marker choice rather than a bug introduced by this PR, but it's now surfaced in a new code path.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do that separately? It would be pretty invasive; I recommend we put this current PR into 6.2 but don't put a redo of the demarcation system into 6.2

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, definitely separate

Copy link
Contributor

@andrew-polk andrew-polk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andrew-polk reviewed 2 files and all commit messages, made 1 comment, and resolved 1 discussion.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on nabalone).

rawResults.map((r) => r.item),
code
)[0]
? deepStripDemarcation(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, definitely separate

@andrew-polk andrew-polk merged commit b682412 into main Feb 19, 2026
2 checks passed
@andrew-polk andrew-polk deleted the BL-15920_fix_reopen_with_script branch February 19, 2026 18:16
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.

2 participants