Skip to content

feat(vault): redesign artifact modal#1775

Open
kirugan wants to merge 3 commits into
mainfrom
kirugan/change-artifacts-popup
Open

feat(vault): redesign artifact modal#1775
kirugan wants to merge 3 commits into
mainfrom
kirugan/change-artifacts-popup

Conversation

@kirugan
Copy link
Copy Markdown
Contributor

@kirugan kirugan commented May 25, 2026

No description provided.

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 25, 2026

🔐 Commit Signature Verification

One or more commits failed verification

Commit Author Signature Key Type Key Check
5ae74c59714c Kirill sk-ssh-ed25519
50aed62c1a19 Kirill sk-ssh-ed25519
86018b30477d Kirill -

Summary

  • Commits verified: 3
  • Result: ❌ Failures detected (see table above)

Required key type: sk-ssh-ed25519 (FIDO2 hardware key)

Last verified: 2026-06-01 21:12 UTC

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 25, 2026

Greptile Summary

This PR redesigns the vault artifact download modal and adds progress-aware downloading. The main changes are:

  • New modal copy and downloaded/downloading states.
  • A redesigned recovery artifacts card with byte progress.
  • Artifact streaming with progress callbacks and a cancellation sentinel.
  • Pending-deposit activation handoff after artifacts are downloaded.

Confidence Score: 3/5

These issues should be fixed before merging.

  • Cancel can leave a large artifact request running after the modal closes.

  • The fallback body-buffering path cannot stop once it starts.

  • The re-auth retry path can update state after a cancelled or restarted download.

  • services/vault/src/services/artifacts/artifactDownloadService.ts

  • services/vault/src/hooks/deposit/useArtifactDownload.ts

Important Files Changed

Filename Overview
services/vault/src/services/artifacts/artifactDownloadService.ts Adds streaming progress and cancellation handling for artifact downloads, but cancellation is incomplete.
services/vault/src/hooks/deposit/useArtifactDownload.ts Extends download state with byte counters and retry progress, but the retry auth path can outlive cancellation.
services/vault/src/components/deposit/ArtifactDownloadModal/index.tsx Adds downloaded/downloading modal states and an optional activation handler.

Comments Outside Diff (1)

  1. services/vault/src/hooks/deposit/useArtifactDownload.ts, line 171-180 (link)

    P1 Reauth can outlive cancel

    The retry re-auth path awaits ensureAuthenticatedVpClient without the cancellation guards used by the initial priming path. If the user cancels while the wallet/auth step is pending, this stale async path can still resolve and continue, or later reject and write an error if another download has already reset cancelledRef.current to false. That can make a dismissed or restarted modal show state from the previous attempt.

Reviews (1): Last reviewed commit: "feat(vault): redesign artifact download ..." | Re-trigger Greptile

Comment thread services/vault/src/services/artifacts/artifactDownloadService.ts
Comment thread services/vault/src/services/artifacts/artifactDownloadService.ts
/>
<path
d="M56.25 7.5V26.25H75"
stroke="currentColor"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeremy-babylonlabs @jonybur please review this PR from the UI/UX side thanks

gbarkhatov
gbarkhatov previously approved these changes May 26, 2026
Copy link
Copy Markdown
Contributor

@gbarkhatov gbarkhatov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving — solid redesign. The streaming refactor with a real cancellation sentinel is clean, byte counters reset correctly across retries, and the onActivate handoff captures activityId before handleClose(). Verified the cancellation path (isCancelled poll + reader.cancel() + instanceof swallow), the cleared 120s RPC timeout means the streamed read isn't truncated, and continueButton removal is clean.

A few things to address before/after merge — left inline. One is a ZERO-DEAD-CODE blocker (orphaned copy keys); the rest are worth-addressing (progress overshoot when the byte label isn't clamped, peak memory on the ~1 GB path, missing tests for the new streaming/cancel behavior) plus minor nits.

Comment thread services/vault/src/copy.ts Outdated
variant="contained"
color="secondary"
className="h-10 flex-1"
onClick={onActivate ?? onComplete}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The label is hardcoded to "Activate Vault" for every call site, but only PendingDepositSection passes onActivate. CollateralSection (the re-download path for an already-active vault) falls back to onComplete = () => setArtifactParams(null), so the button promises activation but merely closes the modal. DepositSignContent falls back to continueAfterArtifactDownload, which is defensible. Consider deriving the label from whether onActivate is provided (or passing an explicit label), or confirm with design that "Activate Vault" is acceptable in the collateral context.

Comment thread services/vault/src/components/deposit/RecoveryArtifactsCard.tsx Outdated
Comment thread services/vault/src/components/deposit/RecoveryArtifactsCard.tsx Outdated
Comment thread services/vault/src/services/artifacts/artifactDownloadService.ts Outdated
Comment thread services/vault/src/hooks/deposit/useArtifactDownload.ts Outdated
jrwbabylonlab
jrwbabylonlab previously approved these changes May 26, 2026
@kirugan kirugan force-pushed the kirugan/change-artifacts-popup branch from b83529a to 50aed62 Compare June 1, 2026 20:51
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.

4 participants