Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
b24133d
refactor: Streams to make homepage startup instantly
ckniffen Aug 14, 2025
8146e4d
remove unused code at the homepage top level.
ckniffen Aug 14, 2025
7ebc6c7
fix linting and get rid of extra key props
ckniffen Aug 14, 2025
24ffa7e
remove empty space and fix bug introduced when addressing linting.
ckniffen Aug 15, 2025
bdc43f1
add validator pages
ckniffen Aug 15, 2025
ad026fd
refetch and useQuery
ckniffen Aug 18, 2025
46fe093
metrics to leverage useQueries, group metric updates
ckniffen Aug 19, 2025
d0701fd
fix animations
ckniffen Aug 19, 2025
5431387
clean up imports
ckniffen Aug 19, 2025
af046cb
fix typo
ckniffen Aug 19, 2025
a2e6592
fix linting
ckniffen Aug 19, 2025
f24e3f3
type fixes
ckniffen Aug 19, 2025
a3a7a4c
Update src/containers/shared/components/Streams/StreamsProvider.tsx
ckniffen Aug 20, 2025
5573522
update and fix 10 failing tests
ckeshava Sep 3, 2025
76cf165
fix linter errors; add more test assertions in LedgersPage test
ckeshava Sep 3, 2025
6f42f8f
fix tests
ckniffen Oct 28, 2025
edc085f
fix test better
ckniffen Oct 28, 2025
7b7de4e
fix
ckniffen Oct 28, 2025
5ed5e58
1. Fix all the failing tests in the Explorer
ckeshava Oct 30, 2025
399acbf
Merge remote-tracking branch 'origin/staging' into refactor/streams-t…
ckeshava Oct 30, 2025
36929ac
update the lock file
ckeshava Oct 30, 2025
452fb55
fix: Update legacy jest matchers with newer method names. There is no…
ckeshava Oct 30, 2025
9a3be32
revert package file to match staging branch
ckeshava Nov 4, 2025
6ccdb1f
Merge branch 'staging' into refactor/streams-take-3
ckeshava Nov 4, 2025
b638fe7
remove ToolTipProvider from LedgersPage component
ckeshava Nov 5, 2025
b748b23
fix: Rectify key errors in ValidatorsTable component
ckeshava Nov 5, 2025
237c3a8
remove extraneous use of ToolTipprovider in Validators container
ckeshava Nov 5, 2025
317cc67
Merge branch 'staging' into refactor/streams-take-3
ckeshava Nov 5, 2025
41e4388
fix linter errors: remove console stmt
ckeshava Nov 5, 2025
37babbd
Merge branch 'refactor/streams-take-3' of https://github.com/ripple/e…
ckeshava Nov 5, 2025
9ffcccb
fix linter errors
ckeshava Nov 5, 2025
a83db2b
revert changes pertaining to LedgerCountBanner; This is a temporary c…
ckeshava Nov 5, 2025
dd6371b
[address PR feedback] change var name: ValidatorsPage -> Validators
ckeshava Nov 10, 2025
7dcf83f
[PR feedback] fix the opacity of background in LedgerHash component
ckeshava Nov 10, 2025
2cc86ce
fix: updated comments in StreamsProvider component
ckeshava Nov 14, 2025
6802275
Merge branch 'staging' into refactor/streams-take-3
ckeshava Nov 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/containers/App/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ export const AppWrapper = () => {
))}
<Route path="*" element={<NoMatch />} />
</Route>
\{' '}
</Routes>
<Footer />
</div>
Expand Down
99 changes: 0 additions & 99 deletions src/containers/Ledgers/LedgerCountdownBanner.tsx

This file was deleted.

26 changes: 5 additions & 21 deletions src/containers/Ledgers/LedgerEntryHash.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,15 @@ import { useTranslation } from 'react-i18next'
import SuccessIcon from '../shared/images/success.svg'
import { LedgerEntryValidator } from './LedgerEntryValidator'
import { LedgerEntryHashTrustedCount } from './LedgerEntryHashTrustedCount'
import { ValidatorResponse } from './types'
import { LedgerHash } from '../shared/components/Streams'

export const LedgerEntryHash = ({
hash,
unlCount,
validators,
}: {
hash: any
unlCount?: number
validators: { [pubkey: string]: ValidatorResponse }
}) => {
export const LedgerEntryHash = ({ hash }: { hash: LedgerHash }) => {
const { t } = useTranslation()
const shortHash = hash.hash.substring(0, 6)
const barStyle = { background: `#${shortHash}` }
const validated = hash.validated && <SuccessIcon className="validated" />
return (
<div
className={`hash ${hash.unselected ? 'unselected' : ''}`}
key={hash.hash}
>
<div className={`hash ${hash.unselected ? 'unselected' : ''}`}>
<div className="bar" style={barStyle} />
<div className="ledger-hash">
<div className="hash-concat">{hash.hash.substring(0, 6)}</div>
Expand All @@ -32,17 +21,12 @@ export const LedgerEntryHash = ({
<div>{t('total')}:</div>
<b>{hash.validations.length}</b>
</div>
<LedgerEntryHashTrustedCount
hash={hash}
unlCount={unlCount}
validators={validators}
/>
<LedgerEntryHashTrustedCount validations={hash.validations} />
</div>
<div className="validations">
{hash.validations.map((validation, i) => (
<LedgerEntryValidator
validators={validators}
validator={validation}
validation={validation}
index={i}
key={validation.cookie}
/>
Expand Down
58 changes: 29 additions & 29 deletions src/containers/Ledgers/LedgerEntryHashTrustedCount.tsx
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
import { useTranslation } from 'react-i18next'
Comment thread
kuan121 marked this conversation as resolved.
import { useMemo } from 'react'
import { useTooltip } from '../shared/components/Tooltip'
import { Hash, ValidatorResponse } from './types'
import { useVHSValidators } from '../shared/components/VHSValidators'
import { LedgerValidation } from '../shared/components/Streams'

export const LedgerEntryHashTrustedCount = ({
hash,
unlCount,
validators,
validations,
}: {
hash: Hash
unlCount?: number
validators: { [pubkey: string]: ValidatorResponse }
validations: LedgerValidation[]
}) => {
const { t } = useTranslation()
const { hideTooltip, showTooltip } = useTooltip()
const className = hash.trusted_count < (unlCount || 0) ? 'missed' : ''
const { unl, validators } = useVHSValidators()

const getMissingValidators = () => {
const unl = {}

Object.keys(validators).forEach((pubkey) => {
if (validators[pubkey].unl) {
unl[pubkey] = false
const status = useMemo(() => {
const missing = [...(unl || [])]
validations.forEach((v) => {
if (!validators?.[v.validation_public_key]) {
return
}
})

hash.validations.forEach((v) => {
if (unl[v.pubkey] !== undefined) {
delete unl[v.pubkey]
const missingIndex = missing.findIndex(
(assumedMissing) => assumedMissing === v.validation_public_key,
)
if (missingIndex !== -1) {
missing.splice(missingIndex, 1)
}
})

return Object.keys(unl).map((pubkey) => validators[pubkey])
}

const missing =
hash.trusted_count && className === 'missed' ? getMissingValidators() : null
return {
missing: missing.map((v) => validators?.[v]),
trustedCount: (unl?.length || 0) - missing.length,
}
}, [unl, validations, validators])

return hash.trusted_count ? (
return status.trustedCount ? (
<span
tabIndex={0}
role="button"
className={className}
onMouseMove={(e) =>
missing && missing.length && showTooltip('missing', e, { missing })
}
className={status.missing.length > 0 ? 'missed' : ''}
onMouseMove={(e) => {
const { missing } = status

missing.length && showTooltip('missing', e, { missing })
}}
onFocus={() => {}}
onKeyUp={() => {}}
onMouseLeave={() => hideTooltip()}
>
<div>{t('unl')}:</div>
<b>
{hash.trusted_count}/{unlCount}
{status.trustedCount}/{unl?.length}
</b>
</span>
) : null
Expand Down
1 change: 0 additions & 1 deletion src/containers/Ledgers/LedgerEntryTransaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export const LedgerEntryTransaction = ({

return (
<RouteLink
key={transaction.hash}
className={classNames(
`txn transaction-type transaction-dot bg`,
`tx-category-${getCategory(transaction.type)}`,
Expand Down
34 changes: 19 additions & 15 deletions src/containers/Ledgers/LedgerEntryValidator.tsx
Original file line number Diff line number Diff line change
@@ -1,47 +1,51 @@
import classNames from 'classnames'
import { useSelectedValidator } from './useSelectedValidator'
import { useTooltip } from '../shared/components/Tooltip'
import { ValidatorResponse } from './types'
import { useVHSValidators } from '../shared/components/VHSValidators'
import { LedgerValidation } from '../shared/components/Streams'

export const LedgerEntryValidator = ({
validator,
validators,
validation,
index,
}: {
validator: any
validators: { [pubkey: string]: ValidatorResponse }
validation: LedgerValidation
index: number
}) => {
const { validators } = useVHSValidators()
const { showTooltip, hideTooltip } = useTooltip()
const { selectedValidator, setSelectedValidator } = useSelectedValidator()

const trusted = validator.unl ? 'trusted' : ''
const unselected = selectedValidator ? 'unselected' : ''
const selected = selectedValidator === validator.pubkey ? 'selected' : ''
const className = `validation ${trusted} ${unselected} ${selected} ${validator.pubkey}`
const partial = validator.partial ? <div className="partial" /> : null
const className = classNames(
'validation',
validators?.[validation.validation_public_key]?.unl && 'trusted',
selectedValidator && 'unselected',
selectedValidator === validation.validation_public_key && 'selected',
validation.validation_public_key,
)

return (
<div
key={`${validator.pubkey}_${validator.cookie}`}
role="button"
tabIndex={index}
className={className}
onMouseOver={(e) =>
showTooltip('validator', e, {
...validator,
v: validators[validator.pubkey],
...validation,
v: validators?.[validation.validation_public_key],
})
}
onFocus={() => {}}
onKeyUp={() => {}}
onMouseLeave={() => hideTooltip()}
onClick={() =>
setSelectedValidator(
selectedValidator === validator.pubkey ? undefined : validator.pubkey,
selectedValidator === validation.validation_public_key
? undefined
: validation.validation_public_key,
)
}
>
{partial}
{validation.partial && <div className="partial" />}
</div>
)
}
Loading