Skip to content

feat(ui): add animated loading state to data export button - #554

Merged
TheVicky1 merged 1 commit into
TheVicky1:mainfrom
Furox-Art:ui/data-export-loading-state
Oct 11, 2026
Merged

TheVicky1 merged 1 commit into
TheVicky1:mainfrom
Furox-Art:ui/data-export-loading-state

Conversation

@Furox-Art

Copy link
Copy Markdown
Contributor

Closes #500

What

DataExportButton now shows an animated loading state while the export archive is generated:

  • Spinner + progress bar: a Loader2 spinner and an indeterminate gold progress bar render while the request is in flight. The bar eases toward a 90% ceiling (nextExportProgress) and settles at 100% when the archive resolves — it never claims completion before the file exists.
  • Disabled during execution: the button is disabled for the whole request, and the handler early-returns if it is somehow re-entered, so duplicate exports are impossible.
  • Accessibility: the bar is a role="progressbar" with live aria-valuenow; stage changes are announced through a role="status" aria-live="polite" region. Success and failure each get an icon and a message, then the control returns to idle.

Acceptance criteria

  • Export trigger displays an animated loading indicator while processing
  • Button disabled during execution to prevent duplicate requests
  • npm test passes without errors

Structure

The pure helpers (nextExportProgress, clampExportProgress, resolveExportFilename, EXPORT_PROGRESS_CEILING) live in src/components/settings/data-export-helpers.ts rather than inside the .tsx — the repo's suite runner parses plain .ts but not JSX, and keeping the math pure makes it directly testable. tests/data-export-button.test.ts covers the ticker (advance, ceiling, monotonicity), clamping, and Content-Disposition parsing (quoted, unquoted, absent, malformed).

Verification

$ node scratch/run-tests.mjs data-export-button
✔ data-export-button.test.ts PASSED (453ms)
Total Suites: 1 | Passed: 1 | Failed: 0

npx tsc --noEmit is clean.

@Furox-Art
Furox-Art requested a review from TheVicky1 as a code owner October 11, 2026 13:37
@vercel

vercel Bot commented Oct 11, 2026

Copy link
Copy Markdown

@Furox-Art is attempting to deploy a commit to the Vicky's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown

👋 Welcome to PACT OS, @Furox-Art! 🚀

Thank you for taking the time to open your first pull request on PACT! We are thrilled to have you here in our open-source community.


🔍 What Happens Next?

  1. Automated Verification: Our Continuous Integration (CI) workflow is currently verifying:
    • 🔒 Zero-Secret Security Scan
    • 🔗 Markdown Link Integrity
    • 🧹 ESLint Code Quality
    • 🏷️ TypeScript Strict Typecheck
    • 🧪 56-Suite Automated Domain & Security Test Matrix
    • 🏗️ Next.js Production Build
  2. Maintainer Review: A maintainer (@TheVicky1) will review your pull request shortly.
  3. Friendly Iteration: If any adjustments or feedback are needed, we will provide clear, actionable suggestions to help get your PR merged smoothly.

📚 Helpful Quick Links

Thank you for helping make PACT better! Plan. Track. Improve. Repeat. 🏛️✨

Closes #500

Generating a workspace data export fans out across every user-owned
domain and can take several seconds, so DataExportButton now reports
progress while the request is in flight:

- animated spinner (Loader2) plus an indeterminate gold progress bar
  that eases toward a 90% ceiling and settles at 100% on completion,
  never claiming done before the archive exists
- the button stays disabled for the whole request, blocking duplicate
  exports; an early return in the handler guards re-entry too
- role=progressbar with aria-valuenow, role=status aria-live for stage
  changes, and a success/error state with an icon and message

Pure helpers (progress math, filename resolution) live in
data-export-helpers.ts so the suite runner can exercise them without
JSX; tests/data-export-button.test.ts covers the ticker, clamping and
Content-Disposition parsing.
@Furox-Art
Furox-Art force-pushed the ui/data-export-loading-state branch from 58b9b60 to 0cfd2bb Compare October 11, 2026 13:46
@TheVicky1
TheVicky1 merged commit bb41120 into TheVicky1:main Oct 11, 2026
2 of 3 checks passed
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.

[UI] Add Animated Progress Bar Loading State to Data Portability Export Trigger

2 participants