Mini App pop-out window stays opaque under the webview renderer backend

オープン
#597 コメント 10 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript
領域
desktop

調査の方向性

Start with embedded-browser-manager.js and webview-host/host.js, then trace how the detached guest surface is created for the webview backend. Check the platform-specific APIs for setting a transparent guest background and compare behavior with the native web-contents-view backend. Done means a transparent Mini App pop-out reveals the desktop behind its transparent pixels on the webview backend, or the backend clearly communicates that it cannot honor the setting.

索引モデルが issue の本文から書いたものです。

説明

What happens

A Mini App that declares a transparent pop-out window renders as an opaque black rectangle when the client uses the webview renderer backend. The same package, unchanged, is fully transparent on the native web-contents-view backend.

Environment

  • MiniMax Code 3.1.12.216
  • Windows 11, build 26300 (UBR 9818)
  • Package installed under %USERPROFILE%\.minimax\plugins\<plugin>
  • miniapp.json:
"surface": {
  "path": "/bottle",
  "window": {
    "width": 220,
    "height": 300,
    "minWidth": 220,
    "minHeight": 300,
    "resizable": false,
    "frame": false,
    "transparent": true,
    "alwaysOnTop": true,
    "skipTaskbar": false
  }
}

Steps

  1. Install the package, open it in the side panel, pop it out into its own window.
  2. The window is a black rectangle around the page content, and it takes the mouse over its whole area.
  3. The client log confirms the backend:
[EmbeddedBrowserLifecycle] shown {"rendererBackend":"webview","requestedRendererBackend":"webview",
  "backendPolicyRevision":1,"event":"shown", ... "presentation":"detached"}

The page is not painting the backdrop

  • In window mode the page forces html, body and the app root to background: transparent !important, and the stage, panels and footer are display: none.
  • A headless Chromium render of the same page at 220×300 has alpha = 0 at all four corners, so the document paints nothing.
  • With the native backend the identical package is transparent, so the difference is the guest surface, not the document.

Where it looks broken

embedded-browser-manager.js passes the declaration through when it rebuilds the guest for a detach:

transparentBackground: host === tab.detachedWindow && tab.miniApp?.window?.transparent === true,

and webview-host/host.js only applies it as CSS on the host element:

Object.assign(entry.page.style, {
  colorScheme: "light",
  backgroundColor: descriptor.transparentBackground ? "transparent" : "Canvas"
});

The guest's own surface keeps an opaque background, so a transparent CSS background on the <webview> element cannot reveal what is behind the window.

Expected

A window declared "transparent": true should show the desktop behind the page's transparent pixels, as it does with web-contents-view.

Suggested fix

  • Give the guest a transparent background where the platform supports one (a transparent webContents background / WebView2 default background), instead of relying on CSS on the host element; or
  • Keep transparent: true Mini Apps on the native backend and state that the webview backend cannot honour the flag, so packages can avoid the declaration there.

Related

-webkit-app-region: drag is inert inside the webview guest as well, so a popped-out page has to move its own window through window.mcode.miniapp.window.update({ x, y }). That works, but docs/client.md recommends the app-region, and a page that follows the documentation ends up with a window the user cannot move at all.

主要言語
TypeScript
スター
2.3k
フォーク
315
平均マージ
3時間 54分
マージ済み PR(30日)
9

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

MiniMax-AI/minimax-code のほかの issue

MiniMax-AI/minimax-code の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。