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

Dynamo new homepage implementation #14879

Merged
merged 33 commits into from
Feb 28, 2024

Conversation

dnenov
Copy link
Collaborator

@dnenov dnenov commented Jan 23, 2024

Purpose

This PR contains the rework of the Dynamo Home Page. The design has been updated in various ways and most importantly, the front-end now utilizes JavaScript/React rather than WPF.

The react DynamoHomePage webapp can be found here (to be replaced when the resource is moved over to Autodesk repository).

Installation

Builds from the latest npm package when Dynamo is built.

Currently, the frontend webapp is contained and deployed with the following 2 files:
- bundle.js
- index.html
The compiled code inside bundle.js is injected during runtime replacing the mainJs script in index.html.

TODO: The [project]((https://github.com/dnenov/DynamoHomePage/) should eventually be moved and served as an npm packge during Dynamo build.

Note

There is a 2Mb limitation to the amount of data that can be sent in one go through webView2. The compiled bundle.js should not exceed this limit! (currently it is around 500Kb).

Update

  1. Build the react frontend project npm run build ((https://github.com/dnenov/DynamoHomePage/)
  2. Replace the bundle.js file in \Packages\HomePage\build folder inside DynamoCoreWPF.
  3. Make sure the UseNewDynamoHomePage flag located inside the DynamoView.xaml.cs is turned to 'true'.
  4. (Re)build Dynamo.

UI Updates

Recent module

image

Samples module

image

Learning module

image

Existing UI (for comparison and reference)

image

Declarations

Check these if you believe they are true

  • The codebase is in a better state after this PR
  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • All tests pass using the self-service CI.
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning and are documented in the API Changes document.
  • This PR modifies some build requirements and the readme is updated
  • This PR contains no files larger than 50 MB

Release Notes

This is the initial full release of the new Dynamo Home Page. It contains all required information to build the new version of the landing page. It adds a new Test class where all user interactions are tested starting from front to back end.

Reviewers

@Amoursol
@QilongTang

FYIs

@reddyashish

- initial structure to create a homePage user control replacing the current home page
- currently loads graphs to the web app ui
- incorporated the new home page web app
- now the front end will prompt the loading moment using useEffects rather than relying on the component being loaded after the webView2 was done loading
- implemented guided tours to the landing page
- implemented samples backend implementation
- reuses existing viewmodel logic
- added ShowSampleFilesInFolder existing in the current Home Page experience
- added bundle.js and index.html to source control for testing purposes and while implementation takes place
@dnenov dnenov changed the title Homepage implementation Dynamo new homepage implementation Jan 23, 2024
@pinzart90
Copy link
Contributor

@dnenov FYI I intend to introduce o new wrapper class over webview2 which should make it safer to use (#14789). There will be some changes needed in this PR
Also we might restrict the usage of “async void” methods, since they complicate exception handling. We can discuss about this later on

Copy link

github-actions bot commented Jan 24, 2024

UI Smoke Tests

Test: success. 2 passed, 0 failed.
TestComplete Test Result
Workflow Run: UI Smoke Tests
Check: UI Smoke Tests - net8.0

- net6 build error fix
@dnenov
Copy link
Collaborator Author

dnenov commented Jan 24, 2024

@dnenov FYI I intend to introduce o new wrapper class over webview2 which should make it safer to use (#14789). There will be some changes needed in this PR Also we might restrict the usage of “async void” methods, since they complicate exception handling. We can discuss about this later on

Yes, absolutely! I am happy to rework the code as needed to make use of the wrapper you are working on. As for the async methods, I was following the existing code base we have, I thought it's a requirement. Let's have a chat and go over what needs to be improved!

dnenov added 12 commits January 26, 2024 18:40
- added localization description to user guides
- trimming the '_' from the start of the guides names (happens on the back end)
- internal mock-up on testing graph image data
- the sidebar in Dynamo is resizable, so there is no 'default' value
- we are setting the initial width based on the current value
- will not update live, but will update on the next run (when initializing the StartPage from DynamoView)
- added Template call
- removed sidebar width sync between backend and front end
- added the ability to grip-resize sidebar in frontend NOT PERSISTED
- publish for review
- added test coverage on all interaction logic between the back and the front end
@dnenov dnenov marked this pull request as ready for review February 12, 2024 17:25
@QilongTang QilongTang added this to the 3.1 milestone Feb 16, 2024
- now builds from the latest npm package
- webView2 swapped to DynamoWebView2 class
- the new build was interfering with SplashScreen build
Copy link
Contributor

@QilongTang QilongTang left a comment

Choose a reason for hiding this comment

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

LGTM with comments

- dynamically adding locale to front end
- extracted repeated webView2 to DynamoUtilities helper methods (inside the PathHelper)
- fixed dynamically loading of the Artifakt font resource
- added new public functions to the respective API text files
- removed unneeded stopwatch in StartPage.xaml.cs
- added tests for the new public helper methods
- added null checks handling
- now correctly checks if the recent file is of valid json input
- it assumes that any other format but json is an old dynamo 1.0 format (not checking if xml or anything else)
- swap dynamo 1.0 message in favor of 1.x
try
{
var jsonString = File.ReadAllText(filePath);
return JsonConvert.DeserializeObject<Dictionary<string, object>>(jsonString);
Copy link
Contributor

Choose a reason for hiding this comment

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

You can use DynamoUtilities.PathHelper.isValidJson(filePath, out fileContents, out ex)

@QilongTang QilongTang merged commit dad37a6 into DynamoDS:master Feb 28, 2024
20 of 22 checks passed
{
File.Delete(fontFilePath);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

this does not look like a full implementation of the Dispose pattern. We're not suppressing the finalizer and we're not cleaning up the webview2 control.
Any reason for it ?

Copy link
Contributor

Choose a reason for hiding this comment

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

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