Skip to content

Conversation

@linuxhd0
Copy link

Adds an optional toggle to the blocklist settings that allows filtering articles based on their summaries/descriptions in addition to titles.

  • Toggle defaults to OFF (title-only filtering, less aggressive)
  • When enabled, checks both article titles and RSS descriptions
  • Settings state persists across app restarts
  • Includes 11 passing tests (unit and instrumented)

The feature uses SQLite glob pattern matching and integrates with the existing BlocklistUpdateJob to re-apply filters when toggle changes.

Adds an optional toggle to the blocklist settings that allows filtering
articles based on their summaries/descriptions in addition to titles.

- Toggle defaults to OFF (title-only filtering, less aggressive)
- When enabled, checks both article titles and RSS descriptions
- Settings state persists across app restarts
- Includes 11 passing tests (unit and instrumented)

The feature uses SQLite glob pattern matching and integrates with the
existing BlocklistUpdateJob to re-apply filters when toggle changes.
Copy link
Owner

@spacecowboy spacecowboy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 I think it is a good change

See one comment about parameter ordering though. Otherwise LGTM

(Sorry for the delay, I've been without a proper computer for a while)

Comment on lines +52 to +60
items: ImmutableHolder<List<String>>,
onDismiss: () -> Unit,
onRemoveItem: (String) -> Unit,
onAddItem: (String) -> Unit,
modifier: Modifier = Modifier,
showToggle: Boolean = false,
toggleValue: Boolean = false,
toggleLabel: String = "",
onToggleChange: (Boolean) -> Unit = {},
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks conventional order of arguments for compose

The order should be values, lambdas, modifier

items: ImmutableHolder<List<String>>,
showToggle: Boolean = false,
toggleValue: Boolean = false,
toggleLabel: String = "",
onDismiss: () -> Unit,
onRemoveItem: (String) -> Unit,
onAddItem: (String) -> Unit,
onToggleChange: (Boolean) -> Unit = {},
modifier: Modifier = Modifier,

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Move value parameters before lambdas, and modifier to end in EditableListDialog
and ListDialogSetting. Follows Compose convention of: values -> lambdas -> modifier.
@linuxhd0
Copy link
Author

I appreciate the work you put into this.

@linuxhd0 linuxhd0 requested a review from spacecowboy January 31, 2026 20:14
@spacecowboy
Copy link
Owner

You can see the output of the ktlint CI check. Modifier should be the first optional argument. Possibly something else needs moving too

EditableListDialog.kt:50

/home/runner/work/Feeder/Feeder/app/src/main/java/com/nononsenseapps/feeder/ui/compose/dialog/EditableListDialog.kt:50:5 Parameters in a composable function should be ordered following this pattern: params without defaults, modifiers, params with defaults and optionally, a trailing function that might not have a default param.
* What went wrong:
Current params are: [title: @Composable () -> Unit, items: ImmutableHolder<List<String>>, showToggle: Boolean = false, toggleValue: Boolean = false, toggleLabel: String = "", onDismiss: () -> Unit, onRemoveItem: (String) -> Unit, onAddItem: (String) -> Unit, onToggleChange: (Boolean) -> Unit = {}, modifier: Modifier = Modifier] 

but could be [title: @Composable () -> Unit, items: ImmutableHolder<List<String>>, onDismiss: () -> Unit, onRemoveItem: (String) -> Unit, onAddItem: (String) -> Unit, modifier: Modifier = Modifier, showToggle: Boolean = false, toggleValue: Boolean = false, toggleLabel: String = "", onToggleChange: (Boolean) -> Unit = {}].

Settings.kt:1008

/home/runner/work/Feeder/Feeder/app/src/main/java/com/nononsenseapps/feeder/ui/compose/settings/Settings.kt:1008:5 Parameters in a composable function should be ordered following this pattern: params without defaults, modifiers, params with defaults and optionally, a trailing function that might not have a default param.
Current params are: [title: String, dialogTitle: @Composable () -> Unit, currentValue: ImmutableHolder<List<String>>, showToggle: Boolean = false, toggleValue: Boolean = false, toggleLabel: String = "", icon: @Composable () -> Unit = {}, onAddItem: (String) -> Unit, onRemoveItem: (String) -> Unit, onToggleChange: (Boolean) -> Unit = {}, modifier: Modifier = Modifier] 

but could be [title: String, dialogTitle: @Composable () -> Unit, currentValue: ImmutableHolder<List<String>>, onAddItem: (String) -> Unit, onRemoveItem: (String) -> Unit, modifier: Modifier = Modifier, showToggle: Boolean = false, toggleValue: Boolean = false, toggleLabel: String = "", icon: @Composable () -> Unit = {}, onToggleChange: (Boolean) -> Unit = {}].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants