Skip to content

feat!: rebrand as nudge and rewrite the engine - #17

Merged
AngeloAvv merged 1 commit into
masterfrom
feat/nudge
Oct 21, 2026
Merged

AngeloAvv merged 1 commit into
masterfrom
feat/nudge

Conversation

@AngeloAvv

Copy link
Copy Markdown
Owner

Summary

Renames the package to nudge (flutter_trigger is already taken on pub.dev by another publisher) and rewrites the engine. The fluent builder DSL is kept.

Engine

  • Conditions are immutable descriptions, compared by value and evaluated in a single pass against the initialized instance: no transient values in and/or, no resubscription on parent rebuilds, relative time windows (inLast, today) re-evaluated on resume and periodically.
  • Nudges: define(id).when(...).cooldown(...).maxFires(...).oncePerSession().groupCooldown(...).onOutcome(...).register(), fired with checkpoint() (priority + group), fire() or NudgeFireListener; outcomes via NudgeFire.complete, chaining via when().fired(id); explainNudge(id) shows the blocking policy.
  • Lifetime stats per event and the fire history survive log rotation; sessions follow the app lifecycle with a timeout.
  • Storage behind NudgeStorage: ObjectBox (flex attributes, no orphaned rows, attach on hot restart) and InMemoryNudgeStorage for tests; injectable Clock.

Fixes over 0.1.0

Same-millisecond funnel steps, funnel session constraints ignored on earlier steps, completed funnels flipping back, listener re-firing on rebuild, first-frame flicker in the builder, orphaned attributes after purge, strict timestamp bounds, concurrent initialize, empty funnel crash, missing flat_buffers dependency (blocked publishing).

Docs and CI

  • docs.page documentation (docs.json, docs/, excluded from the archive via .pubignore): guides plus 12 recipes with sources; every recipe is executed in test/recipes_test.dart.
  • CI: tests (including the storage contract on the real ObjectBox engine), format gate, generated-code check, docs sidebar/link check, flutter pub publish --dry-run.
  • COPYING renamed to LICENSE (content unchanged) as pub.dev expects.

Test plan

  • flutter analyze (package and example)
  • flutter test: 117 package tests, 2 example tests, ObjectBox suite with the native library
  • Fresh build_runner output matches the committed bindings
  • flutter pub publish --dry-run on a clean checkout: 0 warnings
  • CI platform builds (Android, iOS, Linux, macOS, Windows)

Rename the package to nudge (flutter_trigger is taken on pub.dev) and
rewrite the engine around immutable conditions evaluated against the
initialized instance.

- Conditions compare by value and are evaluated in one pass: no transient
  values, no resubscriptions on rebuild, relative time windows.
- Nudges: definitions with cooldowns, caps, once per session, group
  policies, priorities, outcome-based policies and chaining, fired at
  checkpoints, directly or through NudgeFireListener.
- New conditions: attribute filters, distinct values, active days,
  streaks, recency, app-wide metrics, funnel windows, single-session
  funnels and drop-off.
- Lifetime stats and fire history survive log rotation; sessions follow
  the app lifecycle.
- Pluggable storage with an in-memory implementation and an injectable
  clock; flex attributes replace the orphan-prone relation.
- Tests for the DSL, nudges, widgets, storage contract and every
  documented recipe; docs.page documentation; CI for tests on the
  ObjectBox engine, format, codegen, docs links and dry-run publish.
@coderabbitai

coderabbitai Bot commented Oct 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 103 files, which is 3 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 23e37c07-1e30-4c14-8d22-bc533b3a4fe2
📥 Commits

Reviewing files that changed from the base of the PR and between 36eecf1 and 39970f8.

⛔ Files ignored due to path filters: 1
  • example/pubspec.lock is excluded by !**/*.lock
📒 Files selected for processing: 103
  • .github/scripts/check_docs.sh
  • .github/workflows/analyze.yml
  • .github/workflows/checks.yml
  • .github/workflows/default.yml
  • .github/workflows/test.yml
  • .gitignore
  • .pubignore
  • CHANGELOG.md
  • LICENSE
  • README.md
  • analysis_options.yaml
  • build.yaml
  • docs.json
  • docs/concepts.mdx
  • docs/conditions.mdx
  • docs/events.mdx
  • docs/funnels.mdx
  • docs/getting-started.mdx
  • docs/index.mdx
  • docs/nudges.mdx
  • docs/recipes.mdx
  • docs/recipes/abandoned-cart.mdx
  • docs/recipes/activation.mdx
  • docs/recipes/feature-discovery.mdx
  • docs/recipes/frequency-capping.mdx
  • docs/recipes/guest-to-account.mdx
  • docs/recipes/nps-and-referral.mdx
  • docs/recipes/onboarding.mdx
  • docs/recipes/paywall.mdx
  • docs/recipes/push-permission.mdx
  • docs/recipes/rating-prompt.mdx
  • docs/recipes/streaks.mdx
  • docs/recipes/win-back.mdx
  • docs/storage.mdx
  • docs/testing.mdx
  • docs/widgets.mdx
  • example/analysis_options.yaml
  • example/lib/main.dart
  • example/lib/nudges.dart
  • example/pubspec.yaml
  • example/test/widget_test.dart
  • lib/flutter_trigger.dart
  • lib/nudge.dart
  • lib/objectbox-model.json
  • lib/objectbox.g.dart
  • lib/src/builder/aggregate_clause.dart
  • lib/src/builder/attribute_selector.dart
  • lib/src/builder/base_trigger_builder.dart
  • lib/src/builder/count_clause.dart
  • lib/src/builder/event_clause.dart
  • lib/src/builder/event_selector.dart
  • lib/src/builder/funnel_clause.dart
  • lib/src/builder/funnel_session_selector.dart
  • lib/src/builder/funnel_timestamp_selector.dart
  • lib/src/builder/query_filter.dart
  • lib/src/builder/session_count_clause.dart
  • lib/src/builder/session_selector.dart
  • lib/src/builder/timestamp_selector.dart
  • lib/src/builder/trigger_condition.dart
  • lib/src/dsl/event_selector.dart
  • lib/src/dsl/funnel.dart
  • lib/src/dsl/metrics.dart
  • lib/src/dsl/nudge_condition.dart
  • lib/src/dsl/numeric_clause.dart
  • lib/src/dsl/occurrence.dart
  • lib/src/engine/evaluation_context.dart
  • lib/src/engine/maintenance_service.dart
  • lib/src/engine/nudge_engine.dart
  • lib/src/engine/session_manager.dart
  • lib/src/engine/store_manager.dart
  • lib/src/engine/trigger_evaluator.dart
  • lib/src/flutter_trigger.dart
  • lib/src/model/event_record.dart
  • lib/src/model/event_stats.dart
  • lib/src/model/fire_record.dart
  • lib/src/models/attribute.dart
  • lib/src/models/attribute_type.dart
  • lib/src/models/event.dart
  • lib/src/nudge.dart
  • lib/src/nudges/nudge_definition.dart
  • lib/src/storage/in_memory_nudge_storage.dart
  • lib/src/storage/nudge_storage.dart
  • lib/src/storage/objectbox/entities.dart
  • lib/src/storage/objectbox/objectbox-model.json
  • lib/src/storage/objectbox/objectbox.g.dart
  • lib/src/storage/objectbox/objectbox_nudge_storage.dart
  • lib/src/widgets/nudge_builder.dart
  • lib/src/widgets/nudge_fire_listener.dart
  • lib/src/widgets/nudge_listener.dart
  • lib/src/widgets/trigger_builder.dart
  • lib/src/widgets/trigger_listener.dart
  • pubspec.yaml
  • test/dsl/composition_test.dart
  • test/dsl/event_clause_test.dart
  • test/dsl/funnel_test.dart
  • test/dsl/session_test.dart
  • test/engine/nudge_test.dart
  • test/flutter_trigger_test.dart
  • test/helpers.dart
  • test/nudges/nudge_definition_test.dart
  • test/recipes_test.dart
  • test/storage/storage_contract_test.dart
  • test/widgets/widgets_test.dart

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AngeloAvv
AngeloAvv merged commit a3b67cb into master Oct 21, 2026
33 checks passed
@AngeloAvv
AngeloAvv deleted the feat/nudge branch October 21, 2026 10:17
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.

1 participant