Android: back button for Learn subpages - #189
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Measured two reported main-window parity gaps against app-gnome.
Confirmed — Android Learn back button. app-gnome shows a visible
go-previous-symbolicback button in the header when a Learn subpage(Tutorial/Examples) is open (
main.window.blp:107, wired inmain.window.tsviahasVisibleSubpage/updateLearnBackButtonVisibility).app-web has the same (
main-window.ts:114,283-286,516-518). Android'sAdw.NavigationViewport has no built-in per-page header/back button(unlike native libadwaita), and the app only handled the hardware/system
back key (
onBackinviews/main/learn.ts) — there was no on-screenaffordance at all.
Fix:
Learn(views/main/learn.ts) now exposeshasVisibleSubpageanda
subpage-changedevent (via@learn6502/core'sEventDispatcher),mirroring the GNOME GObject property and the web
CustomEvent. Theshell (
views/main.ts) packs ago-previousGtk.Buttoninto theheader's start slot, wired to
learnView.navigateBack(), visible onlywhile 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) thattracks a
currentFileand clears the flag on save. app-web hasno file-open/save feature anywhere — no menu entry, no
FileServiceimplementation, not even a "Save" string in the wholepackage. 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 tobe 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 driftns build android(aftergjsify workspace @learn6502/core buildto produce
packages/core/dist) — Vite bundle + Gradle buildsucceeded,
app-debug.apkproducedactually appears/disappears and pops the nav stack — only
statically verified via the wiring above
🤖 Generated with Claude Code