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

+62
View File
@@ -0,0 +1,62 @@
package ui
// Files dragged from other apps, such as Finder or Explorer, drop on the
// elements that ask for them with DroppedFiles. The window takes them only
// over such an element, or anywhere when the window has OnFileDrop
// listeners, which get what no element takes.
// DroppedFiles returns the paths of the files dropped on the element since
// the last frame, nil when none, and makes the element take files dragged
// over it.
func (e *node) DroppedFiles() []string {
e.flags |= flagDropTarget
if len(e.st.dropped) > 0 {
e.c.rt.consumed = true
}
return e.st.dropped
}
// FileDragOver reports whether files dragged from another app are over
// the element, which takes them if they are dropped, for showing it would.
func (e *node) FileDragOver() bool {
e.flags |= flagDropTarget
return e.c.rt.dropOver == e.id
}
// dropTarget returns the innermost element at (x, y) that takes files.
func (rt *engine) dropTarget(x, y float32) *state {
for _, id := range rt.hitChain(x, y) {
if s := rt.states[id]; s != nil && s.flags&flagDropTarget != 0 && s.flags&flagDisabled == 0 {
return s
}
}
return nil
}
// fileDrag follows files dragged over (x, y), or out of the window for
// negative coordinates, and reports whether an element takes them there.
func (rt *engine) fileDrag(x, y float32) bool {
var over uint64
if x >= 0 && y >= 0 {
if s := rt.dropTarget(x, y); s != nil {
over = s.id
}
}
if over != rt.dropOver {
rt.dropOver = over
rt.requestFrame()
}
return over != 0
}
// fileDrop drops files at (x, y), and reports whether an element took them.
func (rt *engine) fileDrop(x, y float32, files []string) bool {
rt.fileDrag(-1, -1)
s := rt.dropTarget(x, y)
if s == nil || len(files) == 0 {
return false
}
s.dropped = append(s.dropped, files...)
rt.requestFrame()
return true
}