Android: the editor's text reaches the assembler, and the tabs come back - #196
Merged
Merged
Conversation
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.
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.
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:revealdefaults to FALSE. In a GNOME window anAdw.Breakpointasks for the bar once the window goes narrow, and a widewindow 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.
Left: before. Right: after —
Lernen / Coden / Debuggen / Spielenback atthe bottom, shell filling the screen.
Assemble ran on an empty program
SourceView.codeProperty.register()at the bottom ofsource-view.tsdoesObject.definePropertyon the prototype, which overwrites theget code()/set code()written in the class body. Those accessors were dead from themoment the module loaded, while looking authoritative: reads went to
NativeScript's property store, whose value is
defaultValue: "", and typingchanges the inner TextView and never that store.
Measured on the emulator after typing
LDA #$01:textChangeevent"LDA #$01"textView.text"LDA #$01"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:
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-backinto the widget the value came from. The dead accessors are gone, and a
comment says why the class has none.
Verified
gjsify workspace @learn6502/app-android run check: exit 0, 0error TSgjsify format --check: "All matched files use the correct format."LDA #$01 / STA $0200 / BRKreports "Erfolgreich assembliert" with thebutton switching to Run.
Known, not fixed here
height — tab bar at y=1455 instead of y=2338. Measured, pre-existing.
assemble-failurewith anAssemblerFailureEventand the Android port hasno handler for it, so every failure reads "Assemble failed". That is why
this defect stayed invisible.
🤖 Generated with Claude Code