Skip to content

fix(multi-panel): support Gemini multi-account switching and reliable Kimi/DeepSeek Send All - #119

Open
Manho wants to merge 2 commits into
mainfrom
fix/issue-118-multi-account-and-send-all
Open

Manho wants to merge 2 commits into
mainfrom
fix/issue-118-multi-account-and-send-all

Conversation

@Manho

@Manho Manho commented Nov 21, 2026

Copy link
Copy Markdown
Owner

Summary

Addresses the functional bugs reported in #118 and #issuecomment-7041754894:

  1. In-panel Gemini multi-account support (/u/<n>)

    • Adds a compact .panel-gemini-account-select control (Default, /u/0../u/4) to Gemini panel headers, scoped independently per panel so side-by-side Gemini panels can use different Google accounts without reloading or clobbering each other (chrome.storage.sync.geminiAccountIndex serves as the default for newly opened Gemini panels, and per-panel selections survive Tab/Popup fallback handoffs).
    • Preserves /u/<n> paths across Refresh, Temporary Chat exit, NEW_CHAT URL fallbacks, and Open in New Tab (isProviderCurrentUrl, getProviderOpenUrl, getProviderFallbackUrl).
    • Intercepts same-origin Gemini Google account-switch links (/u/<n>/app, ?authuser=<n>, or cross-account /u/<n> links) marked target="_blank" / _top inside Multi-Panel frames so switching accounts stays inside the panel instead of opening an external browser tab, while leaving same-account conversation deep links untouched.
  2. Kimi & DeepSeek Send All reliability and cleared-composer recovery

    • Fixes Kimi Lexical ([data-lexical-editor="true"]) multiline prompt truncation by dispatching a cancelable ClipboardEvent('paste') with text/plain for atomic multiline insertion (with microtask verification + execCommand / DOM fallback when unhandled), and makes inputEndsWithText block-line aware (<p> / <br>) to prevent duplicate multiline insertion on retry.
    • Tightens Kimi and DeepSeek composer & send-button selectors, avoids clicking unrelated .ds-icon-button controls while DeepSeek's primary send button is disabled, and adds scheduleAutoSubmit retries for slow disabled-to-enabled send buttons.
    • Synchronizes React's main-world _valueTracker across Chrome's isolated-world content-script boundary when re-filling previously touched <textarea> controls so cleared DeepSeek composers do not stay empty/null on subsequent sends.
    • Separates Send All (autoSubmit === true) from Retry Failed (#fill-input-btn, autoSubmit === false) after partial image-fill failures: Retry Failed continues targeting only failed panels, while Send All reaches all panels with fallbackImages (supported across built-in, Custom Web, and Custom API panels, with attemptedImageIds tracking on partial fallback failures) so any panel manually cleared by the user is cleanly re-populated without duplicating untouched panels.

Note on remaining #118 items: Shared Send All non-image document uploads (PDF/DOCX/TXT) and the broader Settings / Prompt Library visual redesign are intentionally left out of this focused bugfix PR and tracked under #118.

Refs #118

Verification

  • npm test -- --run — 94 test files passed (1,304 tests)
  • npx playwright test --workers=1 tests/e2e/issue-118-multi-account-and-send-all.e2e.test.js tests/e2e/chatgpt-send-all.e2e.test.js tests/e2e/image-fill-focus.e2e.test.js tests/e2e/aistudio-content-scripts.e2e.test.js tests/e2e/custom-provider-temp-chat-and-images.e2e.test.js tests/e2e/open-mode-switch.e2e.test.js tests/e2e/temporary-chat.e2e.test.js — all passed
  • git diff --check — passed

… Kimi/DeepSeek Send All

- Add Gemini header account selector (Default, /u/0..4) persisted in sync storage and preserve /u/<n> across refresh, Temporary Chat exit, New Chat URL fallbacks, and Open in New Tab
- Intercept same-origin Google /u/<n> and ?authuser=<n> target=_blank/_top links inside Multi-Panel frames so account switching stays in-frame
- Fix Kimi Lexical multiline prompt truncation via cancelable paste injection, tighten Kimi/DeepSeek send & input selectors, and retry slow disabled-to-enabled send buttons
- Re-target all panels on Send All after partial image fill failures with fallbackImages and sync React main-world _valueTracker across isolated worlds so cleared DeepSeek composers re-populate cleanly

Refs: #118
…All fallback handling

- Scope Gemini account index per panel so side-by-side Gemini panels do not clobber or reload each other while keeping sync storage as default for new panels
- Revert out-of-scope AI Studio and Google account URL hunks and narrow Gemini _blank interception to genuine account-switch links
- Report attemptedImageIds on failed cleared-composer fallback retries and support fallbackImages on Custom Web and Custom API panels
- Make inputEndsWithText block-line aware, scope composer attachment checks, narrow DeepSeek icon send selectors, and track DeepSeek preview baselines independently

Refs: #118
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.

1 participant