Repository navigation
feat(site): default to Dapp Index when an assembly has no custom dapp - #51
Conversation
Assemblies without a player-set dappURL fall back to a built-in view per type (InventoryView, GateView, TurretView) or an empty panel for any other type. Adds an environment-driven fallback so those panels show Dapp Index instead, with the assembly's itemId/tenant forwarded so Dapp Index can resolve the same object (e.g. for an Install button). getDappUrl gains an optional fallbackUrl, used only when the assembly has no dappURL of its own; a player's own dapp always wins. Network nodes keep their built-in Graph view unconditionally, matching their existing exclusion from custom dapps. The "outside of Frontier" warning now only fires for a genuine player-set dappURL - Dapp Index is first-party - checked via whether the resolved URL differs from the assembly's own dappURL, not via the untrimmed field, so a whitespace-only dappURL is correctly treated as absent. VITE_DAPP_INDEX_URL is unset by default, so every environment keeps today's behavior until it's explicitly configured (dev and test have it set to their respective Dapp Index deployments; live/uat do not, pending QA).
Coverage Report for @evefrontier/dapp-kit
File Coverage
|
||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Pull request overview
This PR adds a configurable “Dapp Index” fallback so assemblies without a player-provided dappURL can render a first-party index UI (instead of empty/built-in views), while keeping NetworkNode on its Graph view and avoiding the “outside of Frontier” warning for first-party content.
Changes:
- Extend
getDappUrl(assembly, fallbackUrl?)to optionally use a fallback URL when an assembly has nodappURL, with URL normalization preserved. - Update
Behaviour.tsxto compute a fallback Dapp Index URL (includingitemId/tenant) for eligible assemblies, and show the external-warning only for genuine player-setdappURLs. - Document the new
VITE_DAPP_INDEX_URLenvironment variable in the Assembly app.envsample.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/libs/dapp-kit/utils/utils.ts | Adds optional fallbackUrl support to getDappUrl while keeping protocol normalization. |
| packages/libs/dapp-kit/utils/tests/utils.test.ts | Adds test coverage for the new fallback behavior and precedence rules. |
| packages/apps/assembly/src/components/Behaviour.tsx | Adds Dapp Index fallback rendering + context propagation (itemId/tenant) and adjusts “outside Frontier” warning logic. |
| packages/apps/assembly/.envsample | Documents VITE_DAPP_INDEX_URL configuration. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Keeping it as a feature preview branch and under feature flag until reviewed as a product: |
fcsondheim
left a comment
There was a problem hiding this comment.
if this is intended to be released on test/dev tier dapps, would be good if there was a patch bump in the package version as well for the assembly dapp. this can be done with changesets.
Feature
This is the first step toward showing Dapp Index inside the game client, so a player can browse and install a dapp onto an assembly directly.
What
getDappUrl(assembly, fallbackUrl?)gains an optional fallback, used only when the assembly has nodappURLof its own. A player's own dapp always wins.Behaviour.tsx: whenVITE_DAPP_INDEX_URLis set, any non-NetworkNodeassembly with no custom dapp renders Dapp Index instead of its built-in view (InventoryView/GateView/TurretView) or an empty panel.NetworkNodekeeps itsGraphview unconditionally, matching its existing exclusion from custom dapps.itemId/tenantthis app resolved the assembly from, so Dapp Index can look up that assembly too (needed for its own Install button).dappURL— Dapp Index is first-party and must not trigger it.VITE_DAPP_INDEX_URLis unset by default, so every environment keeps today's behavior until explicitly configured.devandtestalready have it pointed at their respective Dapp Index deployments in the deploy console;live/uatare intentionally left unset pending QA.Why
Today, an assembly with no custom dapp shows a built-in view that's often just empty (e.g. "Empty" for an unused
SmartStorageUnit, or nothing at all for several types). This makes Dapp Index the default there instead, so players discover it without needing a game-client update — first fordev/test, withlivegated behind explicit config once verified.Screenshots / Gifs
Where has this been tested?
bun run devagainst a real testnet assembly with no customdappURL, confirmed the fallback renders, no "outside of Frontier" warning, andNetworkNodeis unaffected)Not yet verified inside the actual game-client webview — flagging since that's the real target environment, and it's the one thing a browser tab can't confirm (wallet-standard extension behavior and iframe permissions can differ there).