Skip to content

feat(site): default to Dapp Index when an assembly has no custom dapp - #51

Merged
fcsondheim merged 4 commits into
mainfrom
feat/default-dapp-index-fallback
Aug 26, 2026
Merged

fcsondheim merged 4 commits into
mainfrom
feat/default-dapp-index-fallback

Conversation

@gaurmundur

@gaurmundur gaurmundur commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

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 no dappURL of its own. A player's own dapp always wins.
  • Behaviour.tsx: when VITE_DAPP_INDEX_URL is set, any non-NetworkNode assembly with no custom dapp renders Dapp Index instead of its built-in view (InventoryView/GateView/TurretView) or an empty panel. NetworkNode keeps its Graph view unconditionally, matching its existing exclusion from custom dapps.
  • The fallback URL carries the same itemId/tenant this app resolved the assembly from, so Dapp Index can look up that assembly too (needed for its own Install button).
  • The "outside of Frontier" warning now fires only for a genuine player-set dappURL — Dapp Index is first-party and must not trigger it.
  • VITE_DAPP_INDEX_URL is unset by default, so every environment keeps today's behavior until explicitly configured. dev and test already have it pointed at their respective Dapp Index deployments in the deploy console; live/uat are 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 for dev/test, with live gated behind explicit config once verified.

Screenshots / Gifs

Screenshot 2026-08-26 at 09 10 27 Screenshot 2026-08-26 at 09 10 38 Screenshot 2026-08-26 at 09 10 56

Where has this been tested?

  • In-game browser
  • External browser (local bun run dev against a real testnet assembly with no custom dappURL, confirmed the fallback renders, no "outside of Frontier" warning, and NetworkNode is 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).

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).
Copilot AI lite review requested due to automatic review settings August 26, 2026 10:45
@github-actions

github-actions Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

Coverage Report for @evefrontier/dapp-kit

Status Category Percentage Covered / Total
🔵 Lines 89.21% 869 / 974
🔵 Statements 87.23% 936 / 1073
🔵 Functions 84.71% 194 / 229
🔵 Branches 74.4% 590 / 793
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/libs/dapp-kit/utils/utils.ts 100% 94.23% 100% 100%
Generated in workflow #116 for commit 9569d0f by the Vitest Coverage Report Action

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 no dappURL, with URL normalization preserved.
  • Update Behaviour.tsx to compute a fallback Dapp Index URL (including itemId/tenant) for eligible assemblies, and show the external-warning only for genuine player-set dappURLs.
  • Document the new VITE_DAPP_INDEX_URL environment 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.

Comment thread packages/apps/assembly/src/components/Behaviour.tsx Outdated
Comment thread packages/apps/assembly/src/components/Behaviour.tsx
@gaurmundur

gaurmundur commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor Author

Keeping it as a feature preview branch and under feature flag until reviewed as a product:
feat-default-dapp-index-fallback

@gaurmundur
gaurmundur marked this pull request as draft August 26, 2026 12:35
@gaurmundur
gaurmundur marked this pull request as ready for review August 26, 2026 13:13

@fcsondheim fcsondheim left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@fcsondheim
fcsondheim merged commit ea27ceb into main Aug 26, 2026
@fcsondheim
fcsondheim deleted the feat/default-dapp-index-fallback branch August 26, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants