Skip to content

Conversation

ericglau
Copy link
Member

@ericglau ericglau commented Aug 26, 2025

Adds a Polkadot tab based on Solidity, with the following differences:

  • Omit Account tab due to native account abstraction being available in Polkadot
  • Omit Superchain specific functionality
  • Omits Download Foundry package.
  • Change "Open in Remix" to "Open in Polkadot Remix" with different URL.

Limitations outside of Wizard's scope:

Remaining to do:

  • Override available options in the model (e.g. remove ERC20 permit so it does not appear by default)
  • Override available contracts for AI Assistant
  • Determine if Governor/votes/permit should be re-enabled at any point before release. --> Yes
  • Reenable Governor/votes/permit
  • Determine if any Polkadot-specific MCP tools are desired for Solidity. --> No. We can consider separate enhancements if Polkadot-specific tools are desired.
  • Disable Download Hardhat package for now.

Future items (separate PR(s)):

  • Support Download Hardhat package function
    • Determine if Polkadot Hardhat plugins should be enabled on the generated project
    • Determine if Polkadot specific configuration are needed in the Hardhat config, such as for the local Hardhat development network. If so, what should be the configuration settings?
    • Determine if Polkadot specific changes are needed for generated tests or deployment scripts
    • When Upgradeability is enabled, the downloaded Hardhat package includes OpenZeppelin Hardhat Upgrades plugin. This itself requires enhancements to support Polkadot networks, because the plugin contains precompiled proxy bytecode for EVM.

Copy link

sourcery-ai bot commented Aug 26, 2025

Reviewer's Guide

This PR integrates a new Polkadot tab into the existing Solidity wizard by parameterizing and overriding key UI features, routing logic, and deployment buttons. It layers in an Overrides API to omit unsupported features and tabs, adapts the remix integration for Polkadot Remix URLs, and injects Polkadot-specific assets (HTML, CSS, icons) while keeping the original Solidity code paths largely intact.

Class diagram for removeUnsupportedFeatures utility

classDiagram
    class removeUnsupportedFeatures {
      +removeUnsupportedFeatures(opts: GenericOptions): GenericOptions
    }
    class GenericOptions {
      kind: string
      permit: boolean
      votes: boolean
      crossChainBridging: string | boolean
    }
    removeUnsupportedFeatures --> GenericOptions
Loading

File-Level Changes

Change Details Files
Add Polkadot platform integration and routing
  • Register "polkadot" in main.ts evaluation and instantiate PolkadotApp
  • Introduce public/polkadot.html and insert Polkadot switch links in existing HTML shells
  • Ship new Polkadot HTML, CSS, and icon assets for nav and theme
src/main.ts
public/*.html
public/icons/polkadot.svg
public/icons/polkadot_active.svg
Implement Overrides API in solidity/App
  • Define Overrides and defaultOverrides in overrides.ts
  • Add overrides prop to App.svelte and propagate to getButtonVisibilities
  • Extend remixURL to consume overrideRemixURL and update Open button label
  • Use overrides.omitTabs to hide Account/Governor buttons and overrides.omitZipFoundry to suppress Foundry zip
  • Pass overrides.omitFeatures map into each control component
src/solidity/App.svelte
src/solidity/remix.ts
src/solidity/overrides.ts
Enable omitFeatures flagging in control components
  • Add omitFeatures prop to ERC20, ERC721, Stablecoin, RealWorldAsset controls
  • Wrap superchain tooltip initialization and show calls with omitFeatures conditions
  • Guard Permit and Votes sections behind omitFeatures.includes checks
src/solidity/ERC20Controls.svelte
src/solidity/RealWorldAssetControls.svelte
src/solidity/StablecoinControls.svelte
src/solidity/ERC721Controls.svelte
Adapt UI theme and styles for Polkadot
  • Declare --polkadot-pink CSS variable and switch-polkadot active style
  • Insert Polkadot switch in nav bars across standalone.css and vars.css
  • Add theme overrides in Polkadot App.svelte for tab highlight
src/standalone.css
src/common/styles/vars.css
public/*.html
src/polkadot/App.svelte
Add utility for removing unsupported features
  • Create removeUnsupportedFeatures.ts to strip permit, votes, superchain when applicable
  • Define Overrides interface in overrides.ts alongside defaultOverrides
src/polkadot/remove-unsupported-features.ts
src/solidity/overrides.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

coderabbitai bot commented Aug 26, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

Adds Polkadot support across UI and AI layers: new Polkadot page and nav links, app selection and instantiation, AI function definitions and language type, Solidity app override system, feature-omission handling, Remix URL override, CSS variables/styles, and conditional feature gating in ERC20/Stablecoin/RealWorldAsset controls.

Changes

Cohort / File(s) Summary
Polkadot AI function definitions
packages/ui/api/ai-assistant/function-definitions/polkadot.ts
New module re-exporting Solidity AI function definitions under Polkadot-prefixed constants.
Language types
packages/ui/api/ai-assistant/types/languages.ts
Adds polkadot option derived from Solidity (without Account); updates AllLanguagesContractsOptions.
AI core integration
packages/ui/api/ai.ts
Adds Polkadot to function-per-language map; adjusts system prompt wording to “ecosystem”.
Public pages & navigation
packages/ui/public/index.html, packages/ui/public/cairo.html, packages/ui/public/stellar.html, packages/ui/public/stylus.html, packages/ui/public/polkadot.html
Adds Polkadot switch to nav across pages; introduces new polkadot.html rendering <oz-wizard data-lang="polkadot">.
App wiring
packages/ui/src/main.ts
Extends selection to support polkadot; reuses Solidity semver; instantiates PolkadotApp. Public appType union updated.
Polkadot Svelte app
packages/ui/src/polkadot/App.svelte, packages/ui/src/polkadot/handle-unsupported-features.ts
New Polkadot wrapper around SolidityApp with overrides: hide Account, omit features, sanitize options, custom Remix label/URL, AI assistant config; utilities to define/sanitize omitted features.
Solidity app overrides system
packages/ui/src/solidity/App.svelte, packages/ui/src/solidity/overrides.ts
Introduces Overrides interface and defaultOverrides; SolidityApp now accepts overrides to control AI assistant, feature omission, Remix config, and download buttons.
Controls feature gating
packages/ui/src/solidity/ERC20Controls.svelte, packages/ui/src/solidity/StablecoinControls.svelte, packages/ui/src/solidity/RealWorldAssetControls.svelte
Add omitFeatures prop; conditionally render Superchain/Permit/Votes; tooltips made optional.
Remix URL override
packages/ui/src/solidity/remix.ts
remixURL now accepts optional override base URL.
Styling
packages/ui/src/common/styles/vars.css, packages/ui/src/standalone.css
Adds --polkadot-pink; defines active style for Polkadot switch.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant U as User
  participant Router as UI Router (main.ts)
  participant App as App Factory
  participant PApp as PolkadotApp
  participant SApp as SolidityApp (wrapped)

  U->>Router: Load /polkadot
  Router->>App: evaluateSelection(lang=polkadot, version)
  App-->>Router: CompatibleSelection(appType='polkadot')
  Router->>PApp: new PolkadotApp(initialTab, initialOpts)
  PApp->>SApp: Instantiate with overrides (omit tabs/features, AI, Remix)
  SApp-->>U: Render Wizard (Polkadot ecosystem)
Loading
sequenceDiagram
  autonumber
  participant PApp as PolkadotApp
  participant SApp as SolidityApp
  participant C as Controls (ERC20/Stablecoin/RWA)
  participant AI as AI Assistant
  participant Remix as Remix URL Builder

  PApp->>SApp: overrides { omitTabs/Features, sanitize, aiAssistant, remix }
  SApp->>C: Pass omitFeatures per Kind
  Note right of C: Conditionally render Superchain/Permit/Votes\nTooltips optional
  SApp->>SApp: sanitizeOmittedFeatures(opts) before build
  SApp->>AI: Use overrides.aiAssistant (language='polkadot', samples, component)
  SApp->>Remix: remixURL(code, upgradeable, overrides.remix.url)
  Remix-->>SApp: URL (e.g., remix.polkadot.io)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • ericnordelo
  • ernestognw
  • CoveMB

Pre-merge checks (2 passed, 1 warning)

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title “Add Polkadot Solidity tab” concisely describes the primary user-visible change of introducing a Polkadot tab in the UI, directly reflecting the main intent of adding Polkadot support via the existing Solidity flow. It is clear, specific, and free of noise or file-level details.
Description Check ✅ Passed The description clearly outlines the key changes introduced by the PR, including UI tab additions, feature omissions, renaming of actions, and noted limitations and future work; it directly relates to the changeset content.

Pre-merge checks (2 passed, 1 warning)

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title “Add Polkadot Solidity tab” concisely describes the primary user-visible change of introducing a Polkadot tab in the UI, directly reflecting the main intent of adding Polkadot support via the existing Solidity flow. It is clear, specific, and free of noise or file-level details.
Description Check ✅ Passed The pull request description clearly outlines the addition of a Polkadot tab by reusing the existing Solidity flow, details the specific UI and functional overrides (omitting Account, Superchain functions, Download Foundry, renaming the Remix link), and lists completed and pending tasks that map directly to the changes in the code. It accurately reflects the scope and intent of the changeset.

Pre-merge checks (2 passed, 1 warning)

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title “Add Polkadot Solidity tab” concisely describes the primary user-visible change of introducing a Polkadot tab in the UI, directly reflecting the main intent of adding Polkadot support via the existing Solidity flow. It is clear, specific, and free of noise or file-level details.
Description Check ✅ Passed The pull request description clearly outlines the addition of a Polkadot tab based on the existing Solidity flow, detailing the omissions of specific tabs and functionality (Account, Superchain, Download Foundry) and the rename of “Open in Remix” to “Open in Polkadot Remix,” which directly corresponds to the code changes across modules, HTML pages, and Svelte components described in the summary.

Pre-merge checks (2 passed, 1 warning)

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title “Add Polkadot Solidity tab” concisely describes the primary user-visible change of introducing a Polkadot tab in the UI, directly reflecting the main intent of adding Polkadot support via the existing Solidity flow. It is clear, specific, and free of noise or file-level details.
Description Check ✅ Passed The pull request description clearly describes the intent to add a Polkadot tab by reusing the Solidity flow and lists the specific deviations (omit Account, omit Superchain features, disable Foundry/Hardhat downloads, rename Open in Remix) as well as limitations and remaining work; this matches the provided file-level summaries that add Polkadot pages, a Polkadot App wrapper, overrides, CSS variables, and AI/control changes. The description is therefore directly related to the changeset and not off-topic or unrelated.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

@ericglau ericglau changed the title Add Polkadot Solidity tab [WIP] Add Polkadot Solidity tab Sep 10, 2025
@ericglau ericglau marked this pull request as ready for review September 10, 2025 20:36
@ericglau ericglau requested review from a team as code owners September 10, 2025 20:36
@ericglau ericglau requested a review from KitHat September 10, 2025 20:36
@ericglau ericglau requested a review from CoveMB September 10, 2025 20:36
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/ui/src/solidity/App.svelte (1)

152-152: Fix telemetry: events always report 'solidity'

postConfig(..., language) uses a hard-coded 'solidity', and wizLanguage is forced to type 'solidity'. This mislabels Polkadot sessions.

Apply:

-const language = 'solidity';
+import type { SupportedLanguage } from '../../api/ai-assistant/types/languages';
@@
-  await postConfig(opts, 'copy', language);
+  await postConfig(opts, 'copy', wizLanguage);
@@
-  await postConfig(opts, 'remix', language);
+  await postConfig(opts, 'remix', wizLanguage);
@@
-  await postConfig(opts, 'download-hardhat', language);
+  await postConfig(opts, 'download-hardhat', wizLanguage);
@@
-  await postConfig(opts, 'download-foundry', language);
+  await postConfig(opts, 'download-foundry', wizLanguage);
@@
-$: wizLanguage = (overrides.aiAssistant?.language ?? 'solidity') as 'solidity';
+$: wizLanguage = (overrides.aiAssistant?.language ?? 'solidity') as SupportedLanguage;
@@
-  <WizSolidity
-    language={wizLanguage}
+  <WizSolidity
+    language={wizLanguage}

Additionally, relax the AI event type to accommodate overridden languages:

-import type { AiFunctionCall } from '../../api/ai-assistant/types/assistant';
+import type { AiFunctionCall } from '../../api/ai-assistant/types/assistant';
+import type { SupportedLanguage } from '../../api/ai-assistant/types/languages';
@@
-const applyFunctionCall = ({ detail: aiFunctionCall }: CustomEvent<AiFunctionCall<'solidity'>>) => {
+const applyFunctionCall = ({ detail: aiFunctionCall }: CustomEvent<AiFunctionCall<SupportedLanguage>>) => {

Also applies to: 159-161, 178-181, 199-201, 211-213, 220-221, 223-235, 281-283

🧹 Nitpick comments (13)
packages/ui/src/standalone.css (1)

117-119: Consider using the Polkadot brand color for consistency.

The active state uses --color-2: #000000 (black), but this might not align with Polkadot's brand identity. Consider using the --polkadot-pink variable defined in vars.css for better brand consistency, similar to how other switches use their brand colors.

.nav .switch.switch-polkadot.active {
-  --color-2: #000000;
+  --color-2: var(--polkadot-pink);
}
packages/ui/src/solidity/remix.ts (1)

1-2: Accept URL | string and guard against invalid base URLs

Nice extension. Minor polish: allow a URL object, and fall back safely if an invalid string is passed.

Apply:

-export function remixURL(code: string, upgradeable = false, overrideRemixURL?: string): URL {
-  const remix = new URL(overrideRemixURL ?? 'https://remix.ethereum.org');
+export function remixURL(code: string, upgradeable = false, baseRemixUrl?: string | URL): URL {
+  let remix: URL;
+  try {
+    remix = new URL(baseRemixUrl ?? 'https://remix.ethereum.org');
+  } catch {
+    remix = new URL('https://remix.ethereum.org');
+  }
packages/ui/src/solidity/ERC20Controls.svelte (3)

23-24: Strongly type omitFeatures to prevent drift

Constrain to a union of known feature keys to avoid typos and ease refactors.

Apply:

-export let omitFeatures: string[] | undefined = undefined;
+type ERC20FeatureKey = 'superchain' | 'permit' | 'votes';
+export let omitFeatures: ERC20FeatureKey[] | undefined = undefined;

33-39: Destroy tooltip on unmount to avoid leaks

If the component is torn down, the Tippy instance should be destroyed.

Apply:

-import { onMount } from 'svelte';
+import { onMount, onDestroy } from 'svelte';
@@
   onMount(() => {
     superchainTooltip = !omitFeatures?.includes('superchain')
       ? tippy(superchainLabel, superchainTooltipProps)
       : undefined;
   });
+
+  onDestroy(() => {
+    superchainTooltip?.destroy();
+    superchainTooltip = undefined;
+  });

190-199: Guard state when feature is omitted

If omitFeatures includes superchain but opts.crossChainBridging was previously 'superchain', the UI won’t render that choice yet the value persists. Ensure upstream sanitization or add a local fallback.

If needed locally:

$: {
+  if (omitFeatures?.includes('superchain') && opts.crossChainBridging === 'superchain') {
+    opts.crossChainBridging = 'custom';
+  }
}

If handled by removeUnsupportedFeatures upstream, we’re good—please confirm.

packages/ui/src/solidity/StablecoinControls.svelte (1)

33-38: Destroy tooltip on unmount to avoid leaks

tippy() instances should be destroyed. Also safe to noop if the feature is omitted.

Apply:

 import { onMount } from 'svelte';
+import { onDestroy } from 'svelte';
@@
   onMount(() => {
     superchainTooltip = !omitFeatures?.includes('superchain')
       ? tippy(superchainLabel, superchainTooltipProps)
       : undefined;
   });
+
+  onDestroy(() => {
+    superchainTooltip?.destroy();
+    superchainTooltip = undefined;
+  });

Also applies to: 43-43

packages/ui/src/main.ts (1)

83-90: Version gating for Polkadot mirrors Solidity semver

Logic is sound. Optional: consider accepting version=stable alias for parity with Cairo’s UX.

If desired:

 case 'polkadot': {
   // Use Solidity Contracts semver
-  if (requestedVersion === undefined || semver.satisfies(requestedVersion, soliditySemver)) {
+  if (
+    requestedVersion === undefined ||
+    requestedVersion === 'stable' ||
+    semver.satisfies(requestedVersion, soliditySemver)
+  ) {
     return { compatible: true, appType: 'polkadot' };
   } else {
     return { compatible: false, compatibleVersionsSemver: soliditySemver };
   }
 }
packages/ui/public/polkadot.html (2)

35-37: Font preload MIME/type mismatch

You’re preloading a .ttf but declaring type="font/woff2". Aligning these avoids a wasted preload.

Use either a WOFF2 file or update the type:

-<link rel="preload" href="/fonts/Inter-VariableFont_opsz,wght.ttf" as="font" type="font/woff2" crossorigin>
+<link rel="preload" href="/fonts/Inter-VariableFont_opsz,wght.woff2" as="font" type="font/woff2" crossorigin>

—or—

-<link rel="preload" href="/fonts/Inter-VariableFont_opsz,wght.ttf" as="font" type="font/woff2" crossorigin>
+<link rel="preload" href="/fonts/Inter-VariableFont_opsz,wght.ttf" as="font" type="font/ttf" crossorigin>

66-73: Optional: make the active tab linkable

Using /polkadot instead of # lets users copy the link to this page.

-<a class="switch switch-polkadot active" href="#"><img src="/icons/polkadot_active.svg" alt="polkadot">Polkadot</a>
+<a class="switch switch-polkadot active" href="/polkadot"><img src="/icons/polkadot_active.svg" alt="polkadot">Polkadot</a>
packages/ui/src/solidity/RealWorldAssetControls.svelte (1)

36-41: Tippy instance should be cleaned up

Destroy on unmount to prevent leaks, same pattern as Stablecoin.

 import { onMount } from 'svelte';
+import { onDestroy } from 'svelte';
@@
   onMount(() => {
     superchainTooltip = !omitFeatures?.includes('superchain')
       ? tippy(superchainLabel, superchainTooltipProps)
       : undefined;
   });
+  onDestroy(() => {
+    superchainTooltip?.destroy();
+    superchainTooltip = undefined;
+  });

Also applies to: 46-46

packages/ui/src/solidity/overrides.ts (1)

8-48: Overrides shape looks solid and future-proof

Good separation of concerns. Optional: consider ReadonlyMap<Kind, readonly string[]> if immutability is desired.

packages/ui/public/stellar.html (1)

68-68: Nit: avoid duplicate accessible name from icon alt text

Since the link already contains the text “Polkadot”, the icon is decorative. Consider empty alt and aria-hidden to prevent screen readers from announcing it twice (apply consistently across pages in a follow-up).

-      <a class="switch switch-polkadot" href="/polkadot"><img src="/icons/polkadot.svg" alt="polkadot">Polkadot</a>
+      <a class="switch switch-polkadot" href="/polkadot"><img src="/icons/polkadot.svg" alt="" aria-hidden="true">Polkadot</a>
packages/ui/src/common/styles/vars.css (1)

33-34: Verify WCAG contrast for --polkadot-pink (#ff2670)
Contrast vs white: 3.64:1 (below 4.5:1 for normal text); contrast vs black: 5.76:1 (meets 4.5:1). Reserve for graphical accents or large text on light backgrounds, or select a darker shade for normal body text on white.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 029790c and 068f52c.

⛔ Files ignored due to path filters (2)
  • packages/ui/public/icons/polkadot.svg is excluded by !**/*.svg
  • packages/ui/public/icons/polkadot_active.svg is excluded by !**/*.svg
📒 Files selected for processing (19)
  • packages/ui/api/ai-assistant/function-definitions/polkadot.ts (1 hunks)
  • packages/ui/api/ai-assistant/types/languages.ts (2 hunks)
  • packages/ui/api/ai.ts (3 hunks)
  • packages/ui/public/cairo.html (1 hunks)
  • packages/ui/public/index.html (1 hunks)
  • packages/ui/public/polkadot.html (1 hunks)
  • packages/ui/public/stellar.html (1 hunks)
  • packages/ui/public/stylus.html (1 hunks)
  • packages/ui/src/common/styles/vars.css (1 hunks)
  • packages/ui/src/main.ts (4 hunks)
  • packages/ui/src/polkadot/App.svelte (1 hunks)
  • packages/ui/src/polkadot/handle-unsupported-features.ts (1 hunks)
  • packages/ui/src/solidity/App.svelte (10 hunks)
  • packages/ui/src/solidity/ERC20Controls.svelte (3 hunks)
  • packages/ui/src/solidity/RealWorldAssetControls.svelte (5 hunks)
  • packages/ui/src/solidity/StablecoinControls.svelte (3 hunks)
  • packages/ui/src/solidity/overrides.ts (1 hunks)
  • packages/ui/src/solidity/remix.ts (1 hunks)
  • packages/ui/src/standalone.css (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
packages/ui/api/ai-assistant/function-definitions/polkadot.ts (1)
packages/ui/api/ai-assistant/function-definitions/solidity.ts (6)
  • solidityERC20AIFunctionDefinition (14-68)
  • solidityERC721AIFunctionDefinition (70-110)
  • solidityERC1155AIFunctionDefinition (112-143)
  • solidityStablecoinAIFunctionDefinition (145-172)
  • solidityRealWorldAssetAIFunctionDefinition (174-178)
  • solidityCustomAIFunctionDefinition (308-323)
packages/ui/src/solidity/overrides.ts (1)
packages/ui/api/ai-assistant/types/languages.ts (1)
  • SupportedLanguage (54-54)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: build (solidity, default)
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (22)
packages/ui/public/index.html (1)

100-100: Navigation structure is properly maintained.

The Polkadot link is correctly positioned in the navigation flow and follows the established pattern for language switches. The implementation is consistent with the other HTML files in this PR.

packages/ui/public/cairo.html (1)

76-76: Consistent navigation implementation.

The Polkadot navigation link maintains consistency with the existing navigation structure and properly integrates with the Cairo page's layout.

packages/ui/public/stylus.html (1)

68-68: Navigation addition follows established pattern.

The Polkadot navigation link is properly implemented and maintains consistency with the navigation structure across all HTML files.

packages/ui/src/polkadot/handle-unsupported-features.ts (1)

1-18: No Account/Governor references; omission logic is complete.
Grep across all .ts files found no instances of “Account” or “Governor,” so no additional feature omissions are needed in this utility.

packages/ui/api/ai.ts (3)

3-3: Import structure is clean and consistent.

The import of polkadotFunctions follows the established pattern for language-specific function definitions.


25-25: Function mapping properly integrates Polkadot support.

The addition of polkadot: polkadotFunctions to the functionPerLanguages mapping enables AI assistance for Polkadot, maintaining consistency with the existing language support structure.


44-44: System prompt adjustment improves accuracy.

Changing from "written in ${request.language}" to "written for the ${request.language} ecosystem" is more technically accurate, especially for Polkadot which uses Solidity but targets a different ecosystem.

packages/ui/src/solidity/StablecoinControls.svelte (2)

22-22: Prop looks good and backward compatible

Adding omitFeatures?: string[] keeps default behavior unchanged. No issues.


224-233: Conditional render for Superchain is correct

Gating the Superchain option via omitFeatures is clean and matches the tooltip logic.

packages/ui/src/main.ts (1)

157-159: Instantiation wiring for PolkadotApp is correct

Props passed match the component’s public API.

packages/ui/src/solidity/RealWorldAssetControls.svelte (2)

25-26: Prop addition LGTM

omitFeatures mirrors other controls and keeps defaults intact.


141-149: Feature gating is consistent and correct

Permit/Votes/Superchain are conditionally rendered based on omitFeatures. Good alignment with overrides.

Also applies to: 190-215, 231-240

packages/ui/src/polkadot/App.svelte (1)

33-39: Styling override is scoped correctly

Scoped to .polkadot-app, safely overriding the default selected tab color.

packages/ui/api/ai-assistant/function-definitions/polkadot.ts (1)

1-16: Re-exports are fine for now

Simple aliasing keeps definitions in sync with Solidity. If we later diverge on parameters (e.g., omit Superchain), we can specialize here.

packages/ui/src/solidity/overrides.ts (1)

50-58: Sane defaults

defaultOverrides is a no-op, preserving existing behavior.

packages/ui/src/solidity/App.svelte (5)

93-94: Sanitizing omitted features before build is correct

This ensures hidden/unsupported options don’t break generation.


119-145: Buttons visibility logic matches product rules

The per-kind gating and global overrides behave as expected.


247-249: Account tab gating via overrides is correct

Matches the new omitTabs contract.


341-365: Propagating omitFeatures to controls is correct

Keeps controls decoupled and override-driven.


58-61: Further investigating createWiz implementation to confirm typing behavior.

packages/ui/public/stellar.html (1)

68-68: Polkadot nav link addition — LGTM

Placement, href, classes, and icon usage are consistent with existing tabs.

packages/ui/src/common/styles/vars.css (1)

33-34: New theme token looks good

Naming aligns with existing chain color tokens; value matches Polkadot brand pink.

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.

1 participant