Skip to content

On-chain event poll for task verification with auto-sort animation - #7

Open
Meet-hybrid wants to merge 52 commits into
mainfrom
fix/issue-9-event-poll
Open

On-chain event poll for task verification with auto-sort animation#7
Meet-hybrid wants to merge 52 commits into
mainfrom
fix/issue-9-event-poll

Conversation

@Meet-hybrid

Copy link
Copy Markdown
Owner

Summary

Implements an on-chain event polling sub-module that simulates task verification events, intercepts them app-wide, and animates task card re-sorting when tasks flip to resolved.

Changes

New files

  • src/hooks/useTaskChainEvents.ts — polling hook that simulates on-chain task_verified events at a configurable interval (default 3s), emits into the shared event bus via busPublish, and calls invalidateChainState for task-related cache keys
  • src/hooks/__tests__/useTaskChainEvents.test.ts — 3 unit tests verifying polling behavior, disabled mode, and event emission

Modified files

  • src/hooks/useEvents.ts — export busPublish so external modules (like the poller) can publish to the global event bus
  • src/components/EventMonitor/eventMonitorUtils.ts — add task_verified (ShieldCheck) and task_completed (ThumbsUp) event type entries
  • src/components/TaskCard.tsx — subscribe to polled events via useTaskChainEvents + useEvents, auto-sort completed tasks to the bottom, animate with scale-[1.02] + animate-in zoom-in-95 fade-in on state change, emit events on Vote click
  • src/i18n/config.ts — add typeTaskVerified / typeTaskCompleted translation keys in en, es, fr
  • src/components/__tests__/TaskCard.test.tsx — extend tests: vote removes button, sort order (completed at bottom), animation class applied on vote

Verification

  • All 43 related tests pass (7 test suites)
  • Pre-existing failures in txBuilder, logger, VoteButton, MultiSigPreviewer are unrelated

onajidavid87-web and others added 30 commits June 21, 2026 12:54
…nvalidation system to cache on-chain data with stale-while-revalidate semantics.

Added a custom React hook that integrates with the existing useChainState invalidation system to cache on-chain data with stale-while-revalidate semantics.
Key features:
- Module-level shared cache — multiple hook instances with the same cacheKey share cached data (same pattern as useChainState/useEvents)
- useChainState integration — listens to syncVersion changes and automatically re-fetches when the chain state is invalidated (WebSocket events, polling, or manual force-sync)
- Stale-while-revalidate — returns cached data immediately while re-fetching in the background (isValidating distinguishes initial load from background refresh)
- Request deduplication — concurrent fetches for the same cache key within dedupIntervalMs (default 2s) are deduplicated
- mutate(data) — optimistic local cache updates
- revalidate() — manual re-fetch
- onSuccess/onError callbacks
src/hooks/__tests__/useOnChainCache.test.ts

Closes Vero-protocol#25
A custom React hook that integrates with the existing useChainState i…
…llet-session-security

feat(auth): implement automatic 15-minute inactivity wallet session t…
feat: Add real-time ConsensusWidget to dashboard grid
…igning

Title: feat: implement multi-transaction signing for Soroban operations
Implement live contributor activity tracking and profile fetching
…ort animation

- Add useTaskChainEvents hook: polls for task_verified events, emits into the
  shared useEvents bus, and invalidates chain state cache
- Export busPublish from useEvents so the poller can publish globally
- Add task_verified / task_completed event types with icons to eventMonitorUtils
- Update TaskCard: subscribe to polled events, auto-resort completed tasks to
  bottom, animate transitions with scale/fade classes on state flip
- Add i18n keys for typeTaskVerified / typeTaskCompleted (en, es, fr)
- Write unit tests for useTaskChainEvents and extend TaskCard tests for vote,
  sort order, and animation classes
…of-history

feat: add ZK-proof submission history panel
…ard-widget-customization

feat: add customizable dashboard widget layouts with GridStack
…ilder mocks for SDK compat

- logger: pass Uint8Array directly to subtle.decrypt instead of extracting .buffer via bytesToArrayBuffer — cross-realm ArrayBuffer from jsdom is rejected by Node's webcrypto.subtle
- VoteButton: add missing mockUseNetwork variable, remove duplicate mock
- txBuilder: call .build() on SorobanDataBuilder, add results array with auth/xdr to match newer @stellar/stellar-sdk expectations
…lient

feat: Socket.IO client integration for persistent WS state updates
Meet-hybrid and others added 22 commits June 24, 2026 13:10
…-task-vote

feat: optimistic update loop for task Verify Quality button
…ian-dashboard

Add dev-only tool to mock wallet publicKey (reduces reconnect friction)
…-localization

feat: add language localization support
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.

10 participants