github egoist/mygo v0.10.0
MyGo 0.10.0

one hour ago

Changes in behavior

No breaking changes to the Go API. A few changes apps may notice:

  • A triple click selects a paragraph. In selectable text and multi-line text inputs, a triple click selects the whole paragraph up to its line break, as macOS, ui/richtext and the code editor do, instead of the one line a wrapped paragraph is broken onto. A drag after it extends the selection by paragraphs. Home, End and the Cmd+arrows still move by lines. (#1943, @iFwu)
  • Attached popups fit in the window. A popup attached to an element, such as the panel of a SelectBase, ComboboxBase or PopoverBase, is never taller than the room the window has, so a long list in a ui.Scroll(c).Shrink(1) scrolls inside it instead of running past the window's edge. Popups that fit are unchanged. (#1958, reported by @Games55k in #1956)
  • A finger scrolls on Windows touchscreens. In native UI, a one-finger drag scrolls instead of pressing and selecting, two fingers pinch and scroll, a tap clicks and press and hold right-clicks, so whiteboard and kiosk apps scroll by touch. A finger on a title bar's drag region still moves the window, and fingers on web views and pens are unchanged. (#1911, @Saramanda9988, reported in #1712)
  • Tray icons on Linux keep their identity across launches. A tray icon without a TrayOptions.ID is now named after the program and its place among the app's icons, not the process, so KDE Plasma remembers whether the user shows or hides it. Users set that once more after updating. (#1934, @pseudoyu)
  • OnDOMReady fires for a page shown again from the back/forward cache. Going back to a page WebKit kept now delivers Emit and Broadcast to it again. Calls the page left unanswered when it was left fail with a CallError instead of staying pending. (#1941, @PythonShe)

Highlights

  • Apps on iPhone, iPad and Android. The same MyGo app runs on iOS and Android phones and tablets, from one Go codebase: windows of web pages show in the system's web view, and native UI draws with Metal and OpenGL ES. Desktop builds still need no cgo and none of the phone tools. See the new Phones and tablets docs. (#940)
    • From change to store. mygo dev -platform ios or -platform android runs the app on a simulator, an emulator or a connected device, and a change of the Go code is back on screen in about two seconds. mygo build -platform ios makes a signed .ipa, -platform android an .apk and an .aab, and mygo publish uploads them to App Store Connect or Google Play. mygo doctor says what's missing to build for phones, and mygo devices lists simulators, emulators and phones.
    • Native UI that feels at home under a finger: flings with UIKit's bounce and Android's stretch, long press, pinch, swiping back and Android's predictive back, the system's keyboards with their input types, return keys, autocorrect, input methods and autofill of passwords and SMS codes, selection handles and the edit menu, VoiceOver and TalkBack, Dynamic Type, dark mode and the safe area. Elements take Keyboard, ReturnKey, Autofill, Capitalize, Autocorrect, LongPressed and PullToRefresh.
    • Phone navigation and widgets. mygo.NewTabs shows the system's tab bar and Window.Push and Pop a stack of screens with a back button. ui/mobile has sheets with detents, action sheets, drawers, top and bottom bars, floating buttons, pagers, swipe rows, wheel and date pickers, and list rows. On iPad, WindowOptions.OwnScene opens a window beside the app's others.
    • The device. mygo.Haptics, SystemBars, SetOrientations, Share, SetBarItems, Power.Battery and Dialog.SaveCopy; App.OnMemoryWarning; deep links and App Links; secrets in the Keychain and Android's keystore. App.OnSaveState and RestoredState bring an app back where it was after the system ended it in the background.
    • Plugins for phones: location, maps (MapKit on iOS, OpenStreetMap on Android with no key), camera, imagepicker, videoplayer, biometrics, sensors, push (APNs and Firebase), purchases (StoreKit 2 and Google Play Billing), background (BGTaskScheduler and WorkManager) and preferences, while permissionflow and sqlite work on phones too.
    • Native modules on phones. A native module's Swift runs on iOS when its Package.swift names iOS, and a new kotlin/ directory implements it on Android, built with the app from source. The SQLite plugin runs on phones this way, with full-text search.
    • Testing. Tester.FingerDown, FingerMove, FingerUp, FingerCancel and SetInsets test views with a finger and the system's bars, ui/golden compares what a Tester draws with images kept beside the tests, and plugins/automation drives a running app on simulators, emulators and devices.
  • mygo dev brings the app back where it was. After a change restarts the app, scroll offsets, the place in a ui.Router and what widgets keep with ui.Local come back by themselves, on desktops as on phones. mygo.KeepState(&state) brings back the app's own values too, unexported fields and all. (#940)
  • Pictures from the network. ui/netimage shows images from URLs in native UI on every platform, with a placeholder until they come, a fade in, and memory and disk caches that follow the servers' caching headers, so a feed scrolled back or opened offline shows them at once. What's on screen downloads first. (#940)
  • Faster layout and Markdown editing.
    • Layout takes about 12% less time on the arewelayoutyet workloads, and up to 20% less for flexible rows and wrapping lines. (#1928, #1975, @joei4cm)
    • An edit of a large Markdown document reparses with 14 allocations instead of 1,706 and about a third less time, and saving rich text as Markdown compares marks without allocating. (#1936, #1938, @KurobaRemu)

New

Native UI

  • Moving the pointer diagonally toward an open submenu keeps it open, in every menu native UI draws (PopoverMenu, PopoverMenuButton, MenuBase, ContextMenuBase), so users don't have to go sideways first. (#1919, requested by @tsugumi42 in #1916)

Code editor and rich text

  • State.ScrollMargin sets how many lines the editor keeps between the caret and the edge of the view, or none, as VS Code's cursorSurroundingLines and Vim's scrolloff do. The default stays three lines. (#1965, @xueelf)
  • DiffState.ScrollPastEnd lets a diff scroll until its last line is at the top, so "next change" can center a change near the end. DiffState.Focus() gives the keyboard to the active side, so after a "next change" button the arrow keys work in the diff without a click. (#1971, @prometheusalpha)
  • HeadingStyle.LineHeight gives headings a line height of their own, so a type scale such as headings of 24 on lines of 30 over body text of 15 on 22 holds for wrapped headings too. EditorOptions.Space may return less than zero to take room away above a paragraph, such as around a rule. A quotation's bar runs unbroken down its paragraphs. (#1966, @xcc3641)

Fixes

Native UI

  • Pasted text with old Mac line endings (a lone \r) breaks lines in a multi-line text input instead of keeping the \r in the bound string, where it made lines draw over each other. (#1918, reported by @Binaryify in #1915)
  • Arabic and Persian marks, such as the fatha on ک and the kasra under ر, are drawn where shaping places them, on every platform. Spans with BaselineShift now draw their text raised, as the docs describe. (#1929, reported by @amir-saatchi in #1925)
  • Capturing a window shows the right text after another window filled the shared glyph atlas. (#1921, reported by @maokomioko in #1920)

Pages and calls

  • A call from the page with half of an emoji in a string, as "😀".slice(0, 1) gives, is answered instead of staying pending. (#1941, @PythonShe)
  • A window shown from OnReadyToShow shows when its first page fails to load, such as with the dev server down or the machine offline. (#1941, @PythonShe)
  • A panic in a custom scheme's handler while it serves a download fails the download instead of ending the app. (#1941, @PythonShe)
  • Page.Eval sent just as the user navigates away answers, instead of waiting until the user goes back to the page. (#1957)

macOS

  • A closing window fades out with its content, instead of as a blank or white frame. (#1932, reported by @saminnet in #1931)
  • Panels and flyouts of native UI hover and show tooltips while another app is active. (#1922, @Shizuku11451)
  • Menus that stay open leave no empty space after their badges, and a row of a wide menu highlights end to end. (#1935, @Sakurasan)

Windows

  • Shell.OpenExternal opens a file:// URL of a local folder or file without stalling the app, including paths with spaces or non-ASCII names. (#1917, @Li-changwu)
  • Rendering with plugins/render and playing video in ui/video no longer crash now and then in Media Foundation. (#1927, @pseudoyu)

New Contributors

Full Changelog: v0.9.2...v0.10.0

Don't miss a new mygo release

NewReleases is sending notifications on new releases.