-
Notifications
You must be signed in to change notification settings - Fork 25
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
ref: Rework RepoBreadcrumbContext so it's available in new header #3004
ref: Rework RepoBreadcrumbContext so it's available in new header #3004
Conversation
</main> | ||
</NetworkErrorBoundary> | ||
</ErrorBoundary> | ||
<RepoBreadcrumbProvider> |
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.
We need access to the breadcrumb context inside of Header on line 82, so I've moved it up from RepoPage to here.
import { useCrumbs } from 'pages/RepoPage/context' | ||
import Breadcrumb from 'ui/Breadcrumb' | ||
|
||
function Navigator() { |
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 is still a work in progress. Can ignore
@@ -245,6 +246,27 @@ function RepoPage() { | |||
refetchOnWindowFocus: refetchEnabled, | |||
}, | |||
}) | |||
const { setBaseCrumbs } = useCrumbs() |
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.
We don't have the Repo until the RepoPage is visited, so we populate the repo in the context only once we get here with setBaseCrumbs
.
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've converted this to TS and reworked how the context is done. Same general idea as before, except we allow baseCrumbs to be set by the consumer as we don't yet have a repo when this context is loaded.
Bundle ReportChanges will decrease total bundle size by 1.05kB ⬇️
|
Bundle ReportChanges will decrease total bundle size by 1.05kB ⬇️
|
6fe2e83
to
eec9bf8
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #3004 +/- ##
=======================================
Coverage 98.33% 98.33%
=======================================
Files 906 907 +1
Lines 13426 13429 +3
Branches 3593 3522 -71
=======================================
+ Hits 13202 13205 +3
Misses 219 219
Partials 5 5
Continue to review full report in Codecov by Sentry.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #3004 +/- ##
=======================================
Coverage 98.33% 98.33%
=======================================
Files 906 907 +1
Lines 13426 13429 +3
Branches 3588 3594 +6
=======================================
+ Hits 13202 13205 +3
Misses 219 219
Partials 5 5
Continue to review full report in Codecov by Sentry.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #3004 +/- ##
=======================================
Coverage 98.33% 98.33%
=======================================
Files 906 907 +1
Lines 13426 13429 +3
Branches 3588 3522 -66
=======================================
+ Hits 13202 13205 +3
Misses 219 219
Partials 5 5
Continue to review full report in Codecov by Sentry.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #3004 +/- ##
===========================================
Coverage 98.33000 98.33000
===========================================
Files 906 907 +1
Lines 13426 13429 +3
Branches 3588 3589 +1
===========================================
+ Hits 13202 13205 +3
Misses 219 219
Partials 5 5
Continue to review full report in Codecov by Sentry.
|
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.
Two things too peak at, looks all good
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
Refactors RepoBreadcrumbContext such that it is initialized above the Header on BaseLayout. The reason for this is because we are now rendering the breadcrumb in the header, we need access to the breadcrumb context up in the header.