-
Notifications
You must be signed in to change notification settings - Fork 78
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
[WIP] Within-app profile update post editing #1078
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/metafam/the-game/7QiQE47pMGTnRWCbkk7F5rBc6sAm |
This was referenced Jan 26, 2022
dysbulic
force-pushed
the
feat/jotai-profile-editing
branch
from
February 1, 2022 01:56
a833258
to
204e4dd
Compare
This was
linked to
issues
Feb 1, 2022
dysbulic
added a commit
that referenced
this pull request
Feb 8, 2022
#1078 is at about 4,000 lines changed and includes both code implementing features and unrelated functional and stylistic changes. This set of changes is about ⅓ of the total and should be largely independent. These changes include: * have Dependabot ignore `patch` version changes * switch the cache invalidation Hasura action to asynchronous * add a uniqueness constraint on the combination of player and skill ids * print a comprehensible error message in the db seeding script on network errors * add a mutex on the account creation process & allow it to happen only once *(subsequent runs were failing b/c of the uniqueness constraint on the ETH address & returning `null` (closes #1098)) * adds some more profile editing related types * renames `HighLow7dType` to `HighLowType` * refactors the `ColorBar` component to include links to a color explanation * replaces `fake-tag`'s `gql` string identifier with the dependency-free `/* GraphQL */` * rename `lib/hooks/useUserXp.ts` to `useUserXP.ts` * fixed some typings to remove `any`s * bumped some library versions & fixed the version numbers of some others
dysbulic
added a commit
that referenced
this pull request
Feb 8, 2022
dysbulic
added a commit
that referenced
this pull request
Feb 8, 2022
#1078 is at about 4,000 lines changed and includes both code implementing features and unrelated functional and stylistic changes. This set of changes is about ⅓ of the total and should be largely independent. These changes include: * have Dependabot ignore `patch` version changes * switch the cache invalidation Hasura action to asynchronous * add a uniqueness constraint on the combination of player and skill ids * print a comprehensible error message in the db seeding script on network errors * add a mutex on the account creation process & allow it to happen only once *(subsequent runs were failing b/c of the uniqueness constraint on the ETH address & returning `null` (closes #1098)) * adds some more profile editing related types * renames `HighLow7dType` to `HighLowType` * refactors the `ColorBar` component to include links to a color explanation * replaces `fake-tag`'s `gql` string identifier with the dependency-free `/* GraphQL */` * rename `lib/hooks/useUserXp.ts` to `useUserXP.ts` * fixed some typings to remove `any`s * bumped some library versions & fixed the version numbers of some others *
dysbulic
force-pushed
the
feat/eliminate-user.player
branch
from
February 8, 2022 13:39
d9e8ba6
to
6de66bc
Compare
dysbulic
added a commit
that referenced
this pull request
Feb 8, 2022
#1078 is at about 4,000 lines changed and includes both code implementing features and unrelated functional and stylistic changes. This set of changes is about ⅓ of the total and should be largely independent. These changes include: * have Dependabot ignore `patch` version changes * switch the cache invalidation Hasura action to asynchronous * add a uniqueness constraint on the combination of player and skill ids * print a comprehensible error message in the db seeding script on network errors * add a mutex on the account creation process & allow it to happen only once *(subsequent runs were failing b/c of the uniqueness constraint on the ETH address & returning `null` (closes #1098)) * adds some more profile editing related types * renames `HighLow7dType` to `HighLowType` * refactors the `ColorBar` component to include links to a color explanation * replaces `fake-tag`'s `gql` string identifier with the dependency-free `/* GraphQL */` * rename `lib/hooks/useUserXp.ts` to `useUserXP.ts` * fixed some typings to remove `any`s * bumped some library versions & fixed the version numbers of some others *
dysbulic
added a commit
that referenced
this pull request
Feb 8, 2022
tenfinney
added a commit
that referenced
this pull request
Feb 8, 2022
dysbulic
pushed a commit
that referenced
this pull request
Feb 14, 2022
dysbulic
pushed a commit
that referenced
this pull request
Feb 16, 2022
dan13ram
pushed a commit
that referenced
this pull request
Feb 16, 2022
#1078 is at about 4,000 lines changed and includes both code implementing features and unrelated functional and stylistic changes. This set of changes is about ⅓ of the total and should be largely independent. These changes include: * have Dependabot ignore `patch` version changes * switch the cache invalidation Hasura action to asynchronous * add a uniqueness constraint on the combination of player and skill ids * print a comprehensible error message in the db seeding script on network errors * add a mutex on the account creation process & allow it to happen only once *(subsequent runs were failing b/c of the uniqueness constraint on the ETH address & returning `null` (closes #1098)) * adds some more profile editing related types * renames `HighLow7dType` to `HighLowType` * refactors the `ColorBar` component to include links to a color explanation * replaces `fake-tag`'s `gql` string identifier with the dependency-free `/* GraphQL */` * rename `lib/hooks/useUserXp.ts` to `useUserXP.ts` * fixed some typings to remove `any`s * bumped some library versions & fixed the version numbers of some others *
dan13ram
pushed a commit
that referenced
this pull request
Feb 16, 2022
dysbulic
pushed a commit
that referenced
this pull request
Feb 20, 2022
tenfinney
added a commit
that referenced
this pull request
Feb 28, 2022
dysbulic
added a commit
that referenced
this pull request
Feb 28, 2022
* incorporating configuration panes from #1078 * standardizing player hero subcomponents & removing `owner` var from `useProfileField` 🚪 * switching box type, ambiguating overly-specific names, & massaging heights 📱 * reordering profile details sections, updating deployment environment, & conditionally wrapping the hero elements 🎬 * fixing render of color disposition selector 🕍 * self code review changes: removed some `;`s 🎋 * getting yarn typecheck && yarn lint to pass post rebase 🏇🏾 * handling "missing <div> in <button>" error with mounted check & setting HTTP return codes for OpenSea API endpoint 🕺 * `ProfileWizard` extends `Wizard`, roles display better on mobile, & pronouns use `ProfileWizardPane` 🍊 * properly encapsulating ETH address regex 🚲 * adding some tasks 🏥 * fixed skills layou * handling default values? ❔ * corrections for revision comments from @dan13ram (UI bugs to follow) 🌋 * cleaning up memberships & explorer type 🧫 * refactoring player roles configuration and display to use `WizardPane` 🔮 * bunches of mobile fixes & repairing the display of deserialized skills 📟 * removing redirect in static props & formatting memberships display for responsiveness 🪆 * improving comprehensability of `/me` & more mobile tweaking 🍦 * various spacing fixes & a “try again” button for connecting 🫕 * maybe fixed issue with saving images for fields with default values 🇩🇿 * switched roles selection to a bounded `SimpleGrid` to fix sizing weirdness 🧰 * fix: removed verify on brightId button * fix: clean up username page * formatting & fixing skills issues 🥩 * reformatting NFT display 🚂 * adding `/join` 🚉 * style: peth's suggestions * added mainnet required message * style: slight tweak of megamenu item positions * chore(release): 0.2.0 Co-authored-by: tenfinney <scott@1box.onmicrosoft.com> Co-authored-by: dan13ram <dan13ram@gmail.com> Co-authored-by: vidvidvid <weetopol@gmail.com>
tenfinney
pushed a commit
that referenced
this pull request
Mar 1, 2022
#1078 is at about 4,000 lines changed and includes both code implementing features and unrelated functional and stylistic changes. This set of changes is about ⅓ of the total and should be largely independent. These changes include: * have Dependabot ignore `patch` version changes * switch the cache invalidation Hasura action to asynchronous * add a uniqueness constraint on the combination of player and skill ids * print a comprehensible error message in the db seeding script on network errors * add a mutex on the account creation process & allow it to happen only once *(subsequent runs were failing b/c of the uniqueness constraint on the ETH address & returning `null` (closes #1098)) * adds some more profile editing related types * renames `HighLow7dType` to `HighLowType` * refactors the `ColorBar` component to include links to a color explanation * replaces `fake-tag`'s `gql` string identifier with the dependency-free `/* GraphQL */` * rename `lib/hooks/useUserXp.ts` to `useUserXP.ts` * fixed some typings to remove `any`s * bumped some library versions & fixed the version numbers of some others
tenfinney
pushed a commit
that referenced
this pull request
Mar 1, 2022
#1078 is at about 4,000 lines changed and includes both code implementing features and unrelated functional and stylistic changes. This set of changes is about ⅓ of the total and should be largely independent. These changes include: * have Dependabot ignore `patch` version changes * switch the cache invalidation Hasura action to asynchronous * add a uniqueness constraint on the combination of player and skill ids * print a comprehensible error message in the db seeding script on network errors * add a mutex on the account creation process & allow it to happen only once *(subsequent runs were failing b/c of the uniqueness constraint on the ETH address & returning `null` (closes #1098)) * adds some more profile editing related types * renames `HighLow7dType` to `HighLowType` * refactors the `ColorBar` component to include links to a color explanation * replaces `fake-tag`'s `gql` string identifier with the dependency-free `/* GraphQL */` * rename `lib/hooks/useUserXp.ts` to `useUserXP.ts` * fixed some typings to remove `any`s * bumped some library versions & fixed the version numbers of some others *
tenfinney
pushed a commit
that referenced
this pull request
Mar 1, 2022
tenfinney
added a commit
that referenced
this pull request
Mar 1, 2022
* incorporating configuration panes from #1078 * standardizing player hero subcomponents & removing `owner` var from `useProfileField` 🚪 * switching box type, ambiguating overly-specific names, & massaging heights 📱 * reordering profile details sections, updating deployment environment, & conditionally wrapping the hero elements 🎬 * fixing render of color disposition selector 🕍 * self code review changes: removed some `;`s 🎋 * getting yarn typecheck && yarn lint to pass post rebase 🏇🏾 * handling "missing <div> in <button>" error with mounted check & setting HTTP return codes for OpenSea API endpoint 🕺 * `ProfileWizard` extends `Wizard`, roles display better on mobile, & pronouns use `ProfileWizardPane` 🍊 * properly encapsulating ETH address regex 🚲 * adding some tasks 🏥 * fixed skills layou * handling default values? ❔ * corrections for revision comments from @dan13ram (UI bugs to follow) 🌋 * cleaning up memberships & explorer type 🧫 * refactoring player roles configuration and display to use `WizardPane` 🔮 * bunches of mobile fixes & repairing the display of deserialized skills 📟 * removing redirect in static props & formatting memberships display for responsiveness 🪆 * improving comprehensability of `/me` & more mobile tweaking 🍦 * various spacing fixes & a “try again” button for connecting 🫕 * maybe fixed issue with saving images for fields with default values 🇩🇿 * switched roles selection to a bounded `SimpleGrid` to fix sizing weirdness 🧰 * fix: removed verify on brightId button * fix: clean up username page * formatting & fixing skills issues 🥩 * reformatting NFT display 🚂 * adding `/join` 🚉 * style: peth's suggestions * added mainnet required message * style: slight tweak of megamenu item positions * chore(release): 0.2.0 Co-authored-by: tenfinney <scott@1box.onmicrosoft.com> Co-authored-by: dan13ram <dan13ram@gmail.com> Co-authored-by: vidvidvid <weetopol@gmail.com>
alalonde
pushed a commit
that referenced
this pull request
Mar 12, 2022
#1078 is at about 4,000 lines changed and includes both code implementing features and unrelated functional and stylistic changes. This set of changes is about ⅓ of the total and should be largely independent. These changes include: * have Dependabot ignore `patch` version changes * switch the cache invalidation Hasura action to asynchronous * add a uniqueness constraint on the combination of player and skill ids * print a comprehensible error message in the db seeding script on network errors * add a mutex on the account creation process & allow it to happen only once *(subsequent runs were failing b/c of the uniqueness constraint on the ETH address & returning `null` (closes #1098)) * adds some more profile editing related types * renames `HighLow7dType` to `HighLowType` * refactors the `ColorBar` component to include links to a color explanation * replaces `fake-tag`'s `gql` string identifier with the dependency-free `/* GraphQL */` * rename `lib/hooks/useUserXp.ts` to `useUserXP.ts` * fixed some typings to remove `any`s * bumped some library versions & fixed the version numbers of some others
alalonde
pushed a commit
that referenced
this pull request
Mar 12, 2022
#1078 is at about 4,000 lines changed and includes both code implementing features and unrelated functional and stylistic changes. This set of changes is about ⅓ of the total and should be largely independent. These changes include: * have Dependabot ignore `patch` version changes * switch the cache invalidation Hasura action to asynchronous * add a uniqueness constraint on the combination of player and skill ids * print a comprehensible error message in the db seeding script on network errors * add a mutex on the account creation process & allow it to happen only once *(subsequent runs were failing b/c of the uniqueness constraint on the ETH address & returning `null` (closes #1098)) * adds some more profile editing related types * renames `HighLow7dType` to `HighLowType` * refactors the `ColorBar` component to include links to a color explanation * replaces `fake-tag`'s `gql` string identifier with the dependency-free `/* GraphQL */` * rename `lib/hooks/useUserXp.ts` to `useUserXP.ts` * fixed some typings to remove `any`s * bumped some library versions & fixed the version numbers of some others *
alalonde
pushed a commit
that referenced
this pull request
Mar 12, 2022
alalonde
pushed a commit
that referenced
this pull request
Mar 12, 2022
* incorporating configuration panes from #1078 * standardizing player hero subcomponents & removing `owner` var from `useProfileField` 🚪 * switching box type, ambiguating overly-specific names, & massaging heights 📱 * reordering profile details sections, updating deployment environment, & conditionally wrapping the hero elements 🎬 * fixing render of color disposition selector 🕍 * self code review changes: removed some `;`s 🎋 * getting yarn typecheck && yarn lint to pass post rebase 🏇🏾 * handling "missing <div> in <button>" error with mounted check & setting HTTP return codes for OpenSea API endpoint 🕺 * `ProfileWizard` extends `Wizard`, roles display better on mobile, & pronouns use `ProfileWizardPane` 🍊 * properly encapsulating ETH address regex 🚲 * adding some tasks 🏥 * fixed skills layou * handling default values? ❔ * corrections for revision comments from @dan13ram (UI bugs to follow) 🌋 * cleaning up memberships & explorer type 🧫 * refactoring player roles configuration and display to use `WizardPane` 🔮 * bunches of mobile fixes & repairing the display of deserialized skills 📟 * removing redirect in static props & formatting memberships display for responsiveness 🪆 * improving comprehensability of `/me` & more mobile tweaking 🍦 * various spacing fixes & a “try again” button for connecting 🫕 * maybe fixed issue with saving images for fields with default values 🇩🇿 * switched roles selection to a bounded `SimpleGrid` to fix sizing weirdness 🧰 * fix: removed verify on brightId button * fix: clean up username page * formatting & fixing skills issues 🥩 * reformatting NFT display 🚂 * adding `/join` 🚉 * style: peth's suggestions * added mainnet required message * style: slight tweak of megamenu item positions * chore(release): 0.2.0 Co-authored-by: tenfinney <scott@1box.onmicrosoft.com> Co-authored-by: dan13ram <dan13ram@gmail.com> Co-authored-by: vidvidvid <weetopol@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
What features/fixes does this PR include?
This PR adds the Jotai state management library to propagate changes made by editing a player's profile to the display version.
The code in #943 writes to the Ceramic Network from the user's browser and notifies Hasura to renew its cache for that user. There is a time delay between when the user saves their changes and when an updated version of the profile page is available. This is exacerbated by caching by Next.js. This PR directly updates the profile page within the app so the user sees their inputted information.
There are also a couple of consistency changes, most notable switching
PlayerFragmentFragment
toPlayer
throughout. Also the removal of thegql
fake-tag
in favor of the/* GraphQL */
identifier.useUser
now simply returns aPlayer
object rather than auser
object with aplayer
attribute. The name of the returned object is stilluser
. Also, rather than using the same query for the player avatar in the top menu with a dozen@skip if $forLoginDisplay
s, there is now a separateuseLoginBasics
query that only returns the details needed for that avatar.Please provide the GitHub issue number
Closes #887 though "optimistic updates" is something of a misnomer because the editing flow will successfully complete the write to Ceramic and Hasura cache invalidation before it will update the values in Jotai.
Also, divides the GitHub deployment Action into separate jobs to address #1062 & moves the seeding step before the frontend generation step for #1083.
Follow up Improvement Ideas
There are a couple places we are prop drilling which could potentially be cleaned up using Jotai.
On a side note, there's also a Hasura migration to make skill / player combinations unique. Somehow the test deployment had double entries for all the players' skills for a bit & this should be prevented at the database level. It's unrelated, but the Hasura schema in this branch is ahead of
develop
, so I just put it here.Implementation
The PR adds a
useProfileField
hook that provides access to the profile data that can be overwritten with local state.It also adds a
useSaveCeramicProfile
that takes hashes of values and images, and sets the appropriate profile stream properties. (Values are stored in two separate streams, a basic one defined by 3Box and an extended one of my creation.) That hook also handles setting the local state values for the UI.