github egoist/mygo v0.6.0

3 hours ago

MyGo 0.6.0

Native UI is much faster:

  • windows redraw only what changed, on Metal, Direct3D 11, OpenGL and WebGL;
  • layout redoes only what changed;
  • windows out of sight draw nothing.

There is a new loading plugin, and the terminal plugin gains search, Kitty graphics and mirroring. Menus on Windows 11 look like Windows 11's own.

Upgrading from 0.5

  • Windows, browser keys: WebView2's browser shortcuts (F5, Ctrl+R, Ctrl+P, Ctrl+F, Ctrl+Plus/Minus) no longer work in pages unless DevTools is on, as on macOS and Linux. Add RoleZoomIn, RoleZoomOut and RoleResetZoom to your menu to keep zooming.
  • Windows, edit keys: WebView2 now performs a page's edit keys itself (Ctrl+C/V/X/Z/Y/A), so pages get real paste events with HTML and images. A key you bound to an edit role yourself still runs your menu item.
  • Windows, trash: Shell.TrashItem never deletes for good. It returns an error when the file can't go to the Recycle Bin.
  • Tests: ui.Tester.Click, ClickWith and RightClick return an error for an element outside the window.
  • Linux user agent: a UserAgentSuffix without a version, such as "MyApp", is appended as it is, as on macOS and Windows.

Native UI

  • Partial frames: only what changed is redrawn, on every GPU renderer. Metal and Direct3D present frames without blocking the main thread.
  • Faster layout and painting: layout redoes only what changed, text is measured once per element, content clipped out of view isn't painted, and draws are batched into fewer calls.
  • Windows out of sight draw no frames until they show again or get input.
  • Effects no longer let GPU memory grow while their element animates.
  • Selection: lists and tables choose blocks of cells and drag-select rows.
    • New ListState fields: CellSelect, DragSelect, Cells, CellMenu and MenuKeepsSelection.
    • New ListState methods: CellSelected, SelectColumns, ExtendTo and ScrollToEnd.
    • New TableColumn.RowHeader.
  • Scrolling: mouse wheel scrolling glides smoothly.
  • Layout: flexbox lays out as Chrome does, and rows and grids can align children by their baselines.
  • Window buttons: WindowOptions.HideWindowButtons lets a view draw the window's buttons. Element.MaximizeButton brings up Windows 11's snap layouts.
  • Paths too large for one mask now draw.
  • Elements are keyed by what Go compares, so a pointer keys its object.
  • Tester: new Tester.Wheel and Tester.DropFiles.
  • Fixes:
    • Painter.Visible is right under a transform;
    • a select's long list of options stays in the window;
    • a field's label lines up with its control when a description follows;
    • a list that follows its end no longer pushes its rows down when they fit;
    • text typed through accessibility is inserted;
    • a rich text leaving with a transition no longer crashes.

Code editor and diff view

  • Very long lines and large files stay responsive.
  • A diff set to FitContent no longer leaves room for a scroll bar.

New: the loading plugin

plugins/loading draws loading.dev's 29 indicators in native UI. Run go run ./examples/loading for a tour.

Terminal plugin

  • Search: search the scrollback with Search, SearchNext, SearchPrevious, EndSearch and OnSearch.
  • Images: shows the images programs send with the Kitty graphics protocol, up to Options.ImageLimit.
  • Mirroring: Terminal.NewMirror mirrors a terminal for windows elsewhere.
  • Colors:
    • MinimumContrast keeps text readable on its background;
    • UseTheme sets the theme;
    • programs learn the window's colors and light/dark mode;
    • PaddingColor lets the padding take the edge cells' colors.
  • Links: the link under Command is underlined, and HoveredLink tells the app which it is.
  • The app is told when a program copies to the clipboard (OnCopy), and the terminal shows the pointer the program asks for.
  • Dropped files paste their paths, quoted for the shell.
  • Clear from the context menu works as ⌘K does.

Windows

  • Menus are drawn in Windows 11's style on Windows 11.
  • Menu shortcuts work in windows of native UI; this is new on Linux too.
  • Tray icons:
    • TrayOptions.ID keeps the user's choice to show an icon;
    • template icons show white on a dark taskbar;
    • Tray.Dark and Tray.OnAppearanceChange tell which bar the icon is on.
  • Focus: a relaunched app comes back in front, and App.Focus keeps its window in front.
  • Flyouts can have a material and rounded corners: FlyoutOptions.Vibrancy and CornerRadius.
  • SetProgressBar works.
  • Documents: a document keeps its new contents when Windows stops a file replace halfway.
  • Installer: non-ASCII app names and paths work in the installer.

macOS

  • Notifications can show the sender's avatar: NotificationOptions.Sender.
  • Tab reaches buttons and links in pages, as in Chrome. Set PageOptions.SafariTabFocus for Safari's behavior.
  • Tray icons stay where the user put them, and highlight while their popover shows.
  • Printing: PDFs printed from pages keep their Chinese text.
  • Text no longer wraps its last word at its measured width.

Linux

  • Theme: ThemeLight works under a dark GTK theme, such as Ubuntu's dark mode.
  • Crashes fixed: on machines without a GPU, and when the OpenGL check frees its window.

Pages

  • PageOptions.UserAgentSuffix adds the app's name and version to the web view's user agent.

CLI and distribution

  • Signing:
    • provisioningProfile in mygo.json embeds a macOS provisioning profile before signing;
    • mygo publish -upload stops when the update signing key is missing.
  • Linux packages: "linux": {"webview": false} packages native-UI apps without a WebKitGTK dependency.
  • Dev builds: the development app uses its icon's -dev variant.

Updater

  • It checks for updates soon after every launch.
  • Its window follows the app's language.

Files and drags

  • Documents follow their file when another app renames or replaces it, and tell a new file apart from an old one that had the same inode.
  • DragResult.Escaped and Point tell a drag let go over no target from one given up, and where it ended.

Contributors

Thank you @ACAne0320, @baranwang, @Bush2021, @dhruv1220, @echoVic, @ericluenglx, @firede, @gvenusleo, @HeroSizy, @mrzzmrzz, @roelfdiedericks, @saanuregh, @sorrycc, @xingkaixin, @xlanstar and @zzstar101.

Full Changelog: v0.5.5...v0.6.0

Don't miss a new mygo release

NewReleases is sending notifications on new releases.