mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-21 22:05:59 +00:00
fix(agent): connect loopback adb, show unread replies, and fit the drawer page to the screen
This commit is contained in:
1 parent
2d15205ff7
commit
8337166cc9
3 files changed
+9
-4
No files matched your search
@@ -111,7 +111,8 @@ object AgentHost {
|
||||
val guest = listOf(
|
||||
"/usr/bin/env", "HOME=/root", "PATH=/root/.local/bin:/usr/local/bin:/usr/bin:/bin",
|
||||
"ADB_SERIAL=127.0.0.1:5555", "BROWSER=/root/.local/bin/android-open",
|
||||
"/bin/sh", "-c", "cd \"$1\" && shift && exec \"$@\"", "sh", workspace,
|
||||
// A fresh adb server lists the device's own adbd as emulator-5554; droiddeckctl needs the serial connected.
|
||||
"/bin/sh", "-c", "adb connect \"\$ADB_SERIAL\" >/dev/null 2>&1; cd \"$1\" && shift && exec \"$@\"", "sh", workspace,
|
||||
) + claude
|
||||
val command = LinuxRuntime.command(app, null, null, Environment.getExternalStorageDirectory(), guest)
|
||||
val builder = ProcessBuilder(command).redirectErrorStream(true)
|
||||
|
||||
@@ -54,10 +54,10 @@ import com.droiddeck.launcher.agent.AgentHost
|
||||
import com.droiddeck.launcher.agent.AgentHost.Entry
|
||||
|
||||
@Composable
|
||||
internal fun AgentPage(modifier: Modifier, inputModifier: Modifier = Modifier) {
|
||||
internal fun AgentPage(modifier: Modifier, inputModifier: Modifier = Modifier, visible: Boolean = true) {
|
||||
val context = LocalContext.current
|
||||
remember { AgentHost.refresh(context) }
|
||||
LaunchedEffect(AgentHost.unseen) { AgentHost.seen() }
|
||||
LaunchedEffect(AgentHost.unseen, visible) { if (visible) AgentHost.seen() }
|
||||
if (AgentHost.state == AgentHost.State.MISSING) {
|
||||
Column(modifier) { Note(stringResource(R.string.agent_missing)) }
|
||||
return
|
||||
|
||||
@@ -18,6 +18,7 @@ import androidx.compose.ui.input.key.type
|
||||
import androidx.compose.ui.layout.LayoutCoordinates
|
||||
import androidx.compose.ui.layout.onSizeChanged
|
||||
import androidx.compose.ui.platform.LocalDensity
|
||||
import androidx.compose.ui.platform.LocalConfiguration
|
||||
import androidx.compose.ui.res.pluralStringResource
|
||||
import androidx.compose.ui.unit.IntOffset
|
||||
import androidx.compose.ui.unit.IntSize
|
||||
@@ -766,8 +767,11 @@ internal fun SessionDrawer(open: Boolean, requestedPage: SessionDrawerPage, cont
|
||||
)
|
||||
}
|
||||
SessionDrawerPage.AGENT -> AgentPage(
|
||||
Modifier.fillMaxWidth().height(460.dp).padding(horizontal = 14.dp),
|
||||
Modifier.fillMaxWidth()
|
||||
.height((LocalConfiguration.current.screenHeightDp - 190).coerceAtLeast(240).dp)
|
||||
.padding(horizontal = 14.dp),
|
||||
inputModifier = focus.track(page, "agent-input"),
|
||||
visible = open,
|
||||
)
|
||||
SessionDrawerPage.SESSION -> {
|
||||
if (a.isHomeApp) SettingsGroup(stringResource(R.string.drawer_android_apps)) {
|
||||
|
||||
Reference in new issue
Block a user