Skip to content

feat: telemetry motion, dark-mode chip fallback, debounced dispatch, request_withdrawal invariants - #1064

Merged
leojay-net merged 1 commit into
leojay-net:mainfrom
davidmaronio:feat/issues-572-588-671-674
Jun 27, 2026
Merged

feat: telemetry motion, dark-mode chip fallback, debounced dispatch, request_withdrawal invariants#1064
leojay-net merged 1 commit into
leojay-net:mainfrom
davidmaronio:feat/issues-572-588-671-674

Conversation

@davidmaronio

Copy link
Copy Markdown
Contributor

Summary

Implements four assigned issues in a single PR.

feat(frontend): framer-motion animation in chatTelemetry.ts (#674)

Adds reduced-motion-aware, intent-weighted framer-motion variants for telemetry chips/toasts:

  • getTelemetryMotionVariants({ reducedMotion?, intent? }) returns intent-weighted enter/exit variants, or a movement-free fade when reduced motion is requested.
  • prefersReducedMotion() — SSR-safe prefers-reduced-motion detection (honours the user's OS setting, falls back to false on the server).
  • reducedTelemetryMotionVariants (opacity-only) and telemetryEventMotionIntent(name) to map event names → visual weight.
  • The existing telemetryMotionVariants export is unchanged.

feat(frontend): dark mode fallback in useTransactionFilters.ts (#671)

Guarantees filter chip tones render correctly in dark mode:

  • withDarkModeFallback(tone) / ensureDarkModeClasses(className, fallback) backfill neutral dark: classes onto any tone field that lacks them.
  • getAccessibleFilterChipTone now passes tones through the fallback. Built-in palettes already ship dark: variants, so they are returned unchanged (no regression).

feat(frontend): debounce mechanism in chatStateMachine.ts (#588)

Adds createDebouncedDispatcher(machine, delayMs) — a debounced event dispatcher that collapses rapid event bursts (e.g. fast typing repeatedly firing SEND_MESSAGE) into a single trailing transition. Exposes dispatch / flush / cancel / isPending and a DEFAULT_DISPATCH_DEBOUNCE_MS default.

feat(contract): invariant tests for request_withdrawal (#572)

New test_issue_572 module locking in the accounting invariants request_withdrawal enforces via check_invariants:

  • liabilities grow by exactly the requested amount; queue depth increments by one;
  • total_liabilities <= net_deposited and on-chain balance covers the net position;
  • over-commit / zero-amount / unwhitelisted-token requests are rejected and leave state unchanged (no partial mutation);
  • request ids are unique and monotonic; a successful request emits a WithdrawalRequested event.

Build unblock (pre-existing, not caused by this change)

The contract crate did not compile on main due to a botched merge, which also blocked these new tests from compiling. Minimal fixes restore the intended API:

  • src/math.rs had duplicate mul_div_floor / mul_div_ceil definitions (one mangled) and was missing the checked_mul_div_floor / checked_mul_div_ceil helpers that lib.rs already calls at two sites. Reconstructed the checked helpers + panicking wrappers; behaviour is validated by the crate's existing math tests.
  • src/test.rs referenced a renamed binding (token_token).

Test plan

  • pnpm exec vitest run for the three affected frontend test files — 109 passed
  • tsc --noEmit — no errors in the changed files
  • eslint — clean on all changed frontend files
  • cargo test (contract crate) — 379 passed, 0 failed (incl. the 7 new invariant tests and the math tests)
  • cargo clippy — no warnings introduced by the changed/added files

Out of scope (pre-existing on main)

  • Dechat/dex_with_fiat_frontend/src/hooks/useChat.ts still contains unresolved merge-conflict markers (fails tsc/build) — untouched here.
  • 7 pre-existing clippy warnings in other contract test files (unused variables) remain; none are in the files changed by this PR.

Closes #674
Closes #671
Closes #588
Closes #572

…request_withdrawal invariants

Implements four assigned issues:
- chatTelemetry: reduced-motion-aware, intent-weighted framer-motion variants (leojay-net#674)
- useTransactionFilters: dark-mode fallback for filter chip tones (leojay-net#671)
- chatStateMachine: debounced event dispatcher that collapses rapid event bursts (leojay-net#588)
- stellar-contracts: invariant tests for request_withdrawal (leojay-net#572)

The contract crate did not compile on main due to a pre-existing botched merge:
math.rs had duplicated mul_div_floor/mul_div_ceil and was missing the
checked_mul_div_* helpers that lib.rs already calls, and test.rs referenced a
renamed binding. Minimal fixes restore the intended API so the new invariant
tests compile and the full suite passes.

Closes leojay-net#674
Closes leojay-net#671
Closes leojay-net#588
Closes leojay-net#572
@drips-wave

drips-wave Bot commented Jun 27, 2026

Copy link
Copy Markdown

@davidmaronio Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@leojay-net
leojay-net merged commit d12c57a into leojay-net:main Jun 27, 2026
3 of 6 checks passed
leojay-net added a commit that referenced this pull request Jul 25, 2026
feat: telemetry motion, dark-mode chip fallback, debounced dispatch, request_withdrawal invariants
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants