Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the search result “node” shape to optionally include an internal (Ratio1) address, populates it in both server/client search implementations, and renders it in the search results UI. It also adds a “CSP Level” column to the CSP list/card UI, and adjusts release/build workflows.
Changes:
- Add optional
internalAddressto node search results, populate it insearch/clientSearch, and display it inSearchResultsList. - Add “CSP Level” to CSP list header and CSP cards.
- Reformat GitHub Actions workflows and change semantic-version matching patterns; add a TS “type check” file under
typedefs/.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
typedefs/search-result-types.test.ts |
Adds a compile-time type usage file for SearchResult / internalAddress. |
typedefs/general.ts |
Extends SearchResult node variant with optional internalAddress. |
lib/utils.tsx |
Populates internalAddress in clientSearch results (node lookup + active nodes listing). |
lib/actions.ts |
Populates internalAddress in server search results (node lookup + active nodes listing). |
app/server-components/SearchResultsList.tsx |
Renders both ETH and internal addresses for node search results. |
app/server-components/CPSs/CSPsList.tsx |
Adds a “CSP Level” column in the list header. |
app/server-components/CPSs/CSPCard.tsx |
Displays cspTier (“CSP Level”) in each CSP card row. |
.github/workflows/release.yml |
Re-indents workflow and changes semantic-version patterns. |
.github/workflows/build_testnet_mainnet.yml |
Changes semantic-version patterns for build workflow. |
Comments suppressed due to low confidence (2)
lib/utils.tsx:327
ratio1Addris cast totypes.R1Address, but the key type coming fromObject.entries(response.result.nodes)is a plainstringat runtime (andtypes.R1Addresscurrently doesn’t match the0xai_...format used elsewhere). Consider fixingR1Addressto match the actual internal address format and/or adding a runtime guard before treating arbitrary keys as internal addresses.
Object.entries(response.result.nodes).forEach(([ratio1Addr, node]) => {
resultsArray.push({
type: 'node',
nodeAddress: node.eth_addr,
internalAddress: ratio1Addr as types.R1Address,
alias: node.alias,
isOnline: parseInt(node.last_seen_ago.split(':')[2]) < 60,
lib/actions.ts:159
ratio1Addris cast totypes.R1Address, but the key type coming fromObject.entries(response.result.nodes)is a plainstringat runtime (andtypes.R1Addresscurrently doesn’t match the0xai_...format used elsewhere). Consider fixingR1Addressto match the actual internal address format and/or adding a runtime guard before treating arbitrary keys as internal addresses.
Object.entries(response.result.nodes).forEach(([ratio1Addr, node]) => {
resultsArray.push({
type: 'node',
nodeAddress: node.eth_addr,
internalAddress: ratio1Addr as types.R1Address,
alias: node.alias,
isOnline: parseInt(node.last_seen_ago.split(':')[2]) < 60,
});
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| | { | ||
| type: 'node'; | ||
| nodeAddress: types.EthAddress; | ||
| internalAddress?: types.R1Address; |
Comment on lines
256
to
262
| resultsArray.push({ | ||
| type: 'node', | ||
| nodeAddress: nodeResponse.node_eth_address, | ||
| internalAddress: nodeResponse.node as types.R1Address, | ||
| alias: nodeResponse.node_alias, | ||
| isOnline: nodeResponse.node_is_online, | ||
| }); |
Comment on lines
87
to
93
| resultsArray.push({ | ||
| type: 'node', | ||
| nodeAddress: nodeResponse.node_eth_address, | ||
| internalAddress: nodeResponse.node as types.R1Address, | ||
| alias: nodeResponse.node_alias, | ||
| isOnline: nodeResponse.node_is_online, | ||
| }); |
Comment on lines
+27
to
+28
| major_pattern: "/MAJOR/" | ||
| minor_pattern: "/feat:/" |
Comment on lines
+27
to
+28
| major_pattern: "/MAJOR/" | ||
| minor_pattern: "/feat:/" |
Comment on lines
+1
to
+18
| import * as types from './blockchain'; | ||
| import { SearchResult } from './general'; | ||
|
|
||
| const ethAddress = '0x1111111111111111111111111111111111111111' as types.EthAddress; | ||
| const internalAddress = '0xai_11111111111111111111111111111111111111111111' as types.R1Address; | ||
|
|
||
| const nodeSearchResult: SearchResult = { | ||
| type: 'node', | ||
| nodeAddress: ethAddress, | ||
| internalAddress, | ||
| alias: 'smart0', | ||
| isOnline: true, | ||
| }; | ||
|
|
||
| if (nodeSearchResult.type === 'node') { | ||
| const copiedAddress: types.R1Address | undefined = nodeSearchResult.internalAddress; | ||
| void copiedAddress; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.