Skip to content

Screens that change by a click, and gockup updates itself - #4

Merged
omartelo merged 2 commits into
mainfrom
state-and-updates
Dec 3, 2026
Merged

omartelo merged 2 commits into
mainfrom
state-and-updates

Conversation

@omartelo

@omartelo omartelo commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Screens that change by a click. A field's error had to be a second screen, which lost what was typed in the first. While a journey is tried, a click can now change the screen in place:

screen "Register" {
  state error=no
  Flex axis=vertical spacing=16 {
    Editor hint="E-mail"
    When error=yes { Caption text="That is not an e-mail yet" }
    When error=no  { Button text="Create account" set="error=yes" }
    When error=yes { Button text="Create account" goto="Welcome" }
  }
}
  • Only equality: no expressions, and nothing reads what is typed. The board and Present show the screen as it starts.
  • A change is a step of the path, and a step back undoes it. render_screen takes the state to draw a screen in.
  • set and When are now reserved: a design system with a property or a component of that name has to rename it.

Settings › Updates. gockup looks for a new version once a day, when it opens (it can be turned off), tells what is in it, and updates itself in a click.

  • The download is checked against the release's checksums, and the new binary must start and tell its version, before anything is replaced. One that fails leaves gockup as it was.
  • Installed from the AUR or Homebrew, it gives the command instead. Built from source, it only says so.
  • Limits are in docs/ceilings.md: nothing is signed, and the launcher's files stay as installed.

Checked: gofmt, go vet (Windows too), go test -race ./..., and the pages rendered headless in both themes. On Linux, a build stamped v0.3.9 updated itself to the published v0.4.0 and restarted into it. macOS and Windows: only the swap of the files was tested, on Linux, and that the published archives unpack.

A field's error had to be a second screen, which lost what was typed in the
first. A screen declares its state, set changes it on a click, and When has its
children only while the state is the one it names. A change is a step of the
path; render_screen draws a screen in any state.
Nothing told of a release. gockup asks GitHub once a day, when it opens, and a
click downloads the new one, checks it against the release's checksums, sees
that it starts, puts it in this one's place and restarts where the user was.
One a package manager installed is left to it, with the command to copy.
@omartelo
omartelo merged commit bfbabad into main Dec 3, 2026
3 checks passed
@omartelo
omartelo deleted the state-and-updates branch December 3, 2026 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant