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(loading): merge github fetch with the loading bar #6630

Merged
merged 21 commits into from
Nov 25, 2024
Merged

Conversation

liady
Copy link
Contributor

@liady liady commented Nov 11, 2024

This PR adds the loading stages to the loading bar screen and progress bar.

Stages for GH import:

  1. Loading Editor...
  2. Fetching
  3. Parsing files
  4. Fetching dependencies

Stages for project load (we reverse the order in our project load):

  1. Fetching dependencies
  2. Parsing files

If everything is validated correctly - it just shows the editor with the project ready to be worked on. If not - it shows an error modal (its UI was slightly changed in #6677 to better reflect errors).

It also adds support for Dark mode.

Note:

  • The new logic is almost entirely in editor/src/components/editor/loading-screen.tsx
  • There is a jump in the progress bar since these are actually two DOM elements, one that is rendered before the React is loaded and a React component that replaces it after the React code is loaded. This jump will be fixed in a subsequent PR.
  • Currently the progress bar is "static" (advances by time and not stages). This will be changed in (the same) subsequent PR.

Monosnap.screencast.2024-11-24.18-08-46.mp4

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 11, 2024

Try me

Copy link

relativeci bot commented Nov 11, 2024

#15275 Bundle Size — 58.12MiB (+0.01%).

098ccd0(current) vs d1d46c1 master#15274(baseline)

Warning

Bundle contains 70 duplicate packages – View duplicate packages

Bundle metrics  Change 3 changes Regression 1 regression
                 Current
#15275
     Baseline
#15274
Regression  Initial JS 41.09MiB(+0.02%) 41.09MiB
No change  Initial CSS 0B 0B
Change  Cache Invalidation 18.18% 0%
No change  Chunks 20 20
No change  Assets 22 22
Change  Modules 4174(+0.02%) 4173
No change  Duplicate Modules 213 213
No change  Duplicate Code 27.28% 27.28%
No change  Packages 477 477
No change  Duplicate Packages 70 70
Bundle size by type  Change 2 changes Regression 2 regressions
                 Current
#15275
     Baseline
#15274
Regression  JS 58.11MiB (+0.01%) 58.1MiB
Regression  HTML 8.73KiB (+18.14%) 7.39KiB

Bundle analysis reportBranch feat/loading-barProject dashboard


Generated by RelativeCIDocumentationReport issue

@liady liady mentioned this pull request Nov 24, 2024
2 tasks
@liady liady changed the title feat(loading): initially merge github loading with the loading bar feat(loading): merge github fetch with the loading bar Nov 24, 2024
@liady liady marked this pull request as ready for review November 24, 2024 15:31
liady added a commit that referenced this pull request Nov 25, 2024
This PR changes the UI of the import wizard to better reflect errors in
the header.
Note: this is a part of a larger change in the import flow (using the
loading screen - PR #6630), but was extracted to minimize PR size since
it can be reviewed independently. Please review only the wizard
appearance, the flow itself will be changed.

<video
src="https://github.com/user-attachments/assets/cee5fa7d-c161-47bb-a182-369f063fdf4a"></video>

**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
const themeStyle =
currentTheme === 'dark'
? `
.editor-loading-screen { background-color: ${colorTheme.bg6.value} }
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this mean we're relying on some defaults for light mode? This feels a little like we're kinda patching it rather than fixing it.

Copy link
Contributor Author

@liady liady Nov 25, 2024

Choose a reason for hiding this comment

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

in a sense this is "patching", since we want to match the CSS behavior in index.html where the dark mode "overrides" the light mode defaults (that also apply here).
I didn't want to change anything in case we have a light theme, so to not create a possible divergence in color from the light "default" that is defined in the base index.html css.

@liady liady merged commit 9e99bae into master Nov 25, 2024
16 checks passed
@liady liady deleted the feat/loading-bar branch November 25, 2024 15:12
liady added a commit that referenced this pull request Dec 13, 2024
This PR changes the UI of the import wizard to better reflect errors in
the header.
Note: this is a part of a larger change in the import flow (using the
loading screen - PR #6630), but was extracted to minimize PR size since
it can be reviewed independently. Please review only the wizard
appearance, the flow itself will be changed.

<video
src="https://github.com/user-attachments/assets/cee5fa7d-c161-47bb-a182-369f063fdf4a"></video>

**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
liady added a commit that referenced this pull request Dec 13, 2024
This PR adds the loading stages to the loading bar screen and progress
bar.

Stages for GH import:
1. Loading Editor...
2. Fetching <repo name>
3. Parsing files
4. Fetching dependencies

Stages for project load (we reverse the order in our project load):
1. Fetching dependencies
2. Parsing files

If everything is validated correctly - it just shows the editor with the
project ready to be worked on. If not - it shows an error modal (its UI
was slightly changed in #6677 to better reflect errors).

It also adds support for Dark mode.

**Note:**
- The new logic is almost entirely in
[editor/src/components/editor/loading-screen.tsx](https://github.com/concrete-utopia/utopia/pull/6630/files#diff-5aa4d7e811e0bfb07a60910e517fe3a01cd270c9b4fd05132e513d939d69f769)
- There is a jump in the progress bar since these are actually two DOM
elements, one that is rendered before the React is loaded and a React
component that replaces it after the React code is loaded. This jump
will be fixed in a subsequent PR.
- Currently the progress bar is "static" (advances by time and not
stages). This will be changed in (the same) subsequent PR.

<video
src="https://github.com/user-attachments/assets/a6d52f3d-b27b-4110-be1e-a7f213f563ab"></video>

**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