From ca14a3298d8138bab31da3922c63b274e0e2f0a0 Mon Sep 17 00:00:00 2001 From: GenericJam Date: Fri, 11 Sep 2026 23:09:27 -0600 Subject: [PATCH 1/2] MOB-188: add_nif demo notice names both generated home-screen shapes The default generated app is now the Mishka Chelekom showcase, whose home lists demos via Kit.compact_button/2 in demo_buttons/1; nav_button/2 only exists in --blank apps. The notice shows both. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_017skG2QLaK9jFJBbJpW9VS8 --- CHANGELOG.md | 2 ++ lib/mix/tasks/mob.add_nif.ex | 9 +++++++-- test/mix/tasks/mob_add_nif_test.exs | 3 +++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d479a3f..8a1cce9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -68,6 +68,8 @@ ### Changed +- **`mix mob.add_nif --demo` notice names both home-screen shapes** (MOB-188). The generated default app is now the Mishka Chelekom showcase, whose home lists demos through `Kit.compact_button/2` in `demo_buttons/1`; the notice shows that form first and keeps the `nav_button/2` form for `--blank` apps. + - **`mix mob.deploy` now freezes an explicit target set before doing work** (MOB-169). A bare deploy automatically targets exactly one emulator or simulator and never a physical phone. `--device`, `--all-devices`, and diff --git a/lib/mix/tasks/mob.add_nif.ex b/lib/mix/tasks/mob.add_nif.ex index a24c0f0..0ddb375 100644 --- a/lib/mix/tasks/mob.add_nif.ex +++ b/lib/mix/tasks/mob.add_nif.ex @@ -767,11 +767,16 @@ defmodule Mix.Tasks.Mob.AddNif do node = hd(Node.list()) # or use the printed node name :rpc.call(node, Mob.Test, :navigate, [#{inspect(screen)}]) - 2. Wire into your existing home screen — add to its render: + 2. Wire into your existing home screen. In the default generated app + (the Mishka Chelekom showcase) add a button to `demo_buttons/1`: + + Kit.compact_button("#{name} demo", :open_#{name}_demo) + + In a `--blank` app add to the render instead: {nav_button("#{name} demo", :open_#{name}_demo)} - and a `handle_info({:tap, :open_#{name}_demo}, ...)` clause: + Either way, add a `handle_info({:tap, :open_#{name}_demo}, ...)` clause: def handle_info({:tap, :open_#{name}_demo}, socket) do {:noreply, Mob.Socket.push_screen(socket, #{inspect(screen)})} diff --git a/test/mix/tasks/mob_add_nif_test.exs b/test/mix/tasks/mob_add_nif_test.exs index 5ba03f2..ccabdd7 100644 --- a/test/mix/tasks/mob_add_nif_test.exs +++ b/test/mix/tasks/mob_add_nif_test.exs @@ -448,6 +448,9 @@ defmodule Mix.Tasks.Mob.AddNifTest do # The three options the user can pick from. assert notice =~ "Quick test from IEx" assert notice =~ "Wire into your existing home screen" + # Both home-screen shapes mob_new generates: the Mishka showcase grid and --blank. + assert notice =~ ~s|Kit.compact_button("audio_engine demo", :open_audio_engine_demo)| + assert notice =~ ~s|nav_button("audio_engine demo", :open_audio_engine_demo)| assert notice =~ "root screen" # Mentions Logger so the user knows the IEx visibility path. From 2cc6e6fb0284db612c81c13eecc119c08b98a6cd Mon Sep 17 00:00:00 2001 From: GenericJam Date: Sat, 12 Sep 2026 00:11:05 -0600 Subject: [PATCH 2/2] MOB-188: notice wording covers apps generated before the showcase default Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_017skG2QLaK9jFJBbJpW9VS8 --- CHANGELOG.md | 7 ++++++- lib/mix/tasks/mob.add_nif.ex | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a1cce9..cc54a78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -68,7 +68,12 @@ ### Changed -- **`mix mob.add_nif --demo` notice names both home-screen shapes** (MOB-188). The generated default app is now the Mishka Chelekom showcase, whose home lists demos through `Kit.compact_button/2` in `demo_buttons/1`; the notice shows that form first and keeps the `nav_button/2` form for `--blank` apps. +- **`mix mob.add_nif --demo` notice names both home-screen shapes** + (MOB-188). Once mob_new #68 lands, the generated default app is the + Mishka Chelekom showcase, whose home lists demos through + `Kit.compact_button/2` in `demo_buttons/1`; the notice shows that form + first and keeps the `nav_button/2` form for `--blank` apps and for apps + generated before the change. - **`mix mob.deploy` now freezes an explicit target set before doing work** (MOB-169). A bare deploy automatically targets exactly one emulator or diff --git a/lib/mix/tasks/mob.add_nif.ex b/lib/mix/tasks/mob.add_nif.ex index 0ddb375..32bf411 100644 --- a/lib/mix/tasks/mob.add_nif.ex +++ b/lib/mix/tasks/mob.add_nif.ex @@ -772,7 +772,8 @@ defmodule Mix.Tasks.Mob.AddNif do Kit.compact_button("#{name} demo", :open_#{name}_demo) - In a `--blank` app add to the render instead: + In a `--blank` app, or one generated before the Mishka showcase became + the default home screen, add to the render instead: {nav_button("#{name} demo", :open_#{name}_demo)}