Why request access to private repos?
I'm concerned about requesting access to private repos. They are set as private for a reason. Mind explaining why that choice?
makes sense. can the repo scope be requested for specific repos?
let's improve this. let's actually only ask for the additional scope only if the user wants to enter "build" mode. something like show an alert icon next to "build" and a tooltip showing "additonal scope needed" or something like that.
but first we need to figure out if it's possible to be dynamic as to the scopes we ask each user?
brilliant. that would be awesome
some notes:
- seeing the warning even in "ask" mode
- should use our Tooltip component, not HTML's "title"
- got some feedback from vercel review:
vercel bot reviewed 1 hour ago
apps/web/app/[owner]/[repo]/[postNumber]/post-composer.tsx
([moderateResult, scopeResult]) => {
setCanModerate(moderateResult)
setHasRepoScope(scopeResult)
}
Contributor
@vercel
vercel bot
1 hour ago
After OAuth scope request redirects back, hasRepoScope state doesn't refresh because useEffect dependency array doesn't include session data
Fix on Vercel
@julianbenegas Reply...
apps/web/app/[owner]/[repo]/repo-content.tsx
([moderateResult, scopeResult]) => {
setCanModerate(moderateResult)
setHasRepoScope(scopeResult)
}
Contributor
@vercel
vercel bot
1 hour ago
After OAuth scope request redirects back, the hasRepoScope state doesn't refresh because the useEffect dependencies haven't changed after session update
Fix on Vercel
@julianbenegas Reply...
apps/web/components/composer.tsx
? "Ask mode (Shift+Tab to switch)"
? hasRepoScope
? "Ask mode (Shift+Tab to switch)"
: "Build mode requires additional GitHub permissions"
Contributor
@vercel
vercel bot
1 hour ago
Warning icon for missing repo scope only shows when mode is "ask", not when mode is "build" with revoked scope
Fix on Vercel
@julianbenegas Reply...
apps/web/app/[owner]/[repo]/repo-permissions-context.tsx
setCanModerate(result)
Promise.all([checkCanModerate(owner, repo), checkHasRepoScope()])
.then(([moderateResult, scopeResult]) => {
setCanModerate(moderateResult)
Contributor
@vercel
vercel bot
1 hour ago
Unstable object reference in useEffect dependency array causes unnecessary re-renders after OAuth redirect instead of tracking actual user identity changes
Fix on Vercel
woah, you created the PR earlier. so weird... can u try again? maybe it was due to me testing the new thing and overriding the scopes? i've signed out and in again. try it now please
i still see the warning icon in "ask" mode. pls fix. also merge with main cause i pushed some changes there. also make the mode be stored in sessionStorage instead of localStorage. so it gets stale. the mode should stick the my prev comment if inside a post, though.
nice! but i don't dig the fact that it takes me straight to the github screen when clicking on "ask". imagine i don't know that there's a build mode and i'm suddently going there? maybe let the user go to build mode, show a warning in build mode that can be clicked (which doesn't interfere with the mode; anotehr button!), and disable the button
END OF POST