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/richtextand 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,ComboboxBaseorPopoverBase, is never taller than the room the window has, so a long list in aui.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.IDis 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) OnDOMReadyfires for a page shown again from the back/forward cache. Going back to a page WebKit kept now deliversEmitandBroadcastto it again. Calls the page left unanswered when it was left fail with aCallErrorinstead 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 iosor-platform androidruns 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 iosmakes a signed.ipa,-platform androidan.apkand an.aab, andmygo publishuploads them to App Store Connect or Google Play.mygo doctorsays what's missing to build for phones, andmygo deviceslists 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,LongPressedandPullToRefresh. - Phone navigation and widgets.
mygo.NewTabsshows the system's tab bar andWindow.PushandPopa stack of screens with a back button.ui/mobilehas 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.OwnSceneopens a window beside the app's others. - The device.
mygo.Haptics,SystemBars,SetOrientations,Share,SetBarItems,Power.BatteryandDialog.SaveCopy;App.OnMemoryWarning; deep links and App Links; secrets in the Keychain and Android's keystore.App.OnSaveStateandRestoredStatebring 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) andpreferences, whilepermissionflowandsqlitework on phones too. - Native modules on phones. A native module's Swift runs on iOS when its
Package.swiftnames iOS, and a newkotlin/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,FingerCancelandSetInsetstest views with a finger and the system's bars,ui/goldencompares what aTesterdraws with images kept beside the tests, andplugins/automationdrives a running app on simulators, emulators and devices.
- From change to store.
mygo devbrings the app back where it was. After a change restarts the app, scroll offsets, the place in aui.Routerand what widgets keep withui.Localcome 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/netimageshows 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.ScrollMarginsets how many lines the editor keeps between the caret and the edge of the view, or none, as VS Code'scursorSurroundingLinesand Vim'sscrolloffdo. The default stays three lines. (#1965, @xueelf)DiffState.ScrollPastEndlets 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.LineHeightgives 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.Spacemay 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\rin 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
BaselineShiftnow 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
OnReadyToShowshows 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.Evalsent 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.OpenExternalopens afile://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/renderand playing video inui/videono longer crash now and then in Media Foundation. (#1927, @pseudoyu)
New Contributors
- @Li-changwu made their first contribution in #1917
- @Shizuku11451 made their first contribution in #1922
- @xueelf made their first contribution in #1965
- @Saramanda9988 made their first contribution in #1911 (from #1718)
Full Changelog: v0.9.2...v0.10.0