-
Notifications
You must be signed in to change notification settings - Fork 3
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: editor DiffView now recognizes LaunchPad generated code and other cases #999
Merged
Kevin101Zhang
merged 5 commits into
main
from
998-diff-view-should-display-wizard-generated-code-as-a-default
Aug 12, 2024
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious. Would it be easier instead, to have a state variable for original code? And we just set it whenever we transition to the Editor page? I feel that would make this workflow friendly to ANY scenario where we change to the Editor component. Or making it a prop that must be passed in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, we don't default to anything or have a chain of things to try. We instead expect the application to correctly populate it according to its situation before going into Editor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This component needs some refactoring for sure when I get the chance. It hasnt been touched at all. As you can see its still a jsx page. It currently houses 2 actual components that make sense together but id prefer we separate them into different files. ResizableEditor and
ResizableLayoutEditor are the two components it currently houses. Ideally after I refactor them in a separate PR, there would be a transition to TS, and we can figure out a component that follows a view/viewmodal controllor type design pattern. Frankly the simplest way to change it would be to have the current ResizableLayoutEditor be a view that just focuses on render and the other component be a Container that houses the logic.
But in reality there should be a large refactor if I wasnt heavily focused on features.
The Editor page is currently handling too many cases. My last effort was focused on transitioning the entirety of the file to TS and abtracting smaller components such as publish modals, local storage class, the developer menu, and etc.
But currently some useEffects only apply to a case where they are on a published indexer and others revolve around a state when they are unpublished. A lot of logic such as storage and etc are only applicable with the published indexer state. With the introduction of the Launchpad this further complicated the Editor page as now we have more than just defaultCode/default Schema so some functionality was added. There are plenty of oddities such as local storage has no reason to even run on a forked/launchpad/newIndexer and adding functionality like that not would only complicate the page even further. In essence the page itself needs more refactoring.
Ideally, My intial throught was to breakdown the Editor into 2 specific states therefore simplifying the use/unuse of logic we have in the Editor page current.
Editor Page when forked/launchpad/createnewIndexer (Trial state).
Editor Page when on published indexer (Published State).
This way we are on the Editor page with what we need and we dont actually need to fetch for anything until the user makes an edit. When they Publish they will only have their an actual indexerName therefore a route is created. so we can redirect them.
Its something I can focus on during/after our transition post BOS.