Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(import): allow continuing the import after an error #6614

Merged
merged 9 commits into from
Nov 5, 2024

Conversation

liady
Copy link
Contributor

@liady liady commented Nov 3, 2024

This PR adds the ability to control the import process after an error:

  1. Import a different project
  2. Decide to continue anyway (for example to correct it using our editor).
    This PR distinguishes between an Error (that can be continued) and a Critical Error (for example a non-existent repo) - that we cannot recover from.

PR details:

  1. In editor/src/core/shared/github/operations/load-branch.ts this PR adds the ability to stop before dependencies fetching and resume afterwards
  2. In editor/src/components/editor/import-wizard/import-wizard.tsx this PR adds the UI for displaying the correct status/buttons according to the current import state.
  3. The rest of the changes are mostly actions/state changes.

For example this flow:

  1. Importing a non-existing repo (critical error)
  2. Then importing a project with errors (TS/server packages, etc), choosing to continue importing
  3. Deciding to import a different project - which is a success

Monosnap.screencast.2024-11-04.19-04-09.mp4

Current design:
image

Manual Tests:
I hereby swear that:

  • I opened a hydrogen project and it loaded
  • I could navigate to various routes in Play mode

Copy link
Contributor

github-actions bot commented Nov 3, 2024

Try me

Copy link

relativeci bot commented Nov 3, 2024

#15023 Bundle Size — 58.04MiB (~+0.01%).

474a2b1(current) vs d1d46c1 master#15007(baseline)

Warning

Bundle contains 70 duplicate packages – View duplicate packages

Bundle metrics  Change 2 changes Regression 1 regression
                 Current
#15023
     Baseline
#15007
Regression  Initial JS 41.02MiB(+0.01%) 41.02MiB
No change  Initial CSS 0B 0B
Change  Cache Invalidation 18.36% 0%
No change  Chunks 20 20
No change  Assets 22 22
No change  Modules 4165 4165
No change  Duplicate Modules 213 213
No change  Duplicate Code 27.31% 27.31%
No change  Packages 477 477
No change  Duplicate Packages 70 70
Bundle size by type  Change 2 changes Regression 1 regression Improvement 1 improvement
                 Current
#15023
     Baseline
#15007
Regression  JS 58.04MiB (~+0.01%) 58.03MiB
Improvement  HTML 7.37KiB (-0.25%) 7.39KiB

Bundle analysis reportBranch feat/continue-importProject dashboard


Generated by RelativeCIDocumentationReport issue

@@ -38,25 +51,10 @@ export const ImportWizard = React.memo(() => {
e.stopPropagation()
}, [])

const totalImportResult: ImportOperationResult | null = React.useMemo(() => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved to a different file

return (
<React.Fragment>
<div style={textStyle}>Error Importing Project</div>
<Button style={buttonStyle}>Import A Different Project</Button>
<div style={textStyle}>
Copy link
Contributor Author

@liady liady Nov 4, 2024

Choose a reason for hiding this comment

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

if we're in an error mode (but not a critical error), show a button for Continue Anyway

@liady liady marked this pull request as ready for review November 4, 2024 14:16
dispatch([updateImportStatus(importStatus)])
}

export function getTotalImportStatusAndResult(importState: ImportState): TotalImportResult {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this logic was moved here from import-wizard.tsx

@liady liady merged commit 03865fc into master Nov 5, 2024
15 checks passed
@liady liady deleted the feat/continue-import branch November 5, 2024 15:52
liady added a commit that referenced this pull request Dec 13, 2024
This PR adds the ability to control the import process after an error:
1. Import a different project
2. Decide to continue anyway (for example to correct it using our
editor).
This PR distinguishes between an `Error` (that can be continued) and a
`Critical Error` (for example a non-existent repo) - that we cannot
recover from.

**PR details:**
1. In
[editor/src/core/shared/github/operations/load-branch.ts](https://github.com/concrete-utopia/utopia/pull/6614/files#diff-3c1474cac72b0e757d951539630bd72175135c05eddbff91d9f10639d2796440)
this PR adds the ability to stop before dependencies fetching and resume
afterwards
2. In
[editor/src/components/editor/import-wizard/import-wizard.tsx](https://github.com/concrete-utopia/utopia/pull/6614/files#diff-a1ec93eec4b0720f01ff6ec77bb4efb6cc3ac0ba4297d3fe7bb77049c601ca94)
this PR adds the UI for displaying the correct status/buttons according
to the current import state.
3. The rest of the changes are mostly actions/state changes.


For example this flow:
1. Importing a non-existing repo (critical error)
2. Then importing a project with errors (TS/server packages, etc),
choosing to continue importing
3. Deciding to import a different project - which is a success

<video
src="https://github.com/user-attachments/assets/39eaeedd-14fd-4819-b590-39a92629ad8e"></video>

Current design:
<img width="693" alt="image"
src="https://github.com/user-attachments/assets/a609068f-dece-4448-a31d-c266969a6341">

**Manual Tests:**
I hereby swear that:

- [x] I opened a hydrogen project and it loaded
- [x] I could navigate to various routes in Play mode
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.

3 participants