Skip to content
frostyardPublic

About

frostyard's desktop UI kit on MyGo: the command-center shell, palette, console, job queue and components shared by ChairLift, Frostmail and Frostnotes

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

112 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

frostui

Go Reference

frostui is a Go module that gives desktop apps on MyGo a command-center window and the pieces to fill it, for frostyard's apps: ChairLift, Frostmail, Frostnotes, the Firn GUI installer and the Pocket client.

Status: pre-release. Until v1, a minor version may change the API, and each change is listed in the design doc.

Documentation: pkg.go.dev/github.com/frostyard/frostui

The command-center example in the middle of a sync

What it does

Package What it gives you
frostui The shell (top bar with a command palette, rail, console and status bar), a frame without the rail for apps made of panes, a serial job queue, a command table behind keys, menus and the palette, a source list, a settings layout, an allow-listed opener, a tray icon with a close-to-tray check, dialogs, cards, rows, charts, a native unified diff viewer, the desktop's icons (with an embedded set), and frostyard's look: the Frostyard and Frostyard light themes, set in Inter.
frostuitest A stand-in for the UI thread, so tests run what workers post without a window.

It builds without CGO for Linux, Windows and macOS on amd64 and arm64, and for js/wasm. The freedesktop parts (app ID, icon theme, launching desktop apps, whether a panel hosts the tray icon) work on Linux and fall back elsewhere.

Requirements

  • Go 1.27.
  • At run time, what MyGo needs: GTK 3, libepoxy and Pango on Linux, and libayatana-appindicator3 for a tray icon.
  • For the tests: Pango and cairo, and no display.

Install

go get github.com/frostyard/frostui

Use

import (
	"log"

	"github.com/egoist/mygo"
	"github.com/egoist/mygo/ui"

	"github.com/frostyard/frostui"
)

func main() {
	shell := &frostui.Shell{Brand: frostui.Brand{Name: "Notes"}, Selected: "all"}
	nav := []frostui.NavSection{{Title: "Notebooks", Items: []frostui.NavItem{
		{ID: "all", Title: "All notes", Icon: "folder"},
	}}}
	mygo.App.WhenReady(func() {
		mygo.NewWindow(mygo.WindowOptions{
			Title: "Notes", Width: 1100, Height: 720, TitleBarStyle: mygo.TitleBarHidden,
			Content: ui.View(func(c *ui.Context) {
				shell.View(c, frostui.Frame{
					Nav:     nav,
					Content: func() { frostui.PageHeader(c, "All notes", "3 notes", nil) },
				})
			}),
		})
	})
	if err := mygo.App.Run(); err != nil {
		log.Fatal(err)
	}
}

examples/commandcenter adds the palette, the console, the job queue and the status bar: go run ./examples/commandcenter. examples/threepane is a window of panes with no rail: go run ./examples/threepane. examples/sourcelist shows a source list, a command table, a lazy palette source and a settings dialog: go run ./examples/sourcelist.

The source-list example also has Open Example Link in its main menu and command palette, with no new key binding. Its command and helper call Opener.OpenURL for https://example.org on a worker. The UI thread shows pending status and disables duplicate opens until it applies the worker's posted result. The result stays visible, with the URL and any launch error; no status appears before invocation. The headless tests inject Opener.Launch and use frostuitest.Loop to check refusals, results and a responsive UI without a browser or network.

Develop

mise install   # golangci-lint and Node; Go comes from go.mod
make ci        # what CI runs

Design and invariants: docs/design/frostui.md.

Where to go next

About

frostyard's desktop UI kit on MyGo: the command-center shell, palette, console, job queue and components shared by ChairLift, Frostmail and Frostnotes

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages