@@ -44,7 +44,7 @@ import to.bitkit.ext.amountSats
4444import to.bitkit.ext.balanceUiText
4545import to.bitkit.ext.channelId
4646import to.bitkit.ext.createChannelDetails
47- import to.bitkit.ext.formatted
47+ import to.bitkit.ext.formatToString
4848import to.bitkit.ext.uri
4949import to.bitkit.models.NodeLifecycleState
5050import to.bitkit.models.Toast
@@ -68,7 +68,6 @@ import to.bitkit.ui.theme.Colors
6868import to.bitkit.ui.utils.copyToClipboard
6969import to.bitkit.ui.utils.withAccent
7070import to.bitkit.viewmodels.MainUiState
71- import java.time.Instant
7271
7372@Composable
7473fun NodeInfoScreen (
@@ -194,30 +193,53 @@ private fun NodeStateSection(
194193 Column (modifier = Modifier .fillMaxWidth()) {
195194 SectionHeader (" Node State" )
196195 SettingsTextButtonRow (
197- title = " Node State: " ,
196+ title = stringResource( R .string.lightning__status) ,
198197 value = nodeLifecycleState.uiText,
199198 )
200199
201200 nodeStatus?.let { status ->
202201 SettingsTextButtonRow (
203- title = " Ready: " ,
202+ title = stringResource( R .string.common_ready) ,
204203 value = if (status.isRunning) " ✅" else " ⏳" ,
205204 )
206205 SettingsTextButtonRow (
207- title = " Lightning wallet sync time:" ,
206+ title = stringResource(R .string.lightning__block_height),
207+ value = " ${status.currentBestBlock.height} " ,
208+ )
209+ SettingsTextButtonRow (
210+ title = stringResource(R .string.lightning__monitor_height),
211+ value = status.latestChannelMonitorArchivalHeight
212+ ?.let { " $it " }
213+ ? : stringResource(R .string.common__never),
214+ )
215+ SettingsTextButtonRow (
216+ title = stringResource(R .string.lightning__node_sync_time),
208217 value = status.latestLightningWalletSyncTimestamp
209- ?.let { Instant .ofEpochSecond(it.toLong()).formatted() }
210- ? : " Never " ,
218+ ?.formatToString()
219+ ? : stringResource( R .string.common__never) ,
211220 )
212221 SettingsTextButtonRow (
213- title = " Onchain wallet sync time: " ,
222+ title = stringResource( R .string.lightning__onchain_sync_time) ,
214223 value = status.latestOnchainWalletSyncTimestamp
215- ?.let { Instant .ofEpochSecond(it.toLong()).formatted() }
216- ? : " Never " ,
224+ ?.formatToString()
225+ ? : stringResource( R .string.common__never) ,
217226 )
218227 SettingsTextButtonRow (
219- title = " Block height:" ,
220- value = " ${status.currentBestBlock.height} " ,
228+ title = stringResource(R .string.lightning__fee_rate_update_time),
229+ value = status.latestFeeRateCacheUpdateTimestamp
230+ ?.formatToString()
231+ ? : stringResource(R .string.common__never),
232+ )
233+ SettingsTextButtonRow (
234+ title = stringResource(R .string.lightning__rgs_snapshot_time),
235+ value = status.latestRgsSnapshotTimestamp
236+ ?.formatToString()
237+ ? : stringResource(R .string.common__never),
238+ )
239+ SettingsTextButtonRow (
240+ title = stringResource(R .string.lightning__scores_sync_time),
241+ value = status.latestPathfindingScoresSyncTimestamp?.formatToString()
242+ ? : stringResource(R .string.common__never),
221243 )
222244 }
223245 }
@@ -226,23 +248,23 @@ private fun NodeStateSection(
226248@Composable
227249private fun WalletBalancesSection (balanceDetails : BalanceDetails ) {
228250 Column (modifier = Modifier .fillMaxWidth()) {
229- SectionHeader (" Wallet Balances " )
251+ SectionHeader (stringResource( R .string.lightning__wallet_balances) )
230252 Column {
231253 SettingsTextButtonRow (
232- title = " Total onchain: " ,
254+ title = stringResource( R .string.lightning__total_onchain) ,
233255 value = " ₿ ${balanceDetails.totalOnchainBalanceSats.formatToModernDisplay()} " ,
234256 )
235257 SettingsTextButtonRow (
236- title = " Spendable onchain: " ,
258+ title = stringResource( R .string.lightning__spendable_onchain) ,
237259 value = " ₿ ${balanceDetails.spendableOnchainBalanceSats.formatToModernDisplay()} " ,
238260 )
239261 SettingsTextButtonRow (
240- title = " Total anchor channels reserve: " ,
241- value = " ₿ ${balanceDetails.totalAnchorChannelsReserveSats .formatToModernDisplay()} " ,
262+ title = stringResource( R .string.lightning__total_lightning) ,
263+ value = " ₿ ${balanceDetails.totalLightningBalanceSats .formatToModernDisplay()} " ,
242264 )
243265 SettingsTextButtonRow (
244- title = " Total lightning: " ,
245- value = " ₿ ${balanceDetails.totalLightningBalanceSats .formatToModernDisplay()} " ,
266+ title = stringResource( R .string.lightning__total_anchor_channels_reserve) ,
267+ value = " ₿ ${balanceDetails.totalAnchorChannelsReserveSats .formatToModernDisplay()} " ,
246268 )
247269 }
248270 }
@@ -251,7 +273,7 @@ private fun WalletBalancesSection(balanceDetails: BalanceDetails) {
251273@Composable
252274private fun LightningBalancesSection (balances : List <LightningBalance >) {
253275 Column (modifier = Modifier .fillMaxWidth()) {
254- SectionHeader (" Lightning Balances " )
276+ SectionHeader (stringResource( R .string.lightning__lightning_balances) )
255277 balances.forEach { balance ->
256278 Column (
257279 modifier = Modifier .fillMaxWidth()
@@ -321,39 +343,39 @@ private fun ChannelsSection(
321343 VerticalSpacer (8 .dp)
322344
323345 ChannelDetailRow (
324- title = " Ready: " ,
346+ title = stringResource( R .string.common_ready) ,
325347 value = if (channel.isChannelReady) " ✅" else " ❌" ,
326348 )
327349 ChannelDetailRow (
328- title = " Usable: " ,
350+ title = stringResource( R .string.common__usable) ,
329351 value = if (channel.isUsable) " ✅" else " ❌" ,
330352 )
331353 ChannelDetailRow (
332- title = " Announced: " ,
354+ title = stringResource( R .string.common__announced) ,
333355 value = if (channel.isAnnounced) " 🌐" else " 🔒" ,
334356 )
335357 ChannelDetailRow (
336- title = " Inbound capacity: " ,
358+ title = stringResource( R .string.lightning__inbound_capacity) ,
337359 value = " ₿ ${(channel.inboundCapacityMsat / 1000u ).formatToModernDisplay()} " ,
338360 )
339361 ChannelDetailRow (
340- title = " Inbound htlc max: " ,
362+ title = stringResource( R .string.lightning__inbound_htlc_max) ,
341363 value = " ₿ ${(channel.inboundHtlcMaximumMsat?.div(1000u ) ? : 0u ).formatToModernDisplay()} " ,
342364 )
343365 ChannelDetailRow (
344- title = " Inbound htlc min: " ,
366+ title = stringResource( R .string.lightning__inbound_htlc_min) ,
345367 value = " ₿ ${(channel.inboundHtlcMinimumMsat / 1000u ).formatToModernDisplay()} " ,
346368 )
347369 ChannelDetailRow (
348- title = " Next outbound htlc limit: " ,
370+ title = stringResource( R .string.lightning__next_outbound_htlc_limit) ,
349371 value = " ₿ ${(channel.nextOutboundHtlcLimitMsat / 1000u ).formatToModernDisplay()} " ,
350372 )
351373 ChannelDetailRow (
352- title = " Next outbound htlc min: " ,
374+ title = stringResource( R .string.lightning__next_outbound_htlc_min) ,
353375 value = " ₿ ${(channel.nextOutboundHtlcMinimumMsat / 1000u ).formatToModernDisplay()} " ,
354376 )
355377 ChannelDetailRow (
356- title = " Confirmations: " ,
378+ title = stringResource( R .string.common_confirmations) ,
357379 value = " ${channel.confirmations ? : 0 } /${channel.confirmationsRequired ? : 0 } " ,
358380 )
359381
@@ -452,7 +474,6 @@ private fun PreviewDevMode() {
452474 nodeLifecycleState = NodeLifecycleState .Running ,
453475 nodeStatus = NodeStatus (
454476 isRunning = true ,
455- isListening = true ,
456477 currentBestBlock = BestBlock (
457478 height = 1000u ,
458479 blockHash = " 0123456789abcDef" ,
@@ -463,6 +484,7 @@ private fun PreviewDevMode() {
463484 latestRgsSnapshotTimestamp = null ,
464485 latestNodeAnnouncementBroadcastTimestamp = null ,
465486 latestChannelMonitorArchivalHeight = null ,
487+ latestPathfindingScoresSyncTimestamp = null ,
466488 ),
467489 nodeId = " 0348a2b7c2d3f4e5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9" ,
468490 peers = listOf (Env .Peers .staging),
0 commit comments