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
+60
@@ -0,0 +1,60 @@
|
||||
package scene
|
||||
|
||||
import (
|
||||
"math"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// TestGammaRatios checks Direct2D's ratios for its default gamma, 1.8, as
|
||||
// Windows Terminal lists them, and that gammas round to a tenth.
|
||||
func TestGammaRatios(t *testing.T) {
|
||||
want := [4]float32{0.148054421, -0.894594550, 1.47590804, -0.324668258}
|
||||
got := GammaRatios(1.8)
|
||||
for i := range want {
|
||||
if math.Abs(float64(got[i]-want[i])) > 1e-6 {
|
||||
t.Fatalf("GammaRatios(1.8) = %v, want %v", got, want)
|
||||
}
|
||||
}
|
||||
if GammaRatios(1.84) != got || GammaRatios(1) != [4]float32{} || GammaRatios(3) != GammaRatios(2.2) {
|
||||
t.Error("gammas do not round to the table")
|
||||
}
|
||||
}
|
||||
|
||||
// TestTextCoverage checks that no correction leaves coverage as it is,
|
||||
// that coverage stays between 0 and 1 and keeps its ends, and that the
|
||||
// contrast is enhanced for dark text alone.
|
||||
func TestTextCoverage(t *testing.T) {
|
||||
g := GammaRatios(1.8)
|
||||
black, white := [3]float32{}, [3]float32{1, 1, 1}
|
||||
for a := float32(0); a <= 1; a += 1.0 / 16 {
|
||||
if v := TextCoverage(a, black, 0, 0, [4]float32{}); v != a {
|
||||
t.Fatalf("no correction turns %v into %v", a, v)
|
||||
}
|
||||
for _, c := range [][3]float32{black, white, {0.5, 0.2, 0.9}} {
|
||||
v := TextCoverage(a, c, 1, 0, g)
|
||||
if v < 0 || v > 1 {
|
||||
t.Fatalf("coverage %v of %v corrected to %v", a, c, v)
|
||||
}
|
||||
s := SubpixelCoverage([3]float32{a, a, a}, c, 0.5, ThinBoost, g)
|
||||
if s[0] < 0 || s[0] > 1 {
|
||||
t.Fatalf("subpixel coverage %v of %v corrected to %v", a, c, s)
|
||||
}
|
||||
}
|
||||
}
|
||||
for _, a := range []float32{0, 1} {
|
||||
if v := TextCoverage(a, black, 1, 0, g); v != a {
|
||||
t.Errorf("coverage %v of black corrected to %v", a, v)
|
||||
}
|
||||
}
|
||||
if TextCoverage(0.5, black, 1, 0, g) <= TextCoverage(0.5, black, 0, 0, g) {
|
||||
t.Error("the contrast of dark text is not enhanced")
|
||||
}
|
||||
// Light text takes no contrast, and its gamma correction thickens it.
|
||||
if TextCoverage(0.5, white, 1, 0, g) != TextCoverage(0.5, white, 0, 0, g) || TextCoverage(0.5, white, 0, 0, g) <= 0.5 {
|
||||
t.Error("light text")
|
||||
}
|
||||
// Thin glyphs take their boost whatever their color.
|
||||
if TextCoverage(0.5, white, 1, ThinBoost, g) <= TextCoverage(0.5, white, 1, 0, g) {
|
||||
t.Error("light thin text takes no boost")
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user