Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ jobs:
sh scripts/get_test.sh
sh scripts/release_test.sh
sh scripts/apk_test.sh
sh scripts/apk-release_test.sh

changelog:
if: github.event_name == 'pull_request'
Expand Down
13 changes: 11 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,18 @@ renames `## Unreleased` to the next patch of the newest release, such as
`## v0.2.1` after `v0.2.0`, or to the version you pass, and opens a
`Release v0.2.N` pull request. Once that merges, `git pull --ff-only` and
run `sh scripts/release.sh --tag`. It tags the release commit on `main` and
pushes the tag once, which starts the release build. Either step takes
`--dry-run`.
pushes the tag once, which starts the release build. It then waits for the
GitHub release, builds the arm64 APK from the tag and attaches
`pitwall-phone.apk`. The signing key stays in the main checkout's
`dist/android/debug.keystore`, or at `PITWALL_APK_KEY`; it never goes to CI.
Without that key or the Android SDK/NDK, tagging still succeeds and prints
the retry command, `sh scripts/apk-release.sh vX.Y.Z`. Either release step
takes `--dry-run`.

## Unreleased


- Attach the Android APK to releases from the maintainer's computer. The Android app checks on launch, daily while open, or through Check for updates in Settings. Install downloads the APK with progress and a size check, then uses Android's installer and its required confirmation. Dismissing a version hides it until a newer one ships.
## v0.2.9

- Keep messages sent during a Claude Code turn in the phone chat at their transcript position after reopening it.
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ mise exec -- go -C third_party/x-vt test -race -timeout 5m ./...
sh scripts/get_test.sh
sh scripts/release_test.sh
sh scripts/apk_test.sh
sh scripts/apk-release_test.sh
```

### macOS
Expand Down
13 changes: 11 additions & 2 deletions docs/maintainers.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,18 @@ does, and what to check around it.
3. Tag that commit on `main` with `v0.2.N` and push the tag on its
own. The release workflow verifies that the tagged commit belongs to `main`
before building and publishes the release as the latest one.
4. Review the six platform archives, `checksums.txt`, notices and release notes
4. `scripts/release.sh --tag` waits for the release and builds the arm64 APK
in a clean temporary worktree at the tag. It uploads `pitwall-phone.apk`
with the signing key from the main checkout's `dist/android/debug.keystore`,
or `PITWALL_APK_KEY`. Keep this key on the maintainer's computer, outside CI.
Without the key or Android SDK/NDK, the script skips the APK after pushing
the tag. Run `sh scripts/apk-release.sh vX.Y.Z` once those are available.
This command also retries a failed build or upload without moving the tag.
The APK must declare its installation permission and result receiver before
upload. Prerelease tags skip the APK step because phone updates use stable releases.
5. Review `pitwall-phone.apk`, the six platform archives, `checksums.txt`, notices and release notes
on the GitHub release before announcing it.
5. Push the AUR package by hand, as below. The workflow updates Homebrew and
6. Push the AUR package by hand, as below. The workflow updates Homebrew and
Scoop itself.

The **release tags: immutable** ruleset blocks updates and deletion of `v*`
Expand Down
32 changes: 26 additions & 6 deletions docs/phone.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,24 @@ copy of the chat drops the request.
The same tabs and chats also come as an Android app: pitwall's own
sidebar as the home screen, and each agent tab's chat with model, effort
and send on the message box. It talks to the phone page's API, so turn the
page on and reach it as above first. There is no store listing; you build
the APK and install it yourself.
page on and reach it as above first. Download
[`pitwall-phone.apk`](https://github.com/quanticstudios/pitwall/releases/latest/download/pitwall-phone.apk)
from the latest GitHub release, or build the APK yourself. There is no store listing.

The app checks GitHub on launch and every 24 hours while open. Check daily
in Settings turns those automatic checks on or off. Check for updates runs
a check immediately, even when daily checks are off. Its status says Checking,
Up to date with the installed version, a failure reason, or which version is out.
Dismiss on the session list hides that version across launches.

When a newer release has its APK attached, the session list and Settings offer
Install. The app downloads the APK into its cache with a progress bar, checks
the byte count against the release asset, then asks Android to install it.
Downloads and redirects must use HTTPS on GitHub's download hosts. On the first
install, allow pitwall to install unknown apps in the settings screen it opens,
then return. Android still requires a tap on its installation confirmation.
The app reports cancellation or Android's failure message and removes the
cached APK after the installation result. Android checks the signing key.

### Pictures

Expand Down Expand Up @@ -225,20 +241,24 @@ build-tools, a platform and the NDK, and runs Java 17 through mise
(`java@temurin-17`). The APK is for arm64 phones; `ARCH=amd64` builds one
for the x86_64 emulator, and `ARCH=arm64,amd64` one for both. It is signed
with a debug key the script makes on first use, `dist/android/debug.keystore`,
which git ignores. Keep that file: Android installs an update only over an
APK signed with the same key.
which git ignores. `PITWALL_APK_KEY` selects an existing key instead. Keep
that file: Android installs an update only over an APK signed with the same
key. A self-built APK with another key cannot take the release APK as an update.

The script stamps the APK with pitwall's version: the highest stable
release tag the commit contains, and the commits since. A build 3 commits
after tag v0.2.6 gets versionName `0.2.6.206003` and versionCode 206003:
after tag v0.2.6 gets versionName `v0.2.6` and versionCode 206003:
the tag's three numbers as two digits each after the first, then the
commit count as three. Each release and each commit after it raises the
code, so Android takes every newer build over the last. A maintenance tag
merged in later, such as v0.2.10 into v0.3.x, does not lower it. The
script refuses a shallow clone (`git fetch --unshallow --tags` first),
since it would count too few commits, a tag whose minor or patch is 100 or
more, and a build more than 999 commits after its tag. `sh scripts/apk.sh --version` prints the
name, the code and the version the app shows without building.
three-part number, the code and the version the app shows without building.
The app shows the exact tag on a release build, or the tag plus commit count
and hash on a build after it. A build after a tag never offers that same tag
as an update.

### Install

Expand Down
50 changes: 50 additions & 0 deletions internal/ui/kit/switch.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package kit

import (
"image"
"image/color"

"gioui.org/io/pointer"
"gioui.org/io/semantic"
"gioui.org/layout"
"gioui.org/op"
"gioui.org/op/clip"
"gioui.org/op/paint"
"gioui.org/widget"

"github.com/quanticstudios/pitwall/internal/ui/theme"
)

// Switch draws an on/off control with the theme's track and knob.
func Switch(gtx layout.Context, th *theme.Theme, c *widget.Clickable, on bool) layout.Dimensions {
return c.Layout(gtx, func(gtx layout.Context) layout.Dimensions {
sz := image.Pt(gtx.Dp(32), gtx.Dp(18))
hit := image.Pt(sz.X, max(sz.Y, gtx.Constraints.Min.Y))
semantic.Switch.Add(gtx.Ops)
semantic.SelectedOp(on).Add(gtx.Ops)
semantic.EnabledOp(gtx.Enabled()).Add(gtx.Ops)
defer op.Offset(image.Pt(0, (hit.Y-sz.Y)/2)).Push(gtx.Ops).Pop()
knob, in := gtx.Dp(14), gtx.Dp(2)
track := theme.Mix(th.SurfaceElevated, th.Fg, 0.12)
ring, x := track, in
if on {
track, ring, x = th.Primary, th.Primary, sz.X-in-knob
}
if c.Hovered() {
track = theme.Mix(track, th.Fg, 0.08)
}
paint.FillShape(gtx.Ops, ring, clip.UniformRRect(image.Rectangle{Max: sz}, sz.Y/2).Op(gtx.Ops))
paint.FillShape(gtx.Ops, track, clip.UniformRRect(image.Rect(1, 1, sz.X-1, sz.Y-1), sz.Y/2-1).Op(gtx.Ops))
fg := th.Muted
if on {
fg = color.NRGBA{R: 0xff, G: 0xff, B: 0xff, A: 0xff}
}
paint.FillShape(gtx.Ops, fg, clip.UniformRRect(image.Rect(x, in, x+knob, in+knob), knob/2).Op(gtx.Ops))
if gtx.Focused(c) {
FocusRing(gtx, th, image.Rectangle{Max: sz}, sz.Y/2)
}
defer clip.Rect{Max: sz}.Push(gtx.Ops).Pop()
pointer.CursorPointer.Add(gtx.Ops)
return layout.Dimensions{Size: hit}
})
}
41 changes: 41 additions & 0 deletions internal/ui/kit/switch_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package kit

import (
"image"
"testing"

"gioui.org/io/input"
"gioui.org/io/semantic"
"gioui.org/layout"
"gioui.org/op"
"gioui.org/unit"
"gioui.org/widget"

"github.com/quanticstudios/pitwall/internal/ui/theme"
)

func TestSwitchTouchAreaAndSemantics(t *testing.T) {
for _, on := range []bool{false, true} {
var c widget.Clickable
var r input.Router
var ops op.Ops
gtx := layout.Context{Ops: &ops, Source: r.Source(), Metric: unit.Metric{PxPerDp: 1, PxPerSp: 1}, Constraints: layout.Constraints{Min: image.Pt(0, 32), Max: image.Pt(100, 100)}}
d := Switch(gtx, theme.Dark(), &c, on)
if d.Size != image.Pt(32, 32) {
t.Fatalf("touch area: %v", d.Size)
}
r.Frame(&ops)
found := false
for _, n := range r.AppendSemantics(nil) {
if n.Desc.Class == semantic.Switch {
found = true
if n.Desc.Selected != on {
t.Fatal("switch misreports its state")
}
}
}
if !found {
t.Fatal("switch has no Switch semantic role")
}
}
}
Loading
Loading