Skip to content

Android: back button for Learn subpages - #189

Merged
JumpLink merged 1 commit into
mainfrom
fix/main-window-parity
Sep 21, 2026
Merged

JumpLink merged 1 commit into
mainfrom
fix/main-window-parity

Conversation

@JumpLink

Copy link
Copy Markdown
Owner

Summary

Measured two reported main-window parity gaps against app-gnome.

Confirmed — Android Learn back button. app-gnome shows a visible
go-previous-symbolic back button in the header when a Learn subpage
(Tutorial/Examples) is open (main.window.blp:107, wired in
main.window.ts via hasVisibleSubpage/updateLearnBackButtonVisibility).
app-web has the same (main-window.ts:114,283-286,516-518). Android's
Adw.NavigationView port has no built-in per-page header/back button
(unlike native libadwaita), and the app only handled the hardware/system
back key (onBack in views/main/learn.ts) — there was no on-screen
affordance at all.

Fix: Learn (views/main/learn.ts) now exposes hasVisibleSubpage and
a subpage-changed event (via @learn6502/core's EventDispatcher),
mirroring the GNOME GObject property and the web CustomEvent. The
shell (views/main.ts) packs a go-previous Gtk.Button into the
header's start slot, wired to learnView.navigateBack(), visible only
while the Learn tab is active and a subpage is open (Android has no
desktop/three-column mode, so that's the whole condition — the GNOME
twin's mobile branch).

Not confirmed as a parity fix — Web "unsaved changes" dot. The
dot widget itself really is absent from app-web's header. But in
app-gnome the dot is the tail of a full Open/Save-file feature
(Gtk.FileDialog + Gio.File, services/file.service.ts) that
tracks a currentFile and clears the flag on save. app-web has
no file-open/save feature anywhere — no menu entry, no
FileService implementation, not even a "Save" string in the whole
package. Building a faithful counterpart means designing app-web's
entire file-persistence story (there is no File System Access API
today; a <input type=file> + Blob-download approach would need to
be chosen), which is a product decision beyond a header-widget parity
fix. Left untouched; flagging for its own task.

Test plan

  • gjsify format / gjsify format --check — clean, no drift
  • ns build android (after gjsify workspace @learn6502/core build
    to produce packages/core/dist) — Vite bundle + Gradle build
    succeeded, app-debug.apk produced
  • Not run: on-device/emulator verification that the button
    actually appears/disappears and pops the nav stack — only
    statically verified via the wiring above

🤖 Generated with Claude Code

app-gnome and app-web both show a visible back arrow in the header
when a Learn subpage (Tutorial/Examples) is open; Android relied
solely on the hardware/system back key, with no on-screen affordance.

Learn now exposes hasVisibleSubpage + a subpage-changed event (mirroring
the GNOME GObject property and the web CustomEvent), and the shell
wires a go-previous header button to it, visible only while the Learn
tab is active and a subpage is open.
@JumpLink
JumpLink merged commit a0cd2f0 into main Sep 21, 2026
3 checks passed
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