Skip to content

Conversation

@icezohu
Copy link

@icezohu icezohu commented Feb 9, 2026

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Ticket: #ticket number

Test cases:

Please describe tested cases.

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Improvements (ie: code cleaning or remove unused codes or performance issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

UI Changes

Add before and after changes for UI if needed.

before after
0 1

Summary by CodeRabbit

  • New Features

    • Broader network name resolution with expanded mappings and developer logging for unmapped chain IDs.
  • Bug Fixes

    • Improved network label display for SUBQUERY/SUBGRAPH projects to show proper network names or a truncated "Chain ID" fallback.
    • Manifest retrieval now consistently loads manifests across all project types.
  • Chores

    • Yarn configured to use node-modules linker; .yarn added to .gitignore and newline formatting normalized.

@coderabbitai
Copy link

coderabbitai bot commented Feb 9, 2026

📝 Walkthrough

Walkthrough

Replaces IndexerName usage with a network name resolver and truncation logic in ProjectCard and ProjectHeader, adds a getNetworkNameByChainId helper with expanded network dictionaries and DEV-mode logging for unmapped chain IDs, makes manifest lookup always use the provided deploymentId, and adds minor repo config changes.

Changes

Cohort / File(s) Summary
ProjectCard — network label logic
src/components/ProjectCard/ProjectCard.tsx
Removes IndexerName usage; adds memoized networkVal, isChainIdFallback, chainIdDisplayVal, networkDisplayVal, and truncation constants; renders chain ID fallback or truncated network name for SUBQUERY/SUBGRAPH projects.
ProjectHeader — network resolution update
src/components/ProjectHeader/ProjectHeader.tsx
Replaces direct dictionary lookups with getNetworkNameByChainId(...), adds contextual info (project id/name/source) to memoization dependencies for network name resolution.
Network name utilities and mappings
src/const/const.ts
Adds getNetworkNameByChainId(chainId?, context?), NetworkNameContext type, expanded NETWORK_TYPE_DICTION and ETH_TYPE_DICTION mappings, DEV-mode sets/tracking (missingNetworkChainIdSet, missingNetworkChainIdWithProjectSet) and contextual DEV logging for unmapped chain IDs.
Manifest lookup behavior
src/hooks/useProjectList.tsx
Changes call to useGetDeploymentManifest to always pass the provided deploymentId (removes conditional branch that passed '' for non-RPC types).
Repo config
.gitignore, .yarnrc.yml
Normalizes .gitignore newline handling and adds .yarn/.data ignores; sets Yarn nodeLinker: node-modules in .yarnrc.yml.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 I hop through names both long and wide,

I map each chain and tuck its pride,
No empty manifests to chase,
Trimmed labels fit a tidy space,
A joyful thump — the networks glide ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is a template with placeholder content; it lacks actual implementation details, specific test cases, type of change selection, and meaningful UI comparison images. Fill in the ticket number, provide specific test cases, select the appropriate change type(s), and replace placeholder images with actual before/after UI screenshots.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main changes: enhancing ProjectCard to display network type and updating useProjectList for manifest retrieval.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature-explorer-card-network-val

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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

Copy link

@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: 1

🤖 Fix all issues with AI agents
In `@src/components/ProjectCard/ProjectCard.tsx`:
- Around line 54-69: In ProjectCard's networkVal useMemo the RPC branch returns
project.manifest.rpcFamily[0] without checking length, which yields undefined
for an empty array; update the RPC branch in networkVal (used in ProjectCard
when project.type === ProjectType.RPC) to check that
project.manifest?.rpcFamily?.length > 0 and return the first element only then,
otherwise fall back to '-' (or the existing downstream fallback), ensuring
project.manifest.rpcFamily is safely handled.

Comment on lines 54 to 69
const networkVal = React.useMemo(() => {
if (project.type === ProjectType.RPC && project.manifest?.rpcFamily) {
return project.manifest.rpcFamily[0];
}

const chainId =
project.type === ProjectType.SUBQUERY
? project.manifest?.network?.chainId
: project.manifest?.dataSources?.[0]?.network;
if (!chainId) return '-';

const polkadotName = NETWORK_TYPE_DICTION[chainId];
const ethName = ETH_TYPE_DICTION[chainId];

return polkadotName || ethName || `Chain ID ${chainId}`;
}, [project.type, project.manifest]);
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Edge case: empty rpcFamily array returns undefined.

If rpcFamily is an empty array [], the condition on line 55 evaluates to truthy, and rpcFamily[0] returns undefined. While downstream code handles this via ${networkVal || '-'} fallback, explicitly checking array length would make the intent clearer.

Suggested improvement
   const networkVal = React.useMemo(() => {
-    if (project.type === ProjectType.RPC && project.manifest?.rpcFamily) {
+    if (project.type === ProjectType.RPC && project.manifest?.rpcFamily?.length) {
       return project.manifest.rpcFamily[0];
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const networkVal = React.useMemo(() => {
if (project.type === ProjectType.RPC && project.manifest?.rpcFamily) {
return project.manifest.rpcFamily[0];
}
const chainId =
project.type === ProjectType.SUBQUERY
? project.manifest?.network?.chainId
: project.manifest?.dataSources?.[0]?.network;
if (!chainId) return '-';
const polkadotName = NETWORK_TYPE_DICTION[chainId];
const ethName = ETH_TYPE_DICTION[chainId];
return polkadotName || ethName || `Chain ID ${chainId}`;
}, [project.type, project.manifest]);
const networkVal = React.useMemo(() => {
if (project.type === ProjectType.RPC && project.manifest?.rpcFamily?.length) {
return project.manifest.rpcFamily[0];
}
const chainId =
project.type === ProjectType.SUBQUERY
? project.manifest?.network?.chainId
: project.manifest?.dataSources?.[0]?.network;
if (!chainId) return '-';
const polkadotName = NETWORK_TYPE_DICTION[chainId];
const ethName = ETH_TYPE_DICTION[chainId];
return polkadotName || ethName || `Chain ID ${chainId}`;
}, [project.type, project.manifest]);
🤖 Prompt for AI Agents
In `@src/components/ProjectCard/ProjectCard.tsx` around lines 54 - 69, In
ProjectCard's networkVal useMemo the RPC branch returns
project.manifest.rpcFamily[0] without checking length, which yields undefined
for an empty array; update the RPC branch in networkVal (used in ProjectCard
when project.type === ProjectType.RPC) to check that
project.manifest?.rpcFamily?.length > 0 and return the first element only then,
otherwise fall back to '-' (or the existing downstream fallback), ensuring
project.manifest.rpcFamily is safely handled.

Copy link

@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: 1

Caution

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

⚠️ Outside diff range comments (1)
src/components/ProjectHeader/ProjectHeader.tsx (1)

99-101: ⚠️ Potential issue | 🟡 Minor

Same edge case: empty rpcFamily array returns undefined.

Same issue as in ProjectCard - if manifest?.rpcFamily is [], the condition passes but rpcFamily[0] is undefined.

Suggested fix
   const networkVal = React.useMemo(() => {
-    if (project.type === ProjectType.RPC && manifest?.rpcFamily) {
+    if (project.type === ProjectType.RPC && manifest?.rpcFamily?.length) {
       return manifest?.rpcFamily[0];
     }
🤖 Fix all issues with AI agents
In `@src/const/const.ts`:
- Line 1003: ETH_TYPE_DICTION contains an inconsistent duplicate key "gnosis"
(string name) while the rest use numeric chain ID strings (e.g., "100":
"Gnosis"); remove the erroneous "gnosis": "Gnosis" entry from ETH_TYPE_DICTION
(or if intended, replace the key with "100") so lookups using the numeric chain
ID match the correct value.
🧹 Nitpick comments (1)
src/components/ProjectHeader/ProjectHeader.tsx (1)

107-113: Consider consistent fallback format with ProjectCard.

ProjectHeader falls back to the raw chainId, while ProjectCard uses Chain ID ${chainId}. This creates inconsistent display behavior for unmapped chains across the UI.

Optional: Align with ProjectCard's fallback format
     return (
       getNetworkNameByChainId(chainId, {
         projectName: project.metadata?.name,
         projectId: project.id,
         source: 'ProjectHeader',
-      }) || chainId
+      }) || `Chain ID ${chainId}`
     );

Note: If the raw chainId display is intentional due to space constraints in the header UI, this can be ignored.

'11155111': 'Ethereum Sepolia',
'65000000': 'Autonity Mainnet',
'10200': 'Gnosis Chiado Testnet',
gnosis: 'Gnosis',
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Inconsistent key format: gnosis is not a numeric chain ID.

All other entries in ETH_TYPE_DICTION use numeric chain IDs as string keys (e.g., '100' for Gnosis). The key gnosis won't match lookups using the actual chain ID '100'. This appears to be a duplicate or erroneous entry since '100': 'Gnosis' already exists at line 119.

Suggested fix: remove duplicate entry
   '10200': 'Gnosis Chiado Testnet',
-  gnosis: 'Gnosis',
 };
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
gnosis: 'Gnosis',
'10200': 'Gnosis Chiado Testnet',
};
🤖 Prompt for AI Agents
In `@src/const/const.ts` at line 1003, ETH_TYPE_DICTION contains an inconsistent
duplicate key "gnosis" (string name) while the rest use numeric chain ID strings
(e.g., "100": "Gnosis"); remove the erroneous "gnosis": "Gnosis" entry from
ETH_TYPE_DICTION (or if intended, replace the key with "100") so lookups using
the numeric chain ID match the correct value.

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