Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 8 additions & 2 deletions lib/mix/tasks/mob.add_nif.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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)})}
Expand Down
3 changes: 3 additions & 0 deletions test/mix/tasks/mob_add_nif_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading