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:
1 parent
2fb4a8ea79
commit
6c0ee61750
2538 files changed
+675779
-4792
No files matched your search
@@ -0,0 +1,55 @@
|
||||
//go:build linux && !android && (amd64 || arm64)
|
||||
|
||||
package e2e
|
||||
|
||||
import (
|
||||
"sync/atomic"
|
||||
"testing"
|
||||
|
||||
"github.com/egoist/mygo"
|
||||
"github.com/egoist/mygo/internal/linux"
|
||||
"github.com/egoist/mygo/ui"
|
||||
)
|
||||
|
||||
// TestAccessDisabled reads, as Orca does through ATK, a button that is
|
||||
// only unavailable (AccessDisabled, aria-disabled): not enabled, yet
|
||||
// focusable, and focused when assistive technology asks, where a button
|
||||
// Disabled is neither.
|
||||
func TestAccessDisabled(t *testing.T) {
|
||||
var frames atomic.Int32
|
||||
var focused atomic.Bool
|
||||
view := func(c *ui.Context) {
|
||||
frames.Add(1)
|
||||
ui.Column(c).Padding(20).Gap(10).Children(func() {
|
||||
del := ui.Button(c, "Delete project").AccessDisabled(true)
|
||||
focused.Store(del.Focused())
|
||||
ui.Button(c, "Close").Disabled(true)
|
||||
})
|
||||
}
|
||||
w := newWindow(t, mygo.WindowOptions{Title: "Unavailable", Width: 400, Height: 200, Content: ui.View(view)})
|
||||
eventually(t, "a frame", func() bool { return frames.Load() > 0 })
|
||||
if _, ok := accessibility(w); !ok {
|
||||
t.Skip("accessibility automation not available on this platform")
|
||||
}
|
||||
states := func(label string) (enabled, focusable, ok bool) {
|
||||
mygo.RunOnMain(func() { enabled, focusable, ok = linux.TestAccessibilityEnabled(w.NativeHandle(), label) })
|
||||
return enabled, focusable, ok
|
||||
}
|
||||
eventually(t, "the unavailable button", func() bool {
|
||||
enabled, focusable, ok := states("Delete project")
|
||||
return ok && !enabled && focusable
|
||||
})
|
||||
if enabled, focusable, ok := states("Close"); !ok || enabled || focusable {
|
||||
t.Errorf("Close: enabled %v, focusable %v, found %v", enabled, focusable, ok)
|
||||
}
|
||||
if accessPerform(w, "Delete project", "press", "") {
|
||||
t.Error("assistive technology pressed the unavailable button")
|
||||
}
|
||||
if accessPerform(w, "Close", "focus", "") {
|
||||
t.Error("assistive technology focused the disabled button")
|
||||
}
|
||||
if !accessPerform(w, "Delete project", "focus", "") {
|
||||
t.Fatal("cannot focus the unavailable button")
|
||||
}
|
||||
eventually(t, "the unavailable button focused", focused.Load)
|
||||
}
|
||||
Reference in new issue
Block a user