Skip to content

Commit dbc5cee

Browse files
committed
feat: offer the area code block on Lookup's result card
A +33 1 lookup showed the offer only after two scrolls and Open full detail. The card now reuses areaCodeBlock and blockAreaCodeWithUndo, so the label, description and Undo match the number's screen. Checked on the S22 by scripts/device_smoke.py (+33 1 offered and undone, +81 42 not offered).
1 parent 24c5cc9 commit dbc5cee

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ All notable changes to CallShield will be documented in this file.
1313
report itself stays sent. One report rarely blocks a number for everyone,
1414
so you kept getting the calls unless you also tapped Block. A number you'd
1515
blocked already keeps its block exactly as it was.
16+
- Lookup's result card now offers to block the number's whole area code,
17+
with Undo, the same way a number's own screen does. Before, you had to
18+
scroll down and open the full detail to find it.
1619

1720
## v1.12.0 (2026-10-09)
1821

‎app/src/main/java/com/sysadmindoc/callshield/ui/screens/lookup/LookupScreen.kt‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ import com.sysadmindoc.callshield.data.SpamRepository
9797
import com.sysadmindoc.callshield.data.areacodes.AreaCodeLookup
9898
import com.sysadmindoc.callshield.domain.model.SpamCheckResult
9999
import com.sysadmindoc.callshield.ui.MainViewModel
100+
import com.sysadmindoc.callshield.ui.areaCodeBlock
101+
import com.sysadmindoc.callshield.ui.blockAreaCodeWithUndo
100102
import com.sysadmindoc.callshield.ui.friendlyMatchReasonLabel
101103
import com.sysadmindoc.callshield.ui.friendlyPipelineCheckerLabel
102104
import com.sysadmindoc.callshield.ui.friendlySpamTypeLabel
@@ -529,6 +531,29 @@ fun LookupScreen(viewModel: MainViewModel) {
529531
modifier = Modifier.fillMaxWidth(),
530532
outlined = true,
531533
)
534+
// The same offer as the number's screen, which sat two
535+
// scrolls down behind Open full detail.
536+
val location = remember(resultNumber, homeRegion) { AreaCodeLookup.lookup(resultNumber, homeRegion) }
537+
remember(resultNumber, homeRegion) { areaCodeBlock(resultNumber, homeRegion) }?.let { areaCode ->
538+
val description =
539+
if (location != null) {
540+
stringResource(R.string.detail_block_area_code_description_location, areaCode.label, location)
541+
} else {
542+
stringResource(R.string.detail_block_area_code_description, areaCode.label)
543+
}
544+
PremiumActionButton(
545+
label = stringResource(R.string.detail_block_area_code, areaCode.label),
546+
icon = Icons.Default.FilterAlt,
547+
color = CatYellow,
548+
onClick = {
549+
scope.launch {
550+
blockAreaCodeWithUndo(viewModel, snackbarHostState, resources, areaCode, description)
551+
}
552+
},
553+
modifier = Modifier.fillMaxWidth(),
554+
outlined = true,
555+
)
556+
}
532557
}
533558
}
534559

0 commit comments

Comments
 (0)