feat: Add recently visited repo at top of list#3734
Conversation
Bundle ReportChanges will increase total bundle size by 2.64kB (0.02%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: gazebo-staging-esmAssets Changed:
Files in
Files in
view changes for bundle: gazebo-staging-systemAssets Changed:
Files in
Files in
|
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## main #3734 +/- ##
==========================================
- Coverage 98.70% 98.67% -0.03%
==========================================
Files 823 825 +2
Lines 14801 14841 +40
Branches 4220 4241 +21
==========================================
+ Hits 14609 14645 +36
- Misses 186 189 +3
- Partials 6 7 +1
Continue to review full report in Codecov by Sentry.
|
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
@@ Coverage Diff @@
## main #3734 +/- ##
==========================================
- Coverage 98.70% 98.67% -0.03%
==========================================
Files 823 825 +2
Lines 14770 14810 +40
Branches 4206 4227 +21
==========================================
+ Hits 14578 14614 +36
- Misses 186 189 +3
- Partials 6 7 +1
Continue to review full report in Codecov by Sentry.
|
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
@@ Coverage Diff @@
## main #3734 +/- ##
==========================================
- Coverage 98.70% 98.67% -0.03%
==========================================
Files 823 825 +2
Lines 14801 14841 +40
Branches 4228 4241 +13
==========================================
+ Hits 14609 14645 +36
- Misses 186 189 +3
- Partials 6 7 +1
Continue to review full report in Codecov by Sentry.
|
Bundle ReportChanges will increase total bundle size by 2.64kB (0.02%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: gazebo-production-esmAssets Changed:
Files in
Files in
view changes for bundle: gazebo-production-systemAssets Changed:
Files in
Files in
|
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
@@ Coverage Diff @@
## main #3734 +/- ##
==========================================
- Coverage 98.70% 98.67% -0.03%
==========================================
Files 823 825 +2
Lines 14801 14841 +40
Branches 4220 4249 +29
==========================================
+ Hits 14609 14645 +36
- Misses 186 189 +3
- Partials 6 7 +1
Continue to review full report in Codecov by Sentry.
|
✅ Deploy preview for gazebo ready!Previews expire after 1 month automatically.
|
07af2b8 to
163c15d
Compare
| import PropTypes from 'prop-types' | ||
|
|
||
| import AppLink from 'shared/AppLink' | ||
| import { transformStringToLocalStorageKey } from 'shared/utils/transformStringToLocalStorageKey' |
There was a problem hiding this comment.
any taste for converting this file to TS? Hopefully not too bad since its only 100 lines (famous last words)
There was a problem hiding this comment.
I actually started the conversion. All of the repo fields started complaining so I tabled it for now haha
There was a problem hiding this comment.
lol fair enough, some of those can be pretty annoying
| import { ExtractInfiniteQueryDataType } from './queries' | ||
| import { transformStringToLocalStorageKey } from './transformStringToLocalStorageKey' | ||
|
|
||
| export const DEMO_REPO = { |
There was a problem hiding this comment.
is this meant to be here? And removed from
gazebo/src/shared/utils/demo.ts
Lines 6 to 10 in 82938e3
There was a problem hiding this comment.
hmm... it is not. I don't know how this got here, good catch
| return null | ||
| } | ||
|
|
||
| const repos = (recentlyVisitedReposData?.pages[0]?.repos ?? []) |
There was a problem hiding this comment.
rather than passing in the full Data object, can we get away with just passing the repos? Might help clean up the TS error as well in ReposTable
| pageName={pageName} | ||
| disabledLink={!isCurrentUserPartOfOrg && !repo?.active} | ||
| isRecentlyVisited={ | ||
| !!recentlyVisitedRepoName && recentlyVisitedRepoName === repo?.name |
There was a problem hiding this comment.
do we need the !!recentlyVisitedRepoName check here?
There was a problem hiding this comment.
We do I believe. recentlyVisitedRepoName is very possible to be undefined since it is from localStorage getItem and repo's name could also be undefined
There was a problem hiding this comment.
gotcha yeah, I see what you mean
| pageName={pageName} | ||
| disabledLink={!isCurrentUserPartOfOrg && !repo?.active} | ||
| isRecentlyVisited={ | ||
| !!recentlyVisitedRepoName && recentlyVisitedRepoName === repo?.name |
There was a problem hiding this comment.
similar question here with !!recentlyVisitedRepoName
| owner, | ||
| }), | ||
| getCoreRowModel: getCoreRowModel(), | ||
| // @ts-expect-error taking in both ReposQueryData and ReposTeamQueryData |
There was a problem hiding this comment.
we still need this even with the pick stuff above? Lowkey idk how I feel about that either 😂
ajay-sentry
left a comment
There was a problem hiding this comment.
lgtm, might be worth playing around cleaning up those types but I wouldn't spend too long on that
4f1164a to
13d275c
Compare
Description
Address bullet 3 of codecov/engineering-team#2263
"Recently Visited auto-pin concept
This support iteration V0 of the previously discussed pinning concept AND is a familiar pattern (think: google docs etc where the most recently visited docs are surfaced atop) – concept works like our default org selector where the user last visited by users is the default repo"
Screenshots
Link to Sample Entry
Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.