Skip to content

Feature/toast animations progress presets - #1

Merged
victorycodedev merged 5 commits into
mainfrom
feature/toast-animations-progress-presets
Aug 28, 2026
Merged

Feature/toast animations progress presets#1
victorycodedev merged 5 commits into
mainfrom
feature/toast-animations-progress-presets

Conversation

@victorycodedev

Copy link
Copy Markdown
Owner

What changed?

Expanded ToastKit with a new set of animation and developer-experience features.

Animations

  • Added snap, pop, reveal, and bounce animations.
  • Added configurable animation direction: auto, left, right, top, and bottom.
  • Added reduced-motion handling where supported.
  • Preserved existing fade, slide, scale, and spring animations.

Progress & loading

  • Added determinate progress support using progress(0-100).
  • Added loading() / loading(false) for indeterminate states.
  • Added smooth progress updates without recreating the toast.
  • Added support for transitioning loading/progress to success, error, or other toast states.

Presets

  • Added reusable toast presets with Toast::definePreset().
  • Added Toast::preset() for creating a fresh builder from a registered preset.
  • Presets can be overridden per toast.
  • Existing sparse updates continue to override only explicitly supplied properties.
  • Added documentation for organizing application presets using an optional App\Toasts\ToastPresets class.

Exceptions

  • Added a ToastKit-specific exception hierarchy with ToastKitException as the base exception.
  • Added specific exceptions where appropriate, including handling for missing presets.

Other

  • Extended the native bridge payload while preserving existing API compatibility.
  • Added/updated PHP and JavaScript tests for the new functionality.
  • Updated documentation with examples for animations, directions, progress, loading, presets, and exceptions.

Why?

These changes make ToastKit more useful for real application feedback beyond simple temporary notifications.

The new animations provide more expressive native feedback for success, error, warning, and informational states.

Progress and loading states make ToastKit suitable for longer-running operations such as uploads, downloads, payments, and background processing.

Presets reduce repeated toast configuration across multiple screens while still allowing individual screens to override any preset configuration when necessary.

The exception hierarchy also gives consumers a consistent ToastKitException base type for handling exceptions originating from ToastKit.

How was it tested?

  • Ran the complete PHP test suite.
  • Ran the JavaScript test suite.
  • Tested existing toast functionality to ensure backward compatibility.
  • Tested all new animation types and directions.
  • Tested determinate progress from 0 through 100, including progress updates.
  • Tested loading and transitions from loading to completed states.
  • Tested preset registration, resolution, overrides, fresh-builder isolation, and missing presets.
  • Tested sparse updates including progress(0) and loading(false).
  • Tested native toast rendering and updates in a generated NativePHP application.
  • Verified Android and iOS behavior for the new native functionality.

Platforms tested

  • PHP
  • JavaScript
  • Android
  • iOS
  • Not applicable / documentation only

Breaking changes?

None.

Existing ToastKit APIs and bridge behavior remain compatible. The new functionality is additive, and existing applications can continue using ToastKit without changes.

Checklist

  • Tests were added or updated where appropriate.
  • Existing relevant tests pass.
  • Documentation was updated where necessary.
  • Public API and event/bridge compatibility were considered.
  • Android/iOS behavior parity was considered where relevant.
  • No unnecessary native dependencies were introduced.
  • No secrets, tokens, temporary logging, or debugging code were committed.
  • Native changes were tested in a generated NativePHP application where practical.

…loading features

- Added new animation types: SNAP, POP, REVEAL, and BOUNCE to ToastKitAnimation.
- Introduced ToastKitDirection enum for customizable toast direction (AUTO, LEFT, RIGHT, TOP, BOTTOM).
- Implemented progress tracking and loading state in ToastKitConfiguration.
- Updated Android and iOS implementations to support new animations and properties.
- Enhanced ToastKitHost to display progress indicators and handle loading states.
- Added validation for new properties in JavaScript and PHP implementations.
- Created a ToastPresetRegistry for managing toast presets and their configurations.
- Added tests for new features, ensuring proper functionality and validation.
@victorycodedev
victorycodedev merged commit b3f1ad4 into main Aug 28, 2026
2 checks passed
@victorycodedev
victorycodedev deleted the feature/toast-animations-progress-presets branch August 28, 2026 20:26
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