diff --git a/CHANGELOG.md b/CHANGELOG.md index d479a3f..cc54a78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -68,6 +68,13 @@ ### Changed +- **`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 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..32bf411 100644 --- a/lib/mix/tasks/mob.add_nif.ex +++ b/lib/mix/tasks/mob.add_nif.ex @@ -767,11 +767,17 @@ 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, or one generated before the Mishka showcase became + the default home screen, 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.