feat: one server button, and only primary agents to pick

The session screen now has a single server icon that opens the instance
list; picking an instance drops the live connection and connects to it,
and disconnecting moved into that list. A custom SVG rack stands in for
the missing server symbol on Android.

The agent sheet lists primary agents only: a session cannot run a
subagent (General, Explore) as its own agent.

Bump version to 0.1.5 (build 6).
This commit is contained in:
blumia committed 2026-11-16 13:21:20 +08:00
1 parent 9d9678e294
commit e240a33e31
8 files changed
+76 -10

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
package appui
import (
"github.com/egoist/asuka/colors"
"github.com/egoist/asuka/sdk/svg"
"github.com/egoist/asuka/ui"
)
// serverIcon is a rack, drawn as vector paths: Asuka's built-in symbols
// have no server glyph on Android, and an SVG keeps it crisp at any size.
var serverIcon = svg.MustParse(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="20" height="8" x="2" y="2" rx="2"/><rect width="20" height="8" x="2" y="14" rx="2"/><line x1="6" x2="6.01" y1="6" y2="6"/><line x1="6" x2="6.01" y1="18" y2="18"/></svg>`)
// instancesButton opens the server list: one button, because picking a
// server is also how the live one is replaced.
func (c *controller) instancesButton() ui.Node {
return ui.View(ui.ViewProps{
OnPress: func() { c.instancesOpen.Set(true) },
Label: ui.Val("实例"),
Hint: ui.Val("打开服务器列表"),
Style: ui.Style{Padding: ui.All(8)},
}, svg.View(svg.Props{
Icon: serverIcon,
Color: ui.Val(colors.Accent),
Style: ui.Style{Width: ui.Pt(22), Height: ui.Pt(22)},
}))
}