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

fix: various Nav Bar fixes #19283

Merged
merged 21 commits into from Dec 8, 2021
Merged

fix: various Nav Bar fixes #19283

merged 21 commits into from Dec 8, 2021

Conversation

elevatebart
Copy link
Contributor

@elevatebart elevatebart commented Dec 6, 2021

What has changed

Coco.mov

User facing changelog

  • Nav Bar is now collapsible on runs
  • Nav Bar now has the height of the screen
  • In the layout Main automatically scrolls when needed
  • Navigation only uses the name of the page component file
  • Runner is now a sub-route of specs
  • When opening the specs page navigation is collapsed and the button to uncollapse it is hidden
  • When leaving specs, everything comes back to normal

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Dec 6, 2021

Thanks for taking the time to open a PR!

@elevatebart elevatebart marked this pull request as ready for review December 6, 2021 21:30
@cypress
Copy link

cypress bot commented Dec 6, 2021



Test summary

18147 0 202 0Flakiness 0


Run details

Project cypress
Status Passed
Commit b7931d2
Started Dec 8, 2021 5:05 PM
Ended Dec 8, 2021 5:17 PM
Duration 11:50 💡
OS Linux Debian - 10.10
Browser Multiple

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

Copy link
Contributor

@lmiller1990 lmiller1990 left a comment

Choose a reason for hiding this comment

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

Seems fine, two comments, I don't see specific reason to use _ for Pinia state. Also check-ts is busted.

>
<router-link
class="outline-none"
:to="{ path: 'runner', query: { file: result.spec.relative } }
:to="{ path: 'specs/runner', query: { file: result.spec.relative } }
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be absolute like the rest?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agreed

Suggested change
:to="{ path: 'specs/runner', query: { file: result.spec.relative } }
:to="{ path: '/specs/runner', query: { file: result.spec.relative } }

@@ -13,12 +14,19 @@ export const useMainStore = defineStore({
id: 'main',
state: (): MainStoreState => {
return {
navBarExpanded: true,
_navBarExpanded: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this prefixed with _? Seems to serve no purpose, it's not really a private variable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It has to have a different name than the exposed variable and should never be updated on it's own.
How else can I achieve this private state member in pinia?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I renamed it so that the flag can be set in tests.

@ZachJW34 ZachJW34 self-requested a review December 7, 2021 15:25
Copy link
Contributor

@ZachJW34 ZachJW34 left a comment

Choose a reason for hiding this comment

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

There is an issue when changing browsers and preserving the runnable spec. You can test that it is broken by selecting a spec and then switching to another browser. The backend redirects the frontend incorrectly with this change.

I made a PR to fix this here: #19290

@elevatebart
Copy link
Contributor Author

@ZachJW34 Thank you, I merged your fix.
I am not super sure I like the original architecture.

@ZachJW34
Copy link
Contributor

ZachJW34 commented Dec 7, 2021

@elevatebart Me neither, I don't think the backend should know/care about the frontend routing. Maybe a redirect on the frontend when matching a certain pattern could help out a bit. I'll take note of it.

@ZachJW34 ZachJW34 self-requested a review December 7, 2021 17:35
Copy link
Contributor

@ZachJW34 ZachJW34 left a comment

Choose a reason for hiding this comment

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

Can we remove setNavBarExpandedByUser? It's only being used in a spec.

Also, I think this state should be removed since it makes me think that the nav-bar can be expanded when the runner is open, but clicking it does nothing

Screen Shot 2021-12-07 at 3 22 19 PM

lmiller1990
lmiller1990 previously approved these changes Dec 7, 2021
@ZachJW34 ZachJW34 dismissed their stale review December 7, 2021 22:29

changes made

@marktnoonan
Copy link
Contributor

My only comment on the nav is the same as @ZachJW34, to not have the "expand" control appear on hover if the route does not allow the navigation to be expanded.

I think there is a slight miscommunication between @lmiller1990 and Zach - Zach’s talking about the setter for navBarExpandedByUser and I think Lachlan you’re talking about navBarExpandedByUser itself.

Copy link
Contributor

@ZachJW34 ZachJW34 left a comment

Choose a reason for hiding this comment

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

Tested, works great. LGTM!

@elevatebart elevatebart merged commit 33233e9 into 10.0-release Dec 8, 2021
@elevatebart elevatebart deleted the elevatebart/fix/nav-bar branch December 8, 2021 17:17
tgriesser added a commit that referenced this pull request Dec 8, 2021
…text

* 10.0-release: (45 commits)
  fix: various Nav Bar fixes (#19283)
  build: add patch package as a dev dependency for fe-shared
  chore: hoist is - fun with cached dependencies
  build: hoist is hard
  build: better hoisting strategy
  fix: remove windows and mac workflow from branch
  revert: remove change about node version 17
  build: remove testing of desktop-gui assets
  build: run window & mac CI in this branch
  build: more fixes
  build: remove toycode mdi from launchpad
  rename patch because of dev dep
  build: fix  merge issue in packages generation
  chore: update sass for windows compatibility
  fix: Do not crash when a ill formed URL request is proxied (#19274)
  fix: remove desktop-gui from circle.yml
  change whitepace in patch
  fix: adding timeout option to writeFile command (#19015)
  release 9.1.1
  fix: patch-package is not applied in dist'ed build (#19239)
  ...
tgriesser added a commit that referenced this pull request Dec 9, 2021
* 10.0-release: (53 commits)
  refactor: makeLegacyContext -> getCtx (#19308)
  fix: various Nav Bar fixes (#19283)
  build: add patch package as a dev dependency for fe-shared
  chore: hoist is - fun with cached dependencies
  build: hoist is hard
  build: better hoisting strategy
  chore: remove unused testing preferences (#19301)
  fix: remove windows and mac workflow from branch
  fix: show script errors when spec file fails to process (#19298)
  revert: remove change about node version 17
  feat: open config file in user's editor (#19276)
  feat(unify): scale the AUT (#19297)
  build: remove testing of desktop-gui assets
  build: run window & mac CI in this branch
  build: more fixes
  build: remove toycode mdi from launchpad
  rename patch because of dev dep
  build: fix  merge issue in packages generation
  chore: update sass for windows compatibility
  fix: Do not crash when a ill formed URL request is proxied (#19274)
  ...
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.

None yet

4 participants