feat: a browser page in the right sidebar, and icon tabs

- the right sidebar gains a Browser tab: address bar (back/forward, URL,
  go, stop/reload, open in the system browser), history, quick links for
  localhost:3000/5173/8080, and an embedded WebView on Android/iOS with an
  error bar and retry; desktop shows a mobile-only hint
- Android allows cleartext traffic so local dev servers over HTTP load in
  the WebView
- the tab row is now icons with tooltips (Files, Project knowledge,
  Terminal, Browser), so four tabs fit a phone without truncated labels;
  the tabs are kept alive offstage, so switching away and back keeps the
  browser page and terminal state
- webview_flutter 4.14.1; version 0.6.7+607; tests cover the tab icons and
  the desktop fallback
This commit is contained in:
blumia committed 2026-12-04 02:02:19 +08:00
1 parent fedc4dd79c
commit ce944751b4
10 files changed
+563 -24

No files matched your search

+2 -1
View File
@@ -14,7 +14,8 @@
<application
android:label="Chamber Go"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
android:icon="@mipmap/ic_launcher"
android:usesCleartextTraffic="true">
<activity
android:name=".MainActivity"
android:exported="true"
@@ -48,6 +48,26 @@ class MainActivity : FlutterActivity() {
else -> result.notImplemented()
}
}
// The right sidebar's browser hands a page to the system browser.
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, "openchamber/browser")
.setMethodCallHandler { call, result ->
when (call.method) {
"openUrl" -> {
val url = call.argument<String>("url")
if (url.isNullOrBlank()) {
result.error("bad_args", "Missing URL", null)
return@setMethodCallHandler
}
try {
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)))
result.success(true)
} catch (e: Exception) {
result.error("open_failed", e.message ?: "Could not open the URL", null)
}
}
else -> result.notImplemented()
}
}
// Saving a conversation picture to the gallery and sharing it: both
// need Android APIs (MediaStore, FileProvider) that a Dart package
// would pull in another native dependency for.