Skip to content

Android: the editor's text reaches the assembler, and the tabs come back - #196

Merged
JumpLink merged 1 commit into
mainfrom
fix/android-editor-code-and-switcher
Sep 22, 2026
Merged

JumpLink merged 1 commit into
mainfrom
fix/android-editor-code-and-switcher

Conversation

@JumpLink

Copy link
Copy Markdown
Owner

Two defects found on the emulator while verifying the gjsify link. Both made
the app look finished and do nothing.

The bottom tab bar measured three pixels

Adw.ViewSwitcherBar:reveal defaults to FALSE. In a GNOME window an
Adw.Breakpoint asks for the bar once the window goes narrow, and a wide
window keeps it collapsed in favour of the header-bar switcher. Android has
no wide branch — this shell IS the narrow layout — and nothing ever asked.

The app had no visible way to change page, and the shell measured 1517 px of
a 2400 px screen with white below it. One line, and both symptoms go.

tab bar

Left: before. Right: after — Lernen / Coden / Debuggen / Spielen back at
the bottom, shell filling the screen.

Assemble ran on an empty program

SourceView.codeProperty.register() at the bottom of source-view.ts does
Object.defineProperty on the prototype, which overwrites the get code() /
set code() written in the class body. Those accessors were dead from the
moment the module loaded, while looking authoritative: reads went to
NativeScript's property store, whose value is defaultValue: "", and typing
changes the inner TextView and never that store.

Measured on the emulator after typing LDA #$01:

read value
textChange event "LDA #$01"
textView.text "LDA #$01"
native getText() "LDA #$01"
editorController.code ""

The last line is what Assemble assembled. The toast then said only "Assemble
failed" — the assembler's own message never reaches the port — while the same
program assembles headlessly:

$ learn6502 assemble t.asm
Code assembled successfully, 2 bytes.

The typed text goes back into the property now, through
codeProperty.nativeValueChange(): the direction NativeScript provides for
"the native side moved", which does not re-enter valueChanged's write-back
into the widget the value came from. The dead accessors are gone, and a
comment says why the class has none.

assemble

Verified

  • gjsify workspace @learn6502/app-android run check: exit 0, 0 error TS
  • gjsify format --check: "All matched files use the correct format."
  • On the emulator: four tabs at the bottom, shell fills the screen, and
    LDA #$01 / STA $0200 / BRK reports "Erfolgreich assembliert" with the
    button switching to Run.

Known, not fixed here

  • After the soft keyboard has been shown once, the shell keeps the reduced
    height — tab bar at y=1455 instead of y=2338. Measured, pre-existing.
  • The tab icons render as placeholder glyphs.
  • The assembler's failure message is dropped: the shared controller emits
    assemble-failure with an AssemblerFailureEvent and the Android port has
    no handler for it, so every failure reads "Assemble failed". That is why
    this defect stayed invisible.

🤖 Generated with Claude Code

Two defects found on the emulator, both of which made the app look finished
and do nothing.

**Assemble ran on an empty program.** `SourceView.codeProperty.register()`
at the bottom of `source-view.ts` does `Object.defineProperty` on the
prototype, which overwrites the `get code()` / `set code()` written in the
class body — those accessors were dead from the moment the module loaded,
while looking authoritative. Reads went to NativeScript's property store,
whose value is `defaultValue: ""`, and typing changes the inner TextView and
never that store. Measured after typing `LDA #$01`:

    textChange fired       "LDA #$01"   <- the event is fine
    textView.text          "LDA #$01"   <- the inner widget is fine
    native getText()       "LDA #$01"   <- Android is fine
    editorController.code  ""           <- what Assemble assembled

The toast then said only "Assemble failed" — the assembler's own message
never reaches the port — while the same program assembles headlessly:
`learn6502 assemble` prints "Code assembled successfully, 2 bytes."

The typed text goes back into the property now, through
`codeProperty.nativeValueChange()`, which is the direction NativeScript
provides for "the native side moved" and does not re-enter `valueChanged`'s
write-back into the widget the value came from. The dead accessors are gone
and a comment says why there are none.

**The bottom tab bar measured three pixels.** `Adw.ViewSwitcherBar:reveal`
defaults to FALSE: in a GNOME window an `Adw.Breakpoint` asks for the bar
once the window goes narrow, and a wide window keeps it collapsed in favour
of the header-bar switcher. Android has no wide branch — this shell IS the
narrow layout — and nothing ever asked. The app had no visible way to change
page, and the shell measured 1517px of a 2400px screen with white below it.
One line, and both symptoms go.

Verified on the emulator: the four tabs are back at the bottom, the shell
fills the screen, and `LDA #$01 / STA $0200 / BRK` now says "Erfolgreich
assembliert" with the button switching to Run.

Known, not fixed here: after the soft keyboard has been shown once the shell
keeps the reduced height (tab bar at y=1455 instead of 2338), and the tab
icons render as placeholder glyphs.
@JumpLink
JumpLink merged commit 1c3e88c into main Sep 22, 2026
3 checks passed
@JumpLink
JumpLink deleted the fix/android-editor-code-and-switcher branch September 22, 2026 11:03
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