feat(dao): tap-to-explain tooltip on the APC label#279
Conversation
User-reported via Telegram: Pocket Node's DAO APC reads 1.55% while Neuron displays ~2% for the same time window. Investigation showed the two wallets compute fundamentally different numbers — Pocket Node displays *realized* APC (actual compensation / actual elapsed time on this specific deposit), while Neuron displays *theoretical* APC (a forward-looking projection from CKB tokenomics). Both are valid. The realized number is the truth about this deposit; the theoretical number is an estimate of what a new deposit might earn under idealised conditions. Realized APC fluctuates around the theoretical based on actual on-chain participation. We keep realized as the displayed value (it's more accurate to what the user has actually earned), but add a tap-to-explain affordance so users comparing against Neuron understand why the numbers differ instead of assuming a bug. What ships - New `ApcLabel` Composable in ui/screens/dao/components/. Renders the APC text with an underline + small info icon. Tapping the whole row opens an AlertDialog with a three-paragraph explanation. - DaoScreen overview header and DaoDepositCard per-deposit row both now use ApcLabel. Refs Telegram bug report (georgiev, 2026-05-21)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughA new reusable ChangesAPC Label Component Refactor
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@android/app/src/main/java/com/rjnr/pocketnode/ui/screens/dao/components/ApcLabel.kt`:
- Around line 69-89: Replace the hard-coded English strings in the ApcLabel
dialog with string resources: move the title "About this APC", the long
explanation paragraph, and the confirm button label "Got it" into
res/values/strings.xml (e.g. dao_apc_dialog_title, dao_apc_dialog_explanation,
dao_apc_dialog_confirm) and update the composable usages in ApcLabel (the title
lambda, the text lambda where Text(...) uses the long explanation, and the
confirmButton/Text) to call stringResource(R.string.<name>) so the dialog uses
localized strings instead of inline literals.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d5a3472a-bfe9-4023-b66e-c23819411cc1
📒 Files selected for processing (3)
android/app/src/main/java/com/rjnr/pocketnode/ui/screens/dao/DaoScreen.ktandroid/app/src/main/java/com/rjnr/pocketnode/ui/screens/dao/components/ApcLabel.ktandroid/app/src/main/java/com/rjnr/pocketnode/ui/screens/dao/components/DaoDepositCard.kt
| title = { Text("About this APC") }, | ||
| text = { | ||
| Text( | ||
| text = "This number is the realized annual compensation rate: " + | ||
| "the actual CKB earned on this deposit divided by the time " + | ||
| "it has been deposited.\n\n" + | ||
| "It may differ from the APC shown by other CKB wallets such " + | ||
| "as Neuron. Neuron displays a theoretical APC computed from " + | ||
| "the protocol's tokenomics — a forward-looking projection " + | ||
| "assuming idealised conditions. Realized APC tracks what " + | ||
| "your specific deposit has earned, which fluctuates with " + | ||
| "actual on-chain participation.\n\n" + | ||
| "Both numbers are valid. The realized number is the truth " + | ||
| "about your deposit; the theoretical number is an estimate " + | ||
| "of what a new deposit might earn.", | ||
| style = MaterialTheme.typography.bodyMedium, | ||
| ) | ||
| }, | ||
| confirmButton = { | ||
| TextButton(onClick = { showInfo = false }) { | ||
| Text("Got it") |
There was a problem hiding this comment.
🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win
Extract hard-coded strings to string resources.
The dialog title, explanation text, and button label are hard-coded in English, while the rest of the codebase uses stringResource(R.string.*) for i18n. This breaks localization and violates the DRY principle established elsewhere in the project.
♻️ Suggested extraction to res/values/strings.xml
Add to res/values/strings.xml:
<string name="dao_apc_dialog_title">About this APC</string>
<string name="dao_apc_dialog_explanation">This number is the realized annual compensation rate: the actual CKB earned on this deposit divided by the time it has been deposited.\n\nIt may differ from the APC shown by other CKB wallets such as Neuron. Neuron displays a theoretical APC computed from the protocol\'s tokenomics — a forward-looking projection assuming idealised conditions. Realized APC tracks what your specific deposit has earned, which fluctuates with actual on-chain participation.\n\nBoth numbers are valid. The realized number is the truth about your deposit; the theoretical number is an estimate of what a new deposit might earn.</string>
<string name="dao_apc_dialog_confirm">Got it</string>Then update the code:
+import androidx.compose.ui.res.stringResource
+import com.rjnr.pocketnode.R
+
`@Composable`
fun ApcLabel(
...
) {
...
if (showInfo) {
AlertDialog(
onDismissRequest = { showInfo = false },
- title = { Text("About this APC") },
+ title = { Text(stringResource(R.string.dao_apc_dialog_title)) },
text = {
Text(
- text = "This number is the realized annual compensation rate: " +
- "the actual CKB earned on this deposit divided by the time " +
- ...
+ text = stringResource(R.string.dao_apc_dialog_explanation),
style = MaterialTheme.typography.bodyMedium,
)
},
confirmButton = {
- TextButton(onClick = { showInfo = false }) {
- Text("Got it")
- }
+ TextButton(onClick = { showInfo = false }) {
+ Text(stringResource(R.string.dao_apc_dialog_confirm))
+ }
},
)
}
}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@android/app/src/main/java/com/rjnr/pocketnode/ui/screens/dao/components/ApcLabel.kt`
around lines 69 - 89, Replace the hard-coded English strings in the ApcLabel
dialog with string resources: move the title "About this APC", the long
explanation paragraph, and the confirm button label "Got it" into
res/values/strings.xml (e.g. dao_apc_dialog_title, dao_apc_dialog_explanation,
dao_apc_dialog_confirm) and update the composable usages in ApcLabel (the title
lambda, the text lambda where Text(...) uses the long explanation, and the
confirmButton/Text) to call stringResource(R.string.<name>) so the dialog uses
localized strings instead of inline literals.
Summary
Telegram user reported Pocket Node's DAO APC reading 1.55% vs Neuron showing ~2%. Investigation found the two wallets compute fundamentally different numbers:
Both are valid. Realized fluctuates around theoretical based on actual on-chain participation. Keeping realized as the displayed value (accurate to what the user actually earned) but adding tap-to-explain so users comparing wallets understand the difference.
What ships
Test plan
Refs Telegram bug report (georgiev, 2026-05-21), pairs with PR #276 (the underlying APC math fix for withdrawing cells)
Summary by CodeRabbit
New Features
Refactor