Repository navigation
Restore the Translate to English right-click command #61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
efdebeb
Parse and register the Translate to English message command again
lhr0909 fa6abfe
Translate the selected customer message into English and post it as a…
lhr0909 5d81ac2
Docs: Translate to English is back; there is no /translate
lhr0909 486a613
Test that Translate to English keeps a language the operator named
lhr0909 8835fe0
Let detection only fill an unknown customer language, never replace one
lhr0909 1e454ba
Docs: detection never replaces a named customer language
lhr0909 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P1] Preserve an operator-named language when translating a newer customer message
This new command calls
requestMessageTranslation, which reachesTranslationWorkflow.save. The existing update atapps/api/src/workflows/translation.ts:126only compares timestamps. An operator can select Spanish with/reply translate:es, then receive a newer Hindi customer message and invoke this command. The translation changesthread.customer_languagefromestohi, so subsequent/reply translate:customerand default draft approvals use Hindi. This violates RK-7's explicit requirement that translation never overwrite a language an operator named.Keep explicit language choices authoritative and add a regression covering an explicit choice followed by a newer customer message and this menu action. The save SQL predates the PR, but restoring this entry point exposes it through the new user flow.
Reproduced at this head against
wrangler dev --local: before{customer_language:"es", customer_language_updated_at:1792328152338}, after{customer_language:"hi", customer_language_updated_at:1792328155344}. Runtime evidence, walkthrough script.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed: 486a613 adds the regression (an operator-named
es, then Translate to English on a newer Hindi message; it failed withhi), and 8835fe0 makesTranslationWorkflow.savefillthread.customer_languageonly while it is NULL, so detection never replaces a named language. I re-ran your walkthrough against 1e454ba: "operator language preserved" shows es before and after, and all its other cases pass. I didn't add a column recording where the language came from, because that is a D1 migration. Tradeoff: a detected language also stays fixed until an operator names another one.