fix: Determine global mode based on whether there is a current project#22838
fix: Determine global mode based on whether there is a current project#22838chrisbreiding merged 6 commits intodevelopfrom
Conversation
|
Thanks for taking the time to open a PR!
|
Test summaryRun details
View run in Cypress Dashboard ➡️ Flakiness
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 |
||||||||||||||||||||||||||||||||||||||||||||||||||
marktnoonan
left a comment
There was a problem hiding this comment.
Testing the binary from this, this doesn't seem to get there.
cypress open-> thinks current directory is a project always?- downloading zip -> works great
- opening with --global flag -> fine too
| @@ -79,7 +79,7 @@ export const Query = objectType({ | |||
|
|
|||
| t.nonNull.boolean('isGlobalMode', { | |||
| description: 'Whether the app is in global mode or not', | |||
There was a problem hiding this comment.
Global mode should be determined by whether a project is specified or not. The --global flag can be used to force global mode, but if there is not a project, we can assume the Launchpad is being run in global mode.
@chrisbreiding Gah I was missing this context for global mode when I did #22073. Would you mind adding your explanation to the description here so it doesn't get lost in the future? 🙏
There was a problem hiding this comment.
No worries. It's not well-documented, so adding a better description is a good idea. I split it up between here and where the logic is in the CLI, so it's less likely to end up out-of-date if the implementation changes.
@marktnoonan That's odd. After installing the pre-release binary from this PR, |
|
@chrisbreiding it wasn't cache but it turns out I had a wrong assumption about how this was expected to work - the new comments are helpful and after retesting, yeah this is the correct behavior now and doesn't enter the in-between state that develop opens to. |
|
Hmm, the problem this work was intended to deal with seems to have resurfaced: the "Projects" link should still be in the top left here, since we did open in global mode and users can go back there. So "global mode", as far as the UI is concerned, can't only be determined by whether there is a project at the moment - that just tells the launchpad to be on the global page and as soon as a project is selected, we forget that we are running in global mode, which has effects that last longer. I suspect this is why that |
otherwise, it changes to false once a project is selected because then ctx.currentProject is set
|
I've fixed that issue in |
| cy.get('h1').should('contain', defaultMessages.globalPage.empty.title) | ||
| }) | ||
|
|
||
| it('shows global page when opened by global install', () => { |
|
Changes look good. Waiting for the last binary build to confirm you can get back to the project list once clicking a project in global mode. |

User facing changelog
N/A - fixing an issue pre-release
Additional details
#22073 changes the logic for determining if the Launchpad is running in global mode, making it solely based on whether the
--globalflag is passed via the command line. In production, runningcypress openresults in a falsey value for the--globalflag and so the Launchpad displays the welcome page instead of the global mode projects list.Global mode should be determined by whether a project is specified or not. The
--globalflag can be used to force global mode, but if there is not a project, we can assume the Launchpad is being run in global mode.Steps to test
cypress cache clearnpm install -g https://cdn.cypress.io/.../cypress.tgz)cypress cache clear && cypress installto ensure the latest binary from this PR is installed.cypress openHow has the user experience changed?
PR Tasks
cypress-documentation?type definitions?