Translate-and-adapt: pass stored article id + graceful fallback#1151
Merged
Conversation
…-ending When translating an article already open in the reader, pass its article_id so the backend translates the stored content (the article's URL can be a Zeeguu reader link that readability can't re-fetch). On translation error, ArticleReader now falls back to reading the original instead of silently closing the modal and leaving the user with nothing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
✅ Deploy Preview for voluble-nougat-015dd1 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Summary
Web half of the translate-and-adapt fix. When a user chose Translate to my level on an article open in the reader, the request could fail server-side and the reader silently closed the modal — "nothing happened."
Changes
translateAndAdaptArticleaccepts{ url, articleId }and sendsarticle_id, so the backend can translate the stored article content instead of re-downloading a URL (which fails when the stored URL is a Zeeguu reader link).ArticleReader: on translation error, fall back to reading the original (translations off, since it isn't in the learned language) instead of dead-ending on a closed modal.SharedArticleHandler: pass the detectedarticleIdwhen known, so the share flow also uses stored content.Companion PR
article_id, fixes the 500 crash)Test plan
🤖 Generated with Claude Code