Skip to content

docs: fix undefined tap/1 in getting_started example (closes #46) - #63

Merged
GenericJam merged 1 commit into
masterfrom
docs-fix-tap-example-gh46
Jul 5, 2026
Merged

docs: fix undefined tap/1 in getting_started example (closes #46)#63
GenericJam merged 1 commit into
masterfrom
docs-fix-tap-example-gh46

Conversation

@GenericJam

Copy link
Copy Markdown
Owner

What

The "Your first screen" example in guides/getting_started.md used:

<Buttontext="Tap me" on_tap={tap(:increment)} />

There is no tap/1 function — use Mob.Screen imports Mob.Sigil (which has no tap helper), so a newcomer pasting the getting-started example hits a compile error: undefined function tap/1. Reported as #46.

Fix

Use the canonical inline tuple, which the example's existing handle_info({:tap, :increment}, ...) already handles:

<Buttontext="Tap me" on_tap={{self(),:increment}} />

This matches the form already used in Mob.Sigil's own docstring (lib/mob/sigil.ex:23), guides/screen_lifecycle.md, and guides/device_capabilities.md — getting_started was the only doc with the broken form. Also added one clause to the walkthrough prose explaining the {self(), :increment}{:tap, :increment} wiring, since that mapping was previously unexplained.

Verification

Compiled the corrected module (use Mob.Screen + the ~MOB sigil) and called render/1 — it compiles and produces a valid render tree, where the old form was a hard compile error. Docs-only; no code paths touched.

Closes#46.

🤖 Generated with Claude Code

The example used `on_tap={tap(:increment)}`, but no `tap/1` exists — `use
Mob.Screen` imports the sigil, not a `tap` helper — so pasting the getting-
started example produced a compile error (GH #46). Use the canonical inline
tuple `on_tap={{self(), :increment}}` (matches `Mob.Sigil`'s own docstring,
screen_lifecycle.md, and device_capabilities.md), which the existing
`handle_info({:tap, :increment}, ...)` already handles. Added a clause to the
walkthrough explaining the `{self(), :increment}` → `{:tap, :increment}` wiring.
Verified: the corrected module compiles and renders a valid tree.
Closes#46.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@GenericJam
GenericJam merged commit aef9917 into masterJul 5, 2026
4 checks passed
GenericJam added a commit that referenced this pull request Jul 5, 2026
Ships MOB-14 (#62): Mob.Device.network_state/0 + online?/0 + the :network
subscribe category. %{online, transport, expensive, validated, constrained},
with :unavailable where a platform can't answer. iOS NWPathMonitor + Android
ConnectivityManager.NetworkCallback (Kotlin bridge via mob_new 0.4.18+).
Device-verified on iOS sim + moto g power (2021). Also ships doc fixes#63/#64.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
GenericJam added a commit that referenced this pull request Jul 5, 2026
Ships MOB-20 (#66): Mob.Device.keep_awake/1 prevents screen auto-dim/lock, no
permission. Device-verified both directions on moto g power (2021) + iPhone SE
(3rd gen). Android Kotlin bridge ships via mob_new 0.4.19+.
(0.7.16 was taken by the parallel connectivity release, which already folded in
the docs from #63/#64 — so #65 is superseded.)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
GenericJam added a commit that referenced this pull request Sep 1, 2026
Records the two merged doc-only PRs under a new [0.7.16] section so they're
ready for the next release (doc changes only reach hexdocs via a publish).
No mix.exs bump — this stages the entry without triggering release.yml.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for freeto 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.

undefined fuction tap/1 in HomeScreen example

1 participant

@GenericJam