-
Notifications
You must be signed in to change notification settings - Fork 72
LG-5446: CodeEditor QA Fixes #3261
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
Conversation
🦋 Changeset detectedLatest commit: abf02e4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Size Change: +1.79 kB (+0.11%) Total Size: 1.62 MB
ℹ️ View Unchanged
|
…o view after actions
…ent unstyled render
…r rendering control and optimize extension return with useMemo for performance
…hanced testing capabilities
…styles and package configuration
adamrasheed
left a comment
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.
Quite a chunky PR but I'll approve it this time
packages/code-editor/src/CodeEditor/hooks/extensions/useReadOnlyExtension.spec.ts
Outdated
Show resolved
Hide resolved
packages/code-editor/src/CodeEditor/hooks/extensions/useCodeFoldingExtension.tsx
Show resolved
Hide resolved
packages/code-editor/src/CodeEditor/hooks/extensions/useThemeExtension.ts
Outdated
Show resolved
Hide resolved
| <CodeEditor.Panel | ||
| title="Test Panel" | ||
| innerContent={ | ||
| <div data-testid={PANEL_TEST_ID}>Test Panel Content</div> |
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.
nit: don't we have test utils to get the panel?
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.
Good call, will update
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.
Fixed
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.
| * Since the editor is created in a separate effect without extensions, it is created before the extensions | ||
| * are applied. This prevents a blink of an unstyled editor. | ||
| */ | ||
| const rafId = requestAnimationFrame(() => { |
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.
Will the extensions always be rendered after the next frame?
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.
That's a good question. We have an extensionsInitialized prop that technically isn't set until after the extensions are dispatched, and this prevents showing the editor until true. My original thought was that this is all that would be needed, but it didn't work. So the theory at least is that there must be a small race condition and this prevents it. I'm not sure of a better way to handle it, but would be open to ideas.
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.
My original thought was that this is all that would be needed, but it didn't work.
So you were trying to set setExtensionsInitialized without requestAnimationFrame but that wasn't working?
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.
Correct, you still saw just a blink of non-styled content
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.
Using requestAnimationFrame doesn't seem reliable, but I also don't have a solution. Does the dispatch on the line above initialize the extensions? Could there be a case where the extensions don't initialize but it will still be set to true because of requestAnimationFrame?
|
Coverage after merging LG-5446/ce-qa into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||


✍️ Proposed changes
This PR fixes a number of bugs and missed features that were found in QA.
Bugs that were found in QA can be found in the CodeEditor QA Issue Log. This PR fixes the following:
Additional drive-by fixes:
CodeEditor.specby:CodeEditor.specfor core functionalityCodeEditor.ImperativeHandle.specfor testing the imperative handle functionalitySearchPanel.specfor testing search functionalitypreloadedModules. This makes the tests more straight forward to reason with since it removes any loading🎟️ Jira ticket: LG-5446
✅ Checklist
pnpm changesetand documented my changes🧪 How to test changes