-
Notifications
You must be signed in to change notification settings - Fork 481
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
NUX API #2810
Merged
Merged
NUX API #2810
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
gaearon
reviewed
Sep 11, 2024
dholms
approved these changes
Sep 11, 2024
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.
yup yup look good 👌
Merged
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.
Adds a generic storage interface for "new user experiences". In the app, these will behave like:
completed === true
we do nothingdata
attributecompleted === true
and data is stored in prefsThe interface of a NUX is as follows:
id
a string with a max length of 64 characters, meant to be unique but human readable, this will be defined by the appcompleted
a boolean, you get the ideaexpiresAt
optional datetime, if expired, app will treat NUX as completeddata
string, max length of 300 chars (matches posts), optional stash of data, app will handle serdeValidation
NUXs are validated before insertion, and before we even hit the prefs API. No additional properties beyond what is defined are allowed.
Cleanup
Over time, these will accrue. In the app, we'll need to be judicious about how many NUXs are present for a given user. On a rolling basis, we will need to remove old NUXs as we add new ones. Some time after a NUX is removed from the app, we can remove old
id
s either on app load or on next write. This PR does not specify solutions to this.Naming
"New user experiences" as an acronym is NUXs. Not NUXes.
nuxs
does look a little weird, but for consistency I left it like that. NUX is how we've been referring to these internally, but if anyone has a better idea for a name lmk.