Skip to content

Fix translate button not working#6657

Merged
gaearon merged 2 commits into
bluesky-social:mainfrom
auroursa:fix-translate-button
Nov 23, 2024
Merged

Fix translate button not working#6657
gaearon merged 2 commits into
bluesky-social:mainfrom
auroursa:fix-translate-button

Conversation

@auroursa
Copy link
Copy Markdown
Contributor

@auroursa auroursa commented Nov 23, 2024

Based on #6289

Fix #6287
Fix #6446

Sorry I know this is a bit repetitive, but I’m trying to provide more explanation in this PR. I've encountered this issue frequently over the past few days.

Thanks to @surfdude29’s comment, made me realize that there is a behavioral difference between clicking "Translate" in the post context menu and directly clicking the translate button under the post, so I started investigating this.

In #6084, to fix the a11y issue, we replaced <NewText> with <InlineLinkText>, which introduced to="#". But this breaks the translation and redirects the user to the homepage.

I absolutely respect the a11y fix, so I won’t revert this change. Replacing onPress={onTranslatePress} with to={translatorUrl} seems like the right approach. After removing onPress here, it will no longer be used elsewhere, so it can be safely removed import.

After testing, the translation button will work again.

test.mp4

@gaearon
Copy link
Copy Markdown
Contributor

gaearon commented Nov 23, 2024

I'm still not able to reproduce this.

Comment thread src/view/com/post-thread/PostThreadItem.tsx Outdated
@gaearon
Copy link
Copy Markdown
Contributor

gaearon commented Nov 23, 2024

OK, I can repro it on web at least

@gaearon gaearon force-pushed the fix-translate-button branch from c8da126 to 8dd11d2 Compare November 23, 2024 17:19
@gaearon
Copy link
Copy Markdown
Contributor

gaearon commented Nov 23, 2024

Slightly tweaked the fix. Couldn't repro the original issue outside web but I think this should work.

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.

Timeline scroll reset when going back from translation After clicking the 'Translate' button, Bluesky will returns to the home page

2 participants