π fix: add the user github oauth in community home page profiles#13222
π fix: add the user github oauth in community home page profiles#13222ONLY-yours merged 5 commits intocanaryfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Sorry @ONLY-yours, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
|
@tjx666 @nekomeowww - This PR adds GitHub OAuth social connect in the community home page profiles, touching auth/OAuth callback and market backend TRPC router. Please take a look. |
Codecov Reportβ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## canary #13222 +/- ##
==========================================
- Coverage 66.93% 66.84% -0.10%
==========================================
Files 1870 1873 +3
Lines 148122 148772 +650
Branches 14897 14935 +38
==========================================
+ Hits 99150 99442 +292
- Misses 48861 49219 +358
Partials 111 111
Flags with carried forward coverage won't be shown. Click here to find out more.
π New features to boost your workflow:
|
There was a problem hiding this comment.
π‘ Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0e6781ffff
βΉοΈ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with π.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const socialLinks: { github?: string; twitter?: string; website?: string } = {}; | ||
| if (values.github) socialLinks.github = values.github; | ||
| if (values.twitter) socialLinks.twitter = values.twitter; | ||
| if (githubConnect.profile?.username) socialLinks.github = githubConnect.profile.username; | ||
| if (twitterConnect.profile?.username) socialLinks.twitter = twitterConnect.profile.username; | ||
| if (values.website) socialLinks.website = values.website; |
There was a problem hiding this comment.
Preserve existing social links when OAuth data is missing
doSubmit now rebuilds socialLinks only from OAuth connection state (githubConnect.profile / twitterConnect.profile) and no longer falls back to the existing profile values, so users who already have GitHub/Twitter links but are not currently OAuth-connected (or whose profile fetch failed) will lose those links when saving unrelated edits. This is a data-loss regression from the previous form-based behavior and also propagates immediately to UI cache via the returned userProfile object.
Useful? React with πΒ / π.
| const [selectedMcps, setSelectedMcps] = useState<Set<string>>(() => { | ||
| return new Set(resources.mcps.map((r) => r.id)); | ||
| }); | ||
| const [selectedSkills, setSelectedSkills] = useState<Set<string>>(() => { | ||
| return new Set(resources.skills.map((r) => r.id)); |
There was a problem hiding this comment.
Reinitialize claim selection when resources change
The selected ID sets are initialized from resources only once with useState, but this modal can be reopened with a different resources payload while still mounted, causing stale selections to persist across sessions. In that case, users can end up claiming hidden old IDs or seeing new resources unselected by default, which makes claim behavior inconsistent with the list currently shown.
Useful? React with πΒ / π.
f8871a8 to
1c1844e
Compare
|
β€οΈ Great PR @ONLY-yours β€οΈ The growth of project is inseparable from user feedback and contribution, thanks for your contribution! If you are interesting with the lobehub developer community, please join our discord and then dm @arvinxx or @canisminor1990. They will invite you to our private developer channel. We are talking about the lobe-chat development or sharing ai newsletter around the world. |
π» Change Type
π Related Issue
π Description of Change
π§ͺ How to Test
πΈ Screenshots / Videos
π Additional Information