feat(mobile): pop a session or a file preview out beside the dashboard from a native wrapper

An Android WebView wrapper has no browser pop-ups, so a foldable could not
show two sessions, or a session and a file, side by side. A wrapper that can
open a window of its own now exposes window.CodemanHost.openWindow(url);
detachSession, detachFilePreview and openWebviewExternal hand their URL to
it, mobile.css keeps the pop-out icon under html.host-windows, and a solo
window closes and raises itself through the host when it offers the calls.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
shenlvkang-collab
2026-09-15 20:19:47 +08:00
co-authored by Claude Opus 5
parent 88e3faa456
commit 0720526b64
9 changed files with 253 additions and 8 deletions
+6
View File
@@ -4203,6 +4203,12 @@ Object.assign(CodemanApp.prototype, {
*/
detachFilePreview() {
if (!this.filePreviewDetachUrl) return;
const hosted = this.openInHostWindow?.(this.filePreviewDetachUrl) ?? null;
if (hosted !== null) {
if (hosted) this.closeFilePreview();
else this.showToast('Could not open a new window for this preview', 'error');
return;
}
const win = window.open(this.filePreviewDetachUrl, '_blank');
if (!win) {
this.showToast('Pop-up blocked: allow pop-ups for this site to detach previews', 'error');