Skip to content

iOS shell: art-led library, Cover Flow, settings and the host layer for iPhone and iPad - #226

Merged
LNPANDY merged 42 commits into
mainfrom
v0lumehi/ios-shell-ui-2
Oct 31, 2026
Merged

LNPANDY merged 42 commits into
mainfrom
v0lumehi/ios-shell-ui-2

Conversation

@v0lumehi

@v0lumehi v0lumehi commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Fix or feature

  • Fix
  • Feature

What and why

Route C, end to end (M1, M2, M3)

This PR is now the complete Route C shell. It folds in #144 (M1, patches 0045 to 0049) and adds M2 and M3 on top of the views and the host layer described further down.

What works end to end. In the Mac launcher, pick a game and choose the iPhone / iPad target. It is the only iPhone target, there is no per-game IPA any more. The launcher builds only that game's framework (the NSP script's --shell-framework, build_ipa.sh DM_FRAMEWORK_ONLY), adds it to the shell library (shell.json in the shell folder), generates the shell with dm/ios/tools/build_shell.sh (dm/ios/project-shell.yml: the engine host plus every embedded framework, the frontend-ios package linked as a local Swift package), signs it with the player's team, installs it over the existing app and copies only the game files the device lacks. On the device there is one app (named NX2Apple under its icon, no wordmark in its screens) whose library lists every game from its embedded framework, with the eShop banner the launcher caches. Play sets the game's environment (EngineLaunchPlan: DM_PROFILE from the framework, the data in Documents/games/<title ID>/, the player's per-game settings with the per-game app's keys), dlopens the framework, calls dm_set_game_image_header, starts the host and hands the window to the game view. One game per process: leaving the game is a relaunch. A normal start always opens the library (DM_SHELL_PLAY in a devicectl launch environment is a test switch only).

The Builds page has two targets, This Mac and iPhone / iPad. A game that an earlier version built as its own app or IPA stays in the library as an "Older iPhone build", and Build makes it again for the shared app.

The Builds page with the two targets, This Mac and iPhone / iPad

How the install target works. The pure parts are in frontend/Sources/NSPortBuilder/ShellInstall.swift and also run headless (NSPortBuilder --install-shell …). The game data copy compares the device's listing with the local game folder by path and size and copies file by file, never with --remove-existing-content (a fake devicectl in the tests models that it wipes siblings). Before a copy the launcher checks the device's free space (the shell writes it to Documents/shell-log.txt) and says how the device is connected: over a cable keep it unlocked, over Wi-Fi an estimate and a way to wait for a cable. A device that was never paired gets the steps before the build starts. A copy that stops midway leaves an incomplete-data row whose Retry finishes it, and the shell does not treat a short romfs.img as data (the manifest's identity names the size). A team whose profile cannot carry the Increased Memory Limit gets a shell signed without it, and the log says so.

How re-signing keeps the data. The shell's bundle ID is chosen once (org.nxnative.shell, or org.nxnative.shell.<team> when the plain one is taken) and stored in shell.json. Every later install and the 7-day re-sign build with that same ID and install over the existing app, so Documents (game data, saves) stays.

Engine patches (fork-only unless said otherwise, see patches/): 0050 the shell project, its glue and the framework-only build, 0051 the NSP script's --shell-framework, 0052 the front ends' progress hook (forwarded as seedds/nxnative#742, not used by the shell yet), 0053 the runtime profile read by every host site, so one host binary runs every game of the shell.

Verified on a device (iPhone 17 Pro Max, iOS 27.0.1, installed through the launcher's code path, data copied over the cable):

  • M1 and M2: Breath of the Wild (01007EF00011E000, 1.9.0) loads from DmGame01007EF00011E000.framework (boot: game framework …, the module bases of main, subsdk0 and sdk), mounts its RomFS image and both DLC from Documents/games/01007EF00011E000/ and plays in the shell.
  • M3: Hades (0100535012974000) was added next to it through the same install target. Both show as ready with their banners, both start from the shell on the one host binary, and Breath of the Wild's 15 GB in Documents stayed untouched by the reinstall.
  • The new settings UI: long choices as a list, a fixed top bar over the settings.

Settings reach the game. Play passes the game's settings from the shell as the engine's environment, and the boot log lists every setting it passes. A change in the library applies at the next Play. The performance HUD needs MTL_HUD_ENABLED before Metal makes its first device, so the shell turns Metal's HUD on at every start and the game view sets its layer's HUD mode from DM_METAL_HUD. While Upscaling is MetalFX the HUD shows MetalFX's rows.

Follow-ups: M4 (external drive, per-game msl, pso and profile overrides, DLC beyond aoc/), M5 (incremental frameworks, broken-framework tolerance on a device, re-sign timing), the shell's own "Preparing shaders" screen on the progress hook of 0052, Increased Memory Limit for the shell (it needs the team's current Program License Agreement accepted in the developer account).

The views (frontend-ios/) and the host layer

Route C (#144) needs one shell app that holds several games. This PR is its view layer for iPhone and iPad, in a new Swift package frontend-ios/ with a ShellUI library, a small ShellControllers library and a demo app. It builds on the first pass Codex made (the input types, the focus model and its tests, the size-driven layouts, the state handling, the palette and Manrope), and replaces its visual design, which read as a grid of identical grey boxes.

ShellUI stays view-only. It does no file access, persistence, picker logic or networking. Views take plain values and report through closures, and the host layer below (ShellHost, in this PR too) fills them:

  • GameTile, GameDetail, SettingSection, SettingRow (toggle, choice, range), ControllerInfo
  • GameState: playable, needs game data, needs an app update, or broken with a short reason (such as "Game files damaged") and an optional detail
  • Artwork: a game's picture decoded once by the host, from file bytes or a CGImage. GameTile.banner is the 16:9 key art (the eShop banner the Mac launcher caches per title ID, or a docs/images picture), GameTile.icon the optional square NACP icon. Without either, a calm placeholder is drawn from the title.
  • ShellActions: onSelect, onPlay, onChange(game, setting, value), onPickGameData, onUseAppData, onPickCloudSaves, onDisableCloudSaves, onResetDefaults, onShowLog, onAppUpdate, onBack. No closure was added for the How to fix and How to update explanations: they are local UI and call onShowLog and onAppUpdate from inside.
  • ShellInput: an optional semantic controller event (direction, A, B, X, Y) with the device that sent it, so the hints draw that device's glyphs

ShellControllers is kept apart from the views: GamepadAdapter reads every GameController controller and reports ShellInput actions and the connected controllers with their battery, mirroring the Mac console (the same mapping by label, deadzone and repeat on hold). The demo uses it, the real shell can too.

Design note

The reference is the Mac launcher: big 16:9 key art, a status dot, a cream Play capsule, a collection of wide banner tiles, Manrope throughout. The iOS shell keeps that and adds the console's Cover Flow when the screen is on its side.

  • Cover Flow, centred on the screen. The centred card's middle is the screen's middle, the top bar lies over it. Neighbours turn back 24 degrees, shrink and tuck behind the middle card, a deck rather than a row, which suits wide banners better than the steep turn of square covers. The carousel moves one card per gesture, counted from where the touch began, a swipe that settles always selects the card in the middle, and the view never scrolls itself while a finger is down. The backdrop is the centred banner, heavily blurred.
  • The card is the button. A tap on the centred card does what the game needs (Play, choose its data, how to fix it, how to update), a tap on a side card brings it to the middle, a long press opens its settings. Under the card only the title (two lines reserved) and one line, at a fixed place.
  • State as a dot. Each card carries a small dot in its top-left corner (green ready, amber needs data or an update, grey damaged) on a dark ring for light art. A ready game shows no words. A game that cannot start gets one line in the state colour with its way out ("Choose game data…", "How to fix", "How to update"). The portrait row and the iPad grid use the same dot, with the state under the name only where something is needed. VoiceOver reads the state.
  • Portrait hero. One height per layout, the banner filling it behind bottom-aligned words, so a short title shows more art and nothing below moves between games. The hint line appears only where a game cannot start. Play and the settings button sit at the bottom for the thumb.
  • Settings on demand. The settings button, X on a controller or a long press open them. Where the library stays in view beside it, they drop in exactly like the Controllers overlay: the same 520 point panel from the trailing edge, the same dimming, slide and dismissal (Back, B, a tap outside). Where it would be cramped (a phone held upright, a folded foldable, narrow windows) they take the whole screen. Inside, a 16:9 banner fills the header edge to edge, while square or portrait art shows whole as a rounded cover (beside the words on a wide screen, above them on a narrow one) on a heavily blurred fill of itself. The art fades into the page over a long distance, so there is no edge line.
  • Settings controls. Segmented choices have equal segments across the card (two rows, then a list, when the labels do not fit), buttons in a card share its width, switches respond at once and only the changed row redraws.
  • One type scale with the Mac (ShellType in ShellStyle.swift): the same Manrope file, the same weight per role, the same tracking for capitals, sizes adapted to iOS and scaled with Dynamic Type.
Role Mac iOS
Hero title heavy, up to 68, tracking -1.6 heavy 32 (24 folded, 34 iPad), tracking -0.024 per point
Cover Flow title console title, bold 36, tracking -1.6 bold 28 (18 on a phone on its side)
Page title (settings, controllers, help) heavy 26, tracking -0.6 heavy 26, tracking -0.6
Section capitals console label, semibold 14, tracking 2 semibold 11.5, tracking 1.6
Status eyebrow bold 12, tracking 1.3 bold 11.5, tracking 1.3
Status medium 13 medium 12.5
Card title semibold 16 semibold 14.5
Setting label medium 14 medium 15
Note regular 12 regular 12.5
Meta line regular 13 regular 13
Button semibold 13 semibold 14
Primary button bold 18 bold 17
  • What it avoids. No purple gradients, no glass panels, no evenly weighted grid of identical cards, no emoji, no product name anywhere on screen.

Layouts per form factor

Only the available size decides (ShellLayout), never the device model, idiom or orientation.

Size Library Settings
Compact and taller than wide: iPhone portrait, the folded foldable, Split View One column: the banner hero, a row of wide cards with state dots, recently played, Play at the bottom The whole screen
Regular, not wide: iPad portrait The library alone: the hero with Play and the settings button, a grid of wide cards, recently played The Controllers-style overlay
Regular, not wide, narrow: the unfolded foldable held like a book The same library, two columns The whole screen (too narrow for both)
Wider than tall: iPhone and iPad landscape, the unfolded foldable on its side Cover Flow centred on the screen, controller hints while a controller or keyboard is in use (in the top bar on a phone) The Controllers-style overlay, or the whole screen on the folded foldable

Settings are one view in one place for every layout, so open settings stay open, with their scroll position and edits, across a fold, a rotation or a Stage Manager resize.

The game page's banner runs edge to edge behind the status bar, with Back floating over it in a blurred chip. Game settings and Controllers also close with the system's left-edge swipe, which follows the finger and can be cancelled halfway.

Controller first: the D-pad and stick move a cream focus ring, A activates, B backs out, X opens settings, Y opens controllers. The glyphs follow the device used last (letters for Xbox and Nintendo, the shapes for PlayStation, key caps for a keyboard) and touch hides them again. A hardware keyboard works the same way: arrows, Return, Escape, O for settings, Y for controllers. Dynamic Type works up to the largest accessibility size.

The foldable

Xcode 27.1 lists the iPhone Duo device type, but it needs an iOS 27.1 Simulator runtime and only iOS 27.0 is installed, so simctl create fails. Instead the demo's --fold-test puts the running shell in a frame that switches between a 1.4:1 folded size (375 x 525) and a larger nearly square unfolded size (626 x 890), in both orientations, on an iPad Pro 11-inch (M5) Simulator. These sizes exist only in the demo harness. testFoldKeepsSelectionSettingsAndScroll checks that the selected game, an edited toggle, the open settings and their scroll position survive folding, unfolding and folding again.

Host layer (ShellHost)

A second library turns real files into the view values and acts on the closures. It was folded in from #248 so the views and their wiring are reviewed together.

  • Catalogue: games come from a Games/<titleID>/ folder, each with game.manifest.json (the schema in docs/launcher-c-plan.md) and launcher.json (docs/launcher.schema.json), plus an optional banner and icon. The state follows from what is there: a reachable game-data folder, the shader chain and min_os against this build, a missing framework or a damaged manifest (broken, with the reason).
  • Settings: stored per game in a defaults suite with the same key names as the per-game app's LauncherSettings, so the engine can read them later. Reset restores the tested defaults from launcher.json. Dependent rows (such as Sharpness under FSR) follow the profile.
  • Game data: Choose game data opens the Files folder picker and keeps a security-scoped bookmark per game. Use app data switches back to Documents/games/<titleID>/ (patch 0003's layout).
  • Cloud saves: the folder choice and turning it off are stored per game. There is no sync logic yet.
  • Log and update: a read-only sheet for the engine log of the game's last run (Documents/log.txt when its first lines name the game's framework), and a link to the releases page.
  • Launching: a GameLauncher protocol with a stub that says launching is not available yet. M2 of Route C (Route C M1: the game's modules as a framework (opt-in) #144, @LNPANDY) plugs the real launcher in there, without touching the views.
  • Tests: 52 unit tests for parsing (including damaged files), state, settings and reset, bookmarks and the stub, 8 fixture bundles without copyrighted art or game data, and 3 UI tests. The demo starts in host mode with the fixtures, and --samples brings back the sample games.

Open points for M2: the manifest has no minimum shell version yet (the state uses chain and min_os), and whether the engine reads the shell's per-game suite or the shell copies the values over.

Checked

  • Tests: swift build and swift test in frontend-ios/ (focus navigation, the size-to-layout and settings-overlay rules, the Cover Flow snap, and the controller mapping, deadzone, repeat timing and glyph families). The demo builds with xcodebuild -sdk iphonesimulator. UI tests on the iPhone 17 Pro and iPad Pro 11-inch (M5) Simulators, iOS 27.0: all pass on both (the fold tests run on iPad only). They cover controller input, touch swipes and taps in Cover Flow (iPhone, iPad and the unfolded stand-in), a slow drag followed by a quick swipe, the How to fix sheet, the short shelf, rotation and the fold. python3 scripts/patches.py check passes, nothing vendored changes.
  • Visual QA: many rounds of captures of every screen and state with real art and with drawn art, each reviewed against the Mac launcher (NX_LAUNCHER_CAPTURE_DIR).
  • After the rebase onto main (PR template asks fix or feature, ideas skip the problem form, triage reads fenced fields #276 to Console mode starts games fullscreen, and the pointer hides when idle #280): swift build and swift test in frontend/ pass, python3 scripts/patches.py check passes with main's 0032 before this PR's 0045 to 0053, and the frontend-qt, patches and .github/scripts unit tests pass.
  • Settings on the device (iPhone 17 Pro Max, iOS 27.0): the performance HUD with MetalFX's rows and the game language apply in Breath of the Wild and Hades. Render scale reaches the game, the log says "3D views rendered at 0.50" and "3D views rendered at 1.00" of the game's size for the two settings. Its visual effect in the open world is not verified on the device yet.
  • App icon: Xcode 27.1 compiles frontend-ios/AppIcon.icon into the shell and the demo app. The shell build test checks that the app names AppIcon and has an Assets.car. The shell with the icon was installed over the existing app on the iPhone 17 Pro Max, and the games and saves stayed.
  • Run on a device or Mac: the demo was built, installed and tested on an iPhone 17 Pro Max over several rounds, and the changes above come from that testing. No iPad, foldable, physical controller or VoiceOver session was tried yet (labels were checked through the accessibility tree in the UI tests).

Screenshots

There is no before: the shell is a new app. The demo captures below show the layouts. The first three are the shell built from this branch on an iPhone 17 Pro Max: the library with two games, and the performance HUD and the German game language chosen in the shell, in Hades (with MetalFX's rows) and in Breath of the Wild.

The shell library with two games on an iPhone Hades started from the shell with the performance HUD and MetalFX rows Breath of the Wild started from the shell with the performance HUD

The app icon is frontend-ios/AppIcon.icon, made in Icon Composer:

The app icon

Phone on its side, Cover Flow with the state dot and the action line, then a ready game, then a damaged one:

Settings as the Controllers-style overlay, a banner game and a square-art game:

Phone held upright, library and the full-screen settings page:

iPad with the settings overlay in landscape and portrait, and the library alone:

The foldable stand-in, folded and unfolded on its side:

The controller focus ring with the glyph hints, and the largest text size:

Scope

A product change: it waits 48 hours before merging, and @LNPANDY owns Route C.

@v0lumehi

v0lumehi commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator Author

Screenshots of the current design: 16:9 banners, the reworked Cover Flow, and settings that open only on demand. iOS Simulator (iOS 27.0), demo started with --real-art, so the banners are read at runtime from the Mac launcher's artwork cache and docs/images. No image is committed to the app. Entries without art (Amber Hours) show the drawn placeholder. The foldable shots use the demo's --fold-test stand-in, since the iPhone Duo runtime is not installed yet.

iPhone 17 Pro

Library, portrait Settings State in the hero (broken) Largest text size

Cover Flow, landscape

Controllers, landscape

iPad Pro 11-inch

Library, portrait Settings on demand, portrait Cover Flow with controller focus, landscape

Foldable stand-in (1.4:1 folded, nearly square unfolded)

Folded Unfolded, upright Unfolded, settings open Unfolded, on its side

@v0lumehi v0lumehi added ios iPhone or iPad enhancement New feature or request labels Oct 30, 2026
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Oct 30, 2026
@v0lumehi
v0lumehi marked this pull request as draft October 30, 2026 01:42
@v0lumehi v0lumehi changed the title iOS shell views: art-led library, Cover Flow and settings for iPhone and iPad iOS shell: art-led library, Cover Flow, settings and the host layer for iPhone and iPad Oct 30, 2026
@github-actions github-actions Bot added patch-queue Changes the patch queue or the upstream pin ci Workflows and repository tooling labels Oct 30, 2026
@github-actions github-actions Bot added launcher The NX2Apple launcher app mac Mac windows Windows (the Qt front end) labels Oct 30, 2026
@v0lumehi
v0lumehi force-pushed the v0lumehi/ios-shell-ui-2 branch from ebd9441 to afb70f7 Compare October 30, 2026 23:03
@v0lumehi
v0lumehi marked this pull request as ready for review October 30, 2026 23:23
@v0lumehi

Copy link
Copy Markdown
Collaborator Author

@LNPANDY this is ready for your review. CI is green on 3dccebe5.

Since your last look:

  • The iOS shell is the only iPhone / iPad target. The launcher offers "This Mac" and "iPhone / iPad". A game built the old way shows as "Older iPhone build", and an old saved target is migrated.
  • The detail page banner runs edge to edge, and a swipe from the left edge goes back.
  • The Cover Flow top bar has room above it on a phone held sideways, and large text no longer pushes it down.
  • The app has the new Liquid Glass icon.

It is installed on my iPhone with my games and saves. The screenshots in the description show the current state.

This changes the product, so I will not merge it without your review.

A choice row stays segmented only with 2 to 4 options whose labels fit their segment at the current width and text size
(ChoicePresentation). Every other choice is a compact row with the current value and a chevron that opens a list of the
options with a checkmark, in the shell's look and with the controller focus (A picks, B closes). The settings keep their
Library button in a non-scrolling bar with an opaque backing, so scrolled content never shows under it. A test checks that a
setting changed in the views reaches the engine's environment.
A game rebuilt since its last install had a fresh framework without banner.jpg, and only the game being installed got one.
main added the German catalog. The shell tests compare the notes with the app's own language.
…when it is off

t_gfx_suspend and t_nvn link hle_nvn.c without the host stubs, so dm_prof() from 0042 was undefined there and the
Mac host build check failed. Present snapshots (Frame buffering) now also log a line when they are off, so the
log shows the setting in both states.
…y, with MetalFX's rows

Metal reads MTL_HUD_ENABLED when the first device is made, and the library makes one long before Play. The shell
now turns Metal's HUD on at every start and the game view sets its layer's HUD mode from DM_METAL_HUD, so a change
in the library applies at the next Play. MTL_HUD_HIDE_METALFX_METRICS stays unset, so the HUD shows the MetalFX
scaler while Upscaling is MetalFX. Every setting the shell passes is logged at boot.
0041 moves before 0039 so the front_ios.m change lives in the shell patch.
The shell's engine writes Documents/log.txt, which the log sheet never read, so it always said there is no log.
It now shows that file when its first lines name the game's framework.
The shell app and the demo app had no icon on the home screen. Both now
use frontend-ios/AppIcon.icon, a Liquid Glass icon made in Icon Composer.
The shell project sets ASSETCATALOG_COMPILER_APPICON_NAME to AppIcon and
the shell build test checks that the built app carries it.
… bar and Back

The settings pane put Back in an opaque page-coloured bar above the banner, so the banner started below a black strip. Back now floats over the banner in its material chip and the banner starts at the top edge of the screen.
Both are overlays over the library, not a navigation stack, so UIKit's back swipe never applied to them. A UIScreenEdgePanGestureRecognizer on the window drags the open page with the finger. A swipe past a third of the page or a fling closes it, anything shorter springs back. The recognizer only starts at the screen edge, so sliders and the cover carousel are not affected.
… gone

The Builds page has two targets now: This Mac, and iPhone / iPad. The
iPhone / iPad card builds the game into the one shared app on the device
(its subtitle: "One app on your iPhone or iPad for all your games.").
The separate shared-app card and the per-game IPA target are removed,
with the build path, the single-game sign-and-install, the transfer
question, the install guide and their strings in every language.

Older builds: a game that was built as its own app or IPA stays in the
library and nothing on disk is deleted. It shows as "Older iPhone build".
Build makes it again for the shared app, and Re-sign explains that
instead of failing. A shared-app build clears the old IPA path.

Settings: a saved "ios" or "ios-shell" build target (and a library
game's last target) becomes the iPhone / iPad target. A missing value
still means iPhone / iPad.

scripts/build_ipa_from_nsp.py and frontend-qt are not touched.
The top bar sat 4 pt below the screen edge when the phone is turned, because there is no status bar there. It now sits 12 pt below it, and the space the cards keep clear follows the bar instead of a second number.

The title and the chips already share one centred row. At the largest text sizes the glyph hints in that row wrapped into a tall block and the centred title and chips sank into the screen. The row now stops growing at xxLarge on a phone on its side, as the title under the card does.
… pre-build tests

The Qt table follows Localization.swift again after the removed strings.
The pre-build tests (failure rows, override, cloud folder) now choose the
Mac target themselves, because the iPhone / iPad target stops first at the
device check. The Qt escape test reads the unescape helper directly, as no
table entry carries a tab any more.
…sh the runtime profile patch

Main's series now uses 0034 to 0041 for other patches, so the route C patches
(0034 to 0042 here) move to 0045 to 0053, keeping their order. The runtime
profile patch (now 0053) is refreshed onto the current upstream pin
(hle_svc.c, hle_uecvar.c and the test Makefile moved). Numbers named in patch
messages and in the launcher plan are updated.
…ts the per-game IPA path

The per-game IPA target is gone, so BuildModel has no ipaPath.
…new pin

Main's refresh of the iOS game data folder patch (aoc_locate comment) moved the context of the main.m hunk.
@v0lumehi
v0lumehi force-pushed the v0lumehi/ios-shell-ui-2 branch from d6e79ca to 3d51109 Compare October 31, 2026 16:43
@LNPANDY
LNPANDY merged commit 7799e0d into main Oct 31, 2026
12 checks passed
@v0lumehi
v0lumehi deleted the v0lumehi/ios-shell-ui-2 branch November 1, 2026 02:04
lucaszhongsj pushed a commit to lucaszhongsj/nxnative that referenced this pull request Nov 19, 2026
Upstream-Status: fork-only (declined seedds#492)
Reason: One host binary runs multiple games in the iPhone shell, so profile constants are read at run time
Issue: LNPANDY/NX2Apple#226
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Workflows and repository tooling documentation Improvements or additions to documentation enhancement New feature or request ios iPhone or iPad launcher The NX2Apple launcher app mac Mac patch-queue Changes the patch queue or the upstream pin windows Windows (the Qt front end)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants