Skip to content

Feat/shortcut keys to configure browser split screen#1413

Open
JackCmd233 wants to merge 60 commits into
mengxi-ream:mainfrom
JackCmd233:feat/shortcut-keys-to-configure-browser-splitScreen
Open

Feat/shortcut keys to configure browser split screen#1413
JackCmd233 wants to merge 60 commits into
mengxi-ream:mainfrom
JackCmd233:feat/shortcut-keys-to-configure-browser-splitScreen

Conversation

@JackCmd233

@JackCmd233 JackCmd233 commented Apr 28, 2026

Copy link
Copy Markdown

Type of Changes

  • ✨ New feature (feat)
  • 🐛 Bug fix (fix)
  • 📝 Documentation change (docs)
  • 💄 UI/style change (style)
  • ♻️ Code refactoring (refactor)
  • ⚡ Performance improvement (perf)
  • ✅ Test related (test)
  • 🔧 Build or dependencies update (build)
  • 🔄 CI/CD related (ci)
  • 🌐 Internationalization (i18n)
  • 🧠 AI model related (ai)
  • 🔄 Revert a previous commit (revert)
  • 📦 Other changes that do not modify src or test files (chore)

Description

This PR adds a split translator workflow that can be opened from the extension UI and used directly in the side panel.

It includes:

  • a new split translator UI with input, translation result, copy/retry actions, and target language selection
  • shortcut-related improvements, including settings support for viewing/configuring the split translator shortcut and page-level shortcut binding
  • stability fixes for stale validation/detection results, loading states, side panel close handling, and shortcut toggle failures
  • updated i18n copy for the new split translator and shortcut-related UI
  • expanded automated coverage for split translator flows, shortcut settings, navigation helpers, side panel behavior, and config migrations

Overall, these changes make the split translator easier to access, easier to configure, and more reliable during real usage.

Related Issue

Closes #1196

How Has This Been Tested?

  • Added unit tests covering split translator app flows, side panel behavior, shortcut binding/settings, navigation helpers, language detection handling, and config migration
  • Added unit tests
  • Verified through manual testing

Screenshots

Suggested screenshots to attach if needed:

  • split translator side panel UI
  • popup entry for split translator
  • translation settings page with split translator shortcut configuration

Checklist

  • I have tested these changes locally
  • I have updated the documentation accordingly if necessary
  • My code follows the code style of this project
  • My changes do not break existing functionality
  • If my code was generated by AI, I have proofread and improved it as necessary.

Additional Information

Most of the changes in this PR are part of the same split translator delivery thread, so the branch includes feature work, follow-up fixes, i18n updates, and test coverage improvements around the same user flow.

image image image

JackCmd233 and others added 30 commits April 27, 2026 12:48
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@changeset-bot

changeset-bot Bot commented Apr 28, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 567c259

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions Bot added contrib-trust:new PR author trust score is 0-29. needs-maintainer-review Contributor trust automation recommends maintainer review. labels Apr 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Contributor trust score

14/100 — New contributor

This score estimates contributor familiarity with mengxi-ream/read-frog using public GitHub signals. It is advisory only and does not block merges automatically.

Outcome

Score breakdown

Dimension Score Signals
Repo familiarity 0/35 commits in repo, merged PRs, reviews
Community standing 6/25 account age, followers, repo role
OSS influence 3/20 stars on owned non-fork repositories
PR track record 5/20 merge rate across resolved PRs in this repo

Signals used

  • Repo commits: 0 (author commits reachable from the repository default branch)
  • Repo PR history: merged 0, open 1, closed-unmerged 0
  • Repo reviews: 0
  • PR changed lines: 2521 (+2405 / -116)
  • Repo permission: read
  • Followers: 2
  • Account age: 104 months
  • Owned non-fork repos considered: max 2, total 4 (JackCmd233/FlowerShop (2), JackCmd233/LeetCode (2), JackCmd233/ai-code-helper (0), JackCmd233/mcp-mssql (0), JackCmd233/AI_Harness (0), JackCmd233/ChatGPT_Next_Web_Bak (0), JackCmd233/GPT_cloudflare (0), JackCmd233/chatgpt-on-wechat (0), JackCmd233/wechat-chatgpt (0), JackCmd233/ChatGPT-Web (0), JackCmd233/ChatGPT_Web_Bak (0), JackCmd233/WechatBot (0), JackCmd233/img (0), JackCmd233/Java8 (0), JackCmd233/CMDEGR_Index (0), JackCmd233/china_ip_list (0), JackCmd233/cmdegr.github.io (0))

Policy

  • Low-score review threshold: < 30
  • Auto-close: score < 20 and changed lines > 1000
  • Policy version: v1.1

Updated automatically when the PR changes or when a maintainer reruns the workflow.

@github-actions github-actions Bot closed this Apr 28, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b0a6e3d0b4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +10 to +12
source: "extension-user-action",
windowId: browser.windows.WINDOW_ID_CURRENT,
}))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Resolve a real window ID before toggling from popup

Passing browser.windows.WINDOW_ID_CURRENT here sends -2, but the background toggle logic stores open state in createSidePanelWindowState keyed by the provided windowId. Because -2 is reused for every window, state becomes cross-window and the first toggle in another window can be misclassified as already open (leading to a close/no-op/unsupported path instead of opening). Use the concrete current window id (or normalize -2 in background) before state tracking and side panel calls.

Useful? React with 👍 / 👎.

Comment on lines +24 to +26
() => {
void sendMessage("toggleSidePanel", undefined).catch((error) => {
logger.error("Failed to toggle split translator from shortcut", error)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Handle unsuccessful toggle responses in shortcut callback

This callback only logs rejected promises, but toggleSidePanel can resolve with { ok: false, reason: ... }. In Firefox, background returns requires-extension-user-action for content-script sourced requests, so the split-translator hotkey becomes a silent no-op with no user feedback or fallback. Check the resolved result and handle ok: false explicitly (or send an allowed source for this user gesture path).

Useful? React with 👍 / 👎.

@mengxi-ream mengxi-ream added the trust-check:skip Skip contributor trust automation on this PR. label May 1, 2026
@mengxi-ream mengxi-ream reopened this May 1, 2026
@github-actions github-actions Bot removed the needs-maintainer-review Contributor trust automation recommends maintainer review. label May 1, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3a136529e4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +28 to +32
const HAN_SCRIPT_RE = /[\u3400-\u9FFF\uF900-\uFAFF]/u

function detectSplitTranslatorShortTextLanguage(text: string): LangCodeISO6393 | null {
const trimmedText = text.trim()
return trimmedText.length < MIN_LENGTH_FOR_SKIP_LLM_DETECTION && HAN_SCRIPT_RE.test(trimmedText) ? "cmn" : null

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restrict short-text Chinese override to Chinese-only inputs

The new short-text fast path marks any string containing a Han ideograph as cmn, which also matches Japanese kanji (and hanja), so short non-Chinese inputs like 日本語 are forced to Chinese and skip normal detection. In split-translator flows where source is auto, this can trigger incorrect same-language warnings and produce lower-quality or incorrect translations for short Japanese/Korean text because the detection signal is now biased before fallback detection runs.

Useful? React with 👍 / 👎.

@github-actions

Copy link
Copy Markdown
Contributor

This PR has been inactive for 14 days and is now marked as stale.
It will be automatically closed in 30 days if no further activity occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contrib-trust:new PR author trust score is 0-29. on-hold Stale trust-check:skip Skip contributor trust automation on this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Standalone Text Translation Input within Extension Popup

2 participants