feat: port the client to MyGo native UI (0.3.0)

Switch from Asuka to MyGo, keeping the API client and the feature set:

- servers: saved servers, passwordless and password login, proxy,
  self-signed certificates, per-server device tokens (Keystore), connect
  form, instance list sheet with switch/disconnect
- sessions: virtualized list, search, new session, rename/archive/delete,
  running indicator, event stream keeps it live
- chat: pushed window with system back bar, streaming Markdown via
  ui/markdown, reasoning and tool rows with image previews, footer menu
  (read aloud via a Kotlin TTS plugin, copy, fork), user message menu
  (copy, revert, fork), context usage ring and detail sheet, attachments
  (photos/files via the document picker), permissions
- release builds allow plain http:// LAN servers (Go's net/http dials
  directly, no cleartext manifest needed)
- a local fork of MyGo (third_party/mygo) lowers the Android host's
  minSdk to 24 (Android 7.0); Go 1.27.4 via mise

Version 0.3.0.
This commit is contained in:
OpenChamber committed 2026-11-18 13:22:59 +08:00
1 parent 2fb4a8ea79
commit 6c0ee61750
2538 files changed
+675779 -4792

No files matched your search

+68
View File
@@ -0,0 +1,68 @@
package ui
import (
"image"
"image/color"
"testing"
)
// BenchmarkPaintTiles paints the frames of a 2D game's view at
// 1280×720 DIPs at twice the density, as it animates with
// Painter.AnimationFrame: a map of tiles 16 pixels drawn 3 times as large
// in three layers, through a transform that scrolls, under 300 sprites
// walking, flipped as they face, all parts of one pixelated sheet drawn
// with ImageRegion. It measures what a frame costs the CPU before a
// renderer draws it.
func BenchmarkPaintTiles(b *testing.B) {
sheet := image.NewRGBA(image.Rect(0, 0, 128, 128))
for y := range 128 {
for x := range 128 {
sheet.Set(x, y, color.RGBA{uint8(x * 2), uint8(y * 2), 120, 255})
}
}
bm := NewBitmap(sheet).Pixelated()
var tiles [64]Rect
for i := range tiles {
tiles[i] = Rect{X: float32(i%8) * 16, Y: float32(i/8) * 16, W: 16, H: 16}
}
const cols, rows, size = 60, 40, 48 // a map larger than the view
frame := 0
view := func(c *context) {
coreBox(c).Size(1280, 720).Draw(func(p *Painter, r Rect) {
camX := float32(frame%600) * 2
p.Transform(Translation(-camX, -100), r.X, r.Y, func() {
for l := range 3 {
for y := range rows {
for x := range cols {
if l > 0 && (x+y+l)%3 != 0 {
continue
}
p.ImageRegion(bm, tiles[(x*7+y*13+l)%64], Rect{X: r.X + float32(x)*size, Y: r.Y + float32(y)*size, W: size, H: size}, ImageOptions{})
}
}
}
for i := range 300 {
src := tiles[i%8]
src.H = 32
x := float32((i*97+frame)%(cols*size)) + 0.5
y := float32(i*61%(rows*size-96)) + 0.25
p.ImageRegion(bm, src, Rect{X: r.X + x, Y: r.Y + y, W: size, H: 2 * size}, ImageOptions{FlipX: (i+frame/30)%2 == 0})
}
})
})
}
tt := coreNewTester(view, 1280, 720)
tt.SetScale(2)
rt := tt.rt
images := 0
for b.Loop() {
frame++
rt.paint(rt.c.root, 1280, 720, 2)
}
for _, op := range rt.scene.Ops {
if op.Image != nil {
images++
}
}
b.ReportMetric(float64(images), "sprites")
}