-
Notifications
You must be signed in to change notification settings - Fork 3.4k
fix: Ensuring current browser is synchronized between app and launchpad #20830
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
|
Thanks for taking the time to open a PR!
|
| } | ||
| } | ||
| ` | ||
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 mutation is no longer used.
| <div | ||
| class="font-medium pt-2 text-indigo-600 text-18px leading-28px" | ||
| :class="{ 'text-jade-600': browser.isSelected, 'text-gray-500': browser.disabled || !browser.isVersionSupported }" | ||
| :class="{ 'text-jade-600': browser.id === selectedBrowserId, 'text-gray-500': browser.disabled || !browser.isVersionSupported }" |
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.
Updated this to ensure we're always reflecting the currentBrowser value in our selections.
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.
Could we not have used the checked slot prop? We've got so many conditionals in this template 😅
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.
Ah good call, that works great. I'll have to do some reading on how the slot props work.
| // NOTE: The currentBrowser is set to the first detected browser | ||
| // found during project initialization. It should always be defined. | ||
| return props.gql.currentBrowser?.id | ||
| }, |
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.
I don't think the defaulting value logic was ever executed outside of component tests, as we always default the currentBrowser to the first browser detected on the user's system, which would always at least include Electron. So I removed that bit.
I also updated the markup so that if we end up in a scenario where we don't have a currentBrowser, we do not show the action buttons and allow the user to open a browser when nothing is actually selected.
| name | ||
| displayName | ||
| path | ||
| version |
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.
I removed fields that weren't being used anymore
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
ZachJW34
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.
Awesome PR description, tested and it works great!
| <div | ||
| class="font-medium pt-2 text-indigo-600 text-18px leading-28px" | ||
| :class="{ 'text-jade-600': browser.isSelected, 'text-gray-500': browser.disabled || !browser.isVersionSupported }" | ||
| :class="{ 'text-jade-600': browser.id === selectedBrowserId, 'text-gray-500': browser.disabled || !browser.isVersionSupported }" |
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.
Could we not have used the checked slot prop? We've got so many conditionals in this template 😅
* 10.0-release: fix: add index.mjs to the published files of cli (#20884) refactor: lift indexHtmlFile up to component, add validation (#20870) fix: allow migration of pluginsFile using `env` properties (#20770) fix: viewport from CLI on CT (#20849) fix: git data source unit test failure (#20875) fix: Ensuring current browser is synchronized between app and launchpad (#20830) Fix missed await on merge conflict resolution test(unification): move record keys to contexts (#20860) test: move record keys to contexts (#20859) make alerts more responsive chore: Update Chrome (stable) to 100.0.4896.60 (#20841) Revise test. fix: cy.root respect timeout option. fix(deps): update dependency ansi-regex to v4.1.1 [security] (#20836) chore(deps): update dependency ansi-regex to 4.1.1 [security] (#20807) chore: Refactor cri-client to use async/await (#20825) remove automationId from runnerStore fix firefox automation and adress feedback feat: add automation warning/disconnected states in app
* 10.0-release: (92 commits) chore: remove dependency-tree dep (#20905) chore(launchpad): work on infra for scaffold tests (#20818) fix: build mjs in the cli (#20889) fix(unify): Cypress version link should point to Cypress doc's changelog (#20869) fix: windows build (#20854) fix: add index.mjs to the published files of cli (#20884) refactor: lift indexHtmlFile up to component, add validation (#20870) fix: allow migration of pluginsFile using `env` properties (#20770) fix: viewport from CLI on CT (#20849) Don't communicate if process isn't connected Remove config.get Update packages/data-context/src/data/ProjectLifecycleManager.ts fix: git data source unit test failure (#20875) add comment for autoBindDebug fix: Ensuring current browser is synchronized between app and launchpad (#20830) Fix missed await on merge conflict resolution test(unification): move record keys to contexts (#20860) test: move record keys to contexts (#20859) PR comments Fix tests that visit app without a configured testing type ...
When a new browser is selected from the app's top navigation, the current browser instance is destroyed and the new browser is opened. As part of this lifecycle, the currentBrowser field is updated, and the browserStatus field is changed ('closed' -> 'opening' -> 'open'), with each change being broadcast through the
browserStatusChangesubscription event.The launchpad remains open throughout this process and should be updated by its subscription to the 'browserStatusChange` event. However, because we are not using the currentBrowser field in the subscription definition, we are not getting notified that its value has changed and thus continue to show the previous browser as selected/open.
I updated the subscription to include the currentBrowser so that any changes to browserStatus will include any relevant corresponding changes to the currentBrowser. This ensures that the currentBrowser is always synchronized properly.
I also cleaned up a few things around this logic and updated tests where necessary.
User facing changelog
Additional details
How has the user experience changed?
browser_sync.mov
PR Tasks
cypress-documentation?type definitions?cypress.schema.json?