Skip to content

feat(core): fix #153, #155, #159, and #180 reduced motion, storage is… - #301

Merged
BigDella merged 1 commit into
Parcel-Protocol:mainfrom
peacebas:feat/issues-153-155-159-180
Oct 19, 2026
Merged

BigDella merged 1 commit into
Parcel-Protocol:mainfrom
peacebas:feat/issues-153-155-159-180

Conversation

@peacebas

Copy link
Copy Markdown
Contributor

Closes #153
Closes #155
Closes #159
Closes #180

This pull request addresses and resolves four core infrastructure and quality issues across accessibility, test isolation, performance budgeting, and administrative protocol security:

  1. Issue [UI] Add reduced-motion preference coverage #153: Reduced-Motion Preference Coverage

    • Problem: Visual feedback components (Skeleton, Button, StatusMessage) used continuous animations, transitions, and pulsing shimmers that created a severe barrier for users with vestibular disorders or motion sensitivities. Furthermore, UI tests lacked a standardized utility to detect and respond to user-level motion reduction preferences.
    • Resolution & Flow: Added prefersReducedMotion(defaultValue = false) and the useReducedMotion(defaultValue = false) React hook in core/ui/accessibility.ts. Updated Skeleton to use motion-reduce:animate-none alongside data-contract-state="loading" so the loading placeholder maintains its size and shape without perpetual pulsation. Updated Button and StatusMessage with motion-reduce:transition-none and motion-reduce:transform-none for instant visual state changes. Added global CSS rules in app/globals.css ensuring instant scrolling and zeroed keyframe transitions under prefers-reduced-motion: reduce.
    • Why It Matters: Guarantees full WCAG 2.1 Success Criterion 2.3.3 (Animation from Interactions) compliance while ensuring component state visibility does not depend on animation completion.
  2. Issue [Testing] Add deterministic browser storage isolation #155: Deterministic Browser Storage Isolation

    • Problem: Shared browser storage (localStorage, sessionStorage) in test environments caused persistent state (selected network, notifications, session tokens) to leak across independent component tests, causing flaky, order-dependent failures that were difficult to reproduce.
    • Resolution & Flow: Created createIsolatedStorage() in core/testing/render.tsx, providing a memory-backed W3C Storage implementation with $O(1)$ operations. Injected this isolated storage fixture directly into NetworkProvider via a new optional storage?: Storage prop, and exported resetNetworkStorageListeners() for deterministic test cleanup. Bound isolated storage to both NetworkProvider and NotificationStore in the shared renderFeature harness.
    • Why It Matters: Guarantees complete test isolation; tests can run in arbitrary order without cross-test state contamination, while still allowing intentional multi-step persistence testing when an isolated fixture is explicitly shared across mounts.
  3. Issue [Performance] Establish feature initial-load performance budgets #159: Feature Initial-Load Performance Budgets

    • Problem: Per-feature isolated bundle budgets did not capture route-level initial-load costs (First Load JS shared chunks on /tools/[slug]), and SDK-heavy tools requiring extensive XDR and Soroban type schemas lacked an objective, documented exception pathway.
    • Resolution & Flow: Extended scripts/bundle-budget.mjs with analyzeRouteInitialLoad(), which inspects Next.js .next/build-manifest.json and evaluates the true disk footprint of shared entrypoint chunks (/_app, polyfills, main chunks, tool shell). Enforces a 220 KB budget with stable tolerances. Established scripts/bundle-budget-exceptions.json to formally catalog approved exceptions and ceilings for SDK-intensive tools (xdr-inspector, soroban-decoder, transaction-decoder, soroban-spec-viewer). Added the _route_initial_load baseline to bundle-baseline.json and documented the exception request process in docs/BUNDLE_BUDGET.md.
    • Why It Matters: Prevents shared-chunk bloat from degrading initial page loads across the application while providing contributors with a transparent, documented path for necessary SDK dependencies.
  4. Issue Utix: Implement signed administrative action approvals for high-impact changes #180: Signed Administrative Action Approvals for High-Impact Changes

    • Problem: Privileged administrative and ticketing mutations (event capacity overrides, cancellations, fraud locks, ticket burns, fee overrides) lacked cryptographic guardrails and could potentially be invoked without multi-maintainer approval or be subject to replay attacks.
    • Resolution & Flow: Extended HighImpactAction and exported ACTION_THRESHOLDS in core/auth/maintainer-approval.ts with multi-maintainer thresholds for ticketing operations. Implemented verifyProtectedActionApproval(request, manager, options) and executeProtectedAction(request, handler, manager, options) with $O(1)$ time/space complexity. The verification engine strictly enforces:
      • Actor authorization via Stellar Ed25519 public key format (StrKey.isValidEd25519PublicKey) and optional maintainer allowlists.
      • Signature threshold fulfillment before execution.
      • Lifetime expiration checks (isExpired).
      • Strict matching of requested action, target, and configuration parameters against the approved canonical intent hash (computeCanonicalIntentHash).
      • Atomic transition to executing and verification against previous execution receipts to guarantee fail-closed replay protection.
      • Generation of an immutable ApprovalReceipt sealed with a SHA-256 digest and recorded to core/audit/audit.ts.
    • Why It Matters: Enforces non-repudiable multi-maintainer cryptographic governance over high-risk protocol mutations, aligning with Stellar ecosystem security practices (SEP-10, SEP-53) with zero private keys stored or transmitted.

Changed

  • [UI] Add reduced-motion preference coverage #153: Reduced-Motion Preference Coverage
    • core/ui/accessibility.ts: Implemented prefersReducedMotion and useReducedMotion hook with SSR fallback and listener cleanup.
    • core/ui/index.ts: Exported accessibility utilities.
    • core/ui/Skeleton.tsx: Added motion-reduce:animate-none class and data-contract-state="loading".
    • core/ui/Button.tsx: Added motion-reduce:transition-none.
    • core/ui/StatusMessage.tsx: Added motion-reduce:transition-none motion-reduce:transform-none.
    • app/globals.css: Added global @media (prefers-reduced-motion: reduce) reset with instant scrolling.
    • docs/REDUCED_MOTION.md: Documented WCAG 2.1 AA defaults and component contracts.
    • core/ui/__tests__/reduced-motion.test.tsx: Added 9 regression tests for reduced-motion detection, dynamic changes, and component rendering.
  • [Testing] Add deterministic browser storage isolation #155: Deterministic Browser Storage Isolation
    • core/testing/render.tsx: Implemented createIsolatedStorage() with in-memory W3C Storage interface; wired isolated storage into renderFeature.
    • core/testing/index.ts: Exported createIsolatedStorage.
    • core/network/NetworkProvider.tsx: Injected optional storage?: Storage prop with fallback to localStorage, and exported resetNetworkStorageListeners().
    • vitest.config.ts: Added root "__tests__/**/*.test.{ts,tsx}" to test include paths.
    • __tests__/storage-isolation.test.tsx: Added 5 tests for order-dependent hazards, render isolation, explicit fixture sharing, and Storage API compliance.
  • [Performance] Establish feature initial-load performance budgets #159: Feature Initial-Load Performance Budgets
    • scripts/bundle-budget.mjs: Added analyzeRouteInitialLoad(), loadExceptions(), and stable tolerance margin checks; exported helpers for test runners.
    • bundle-baseline.json: Added numeric _route_initial_load baseline (180 KB).
    • scripts/bundle-budget-exceptions.json: Documented exception catalog for SDK-heavy tools (xdr-inspector, soroban-decoder, transaction-decoder, soroban-spec-viewer).
    • docs/BUNDLE_BUDGET.md: Documented the 220 KB initial load budget and exception request procedure.
    • __tests__/bundle-initial-load.test.ts: Added 7 tests covering initial load analysis, standard budgets, approved exceptions, and ceiling violations.
  • Utix: Implement signed administrative action approvals for high-impact changes #180: Signed Administrative Action Approvals for High-Impact Changes
    • core/auth/maintainer-approval.ts: Added ticketing and event operations (event_capacity_override, event_cancellation, fraud_lock_quarantine, batch_ticket_burn, organizer_fee_override); exported ACTION_THRESHOLDS; implemented verifyProtectedActionApproval() and executeProtectedAction() with Stellar Ed25519 validation and replay protection.
    • docs/MAINTAINER_APPROVAL_FLOW.md: Updated high-impact actions table and added Protected Action Verification API documentation.
    • core/auth/__tests__/signed-administrative-approvals.test.ts: Added 8 tests covering missing approval, pending threshold, expired approval, action/target/parameter mismatch, unauthorized actor, and replay blocking.

…ocol#159, and Parcel-Protocol#180 reduced motion, storage isolation, bundle budget, and administrative approvals
@drips-wave

drips-wave Bot commented Oct 19, 2026

Copy link
Copy Markdown

@peacebas 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

@BigDella
BigDella merged commit 27f1acf into Parcel-Protocol:main Oct 19, 2026
viktorlabs pushed a commit to viktorlabs/utix that referenced this pull request Oct 22, 2026
…ocol#159, and Parcel-Protocol#180 reduced motion, storage isolation, bundle budget, and administrative approvals (Parcel-Protocol#301)
Daniel08886 pushed a commit to Daniel08886/utix that referenced this pull request Oct 22, 2026
…ocol#159, and Parcel-Protocol#180 reduced motion, storage isolation, bundle budget, and administrative approvals (Parcel-Protocol#301)
Wiseman52 pushed a commit to Wiseman52/utix that referenced this pull request Oct 22, 2026
…ocol#159, and Parcel-Protocol#180 reduced motion, storage isolation, bundle budget, and administrative approvals (Parcel-Protocol#301)
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