-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Refactor composer state for threads #5945
Conversation
dispatch={dispatch} | ||
post={draft} | ||
thread={composerState.thread} | ||
dispatch={composerDispatch} |
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.
In most cases we pass the "post" dispatch
but here it needs the broader one to set post/threadgates. I'm just calling it dispatch
everywhere though. Might be a bit confusing but types clarify which one it needs.
|
9ef8fef
to
0ac363f
Compare
0ac363f
to
640b71d
Compare
172d464
to
b29f159
Compare
640b71d
to
4086255
Compare
4086255
to
cb6afc1
Compare
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.
lgtm, tested range of composer features without issues
TS can see it's exhaustive.
cb6afc1
to
48ee82d
Compare
* origin/main: (213 commits) add Thai Language translation support (#5879) fix warning on labeler profile: emoji detected but emoji not enabled (#6011) Added blur to search's onPressMenu (#6017) React compiler beta and reenable rule (#5898) Sort imports (#6009) Clarify build instructions (#6008) Upgrade all tiptap deps to latest (#5232) width full on text container (#6007) Bump 1.94.0 (#6006) Add subtle web hover to interactive rows (#5989) Settings revamp (#5745) Show almost-instant preview when opening lightbox (#6000) Refactor lightbox model to plain object (#5999) temp revert to old modal (#6005) Extend composer checks to all posts in a thread (#5955) Remove indirection when rendering composer state (#5954) Refactor composer state for threads (#5945) Disable Post button when empty (#5953) fix splash screen (#5997) Fix video quality for short videos (#5996) ...
* Refactor composer state for threads * Remove unnecessary default case TS can see it's exhaustive.
* Refactor composer state for threads * Remove unnecessary default case TS can see it's exhaustive.
Stacked on #5953
This prepares the composer state structure to handle multiple posts in a thread. Previously we just had the
draft
. Now we have athread
made ofposts
.Most of the reducer logic is now in
postReducer
which updatesPostState
in response toPostAction
. ThepostReducer
is being called for the current post from the outercomposerReducer
.We're not actually taking advantage of this in the UI yet. The UI is the same and it only reads the current post's state (which is always the first post because we don't have any logic to add/remove posts yet).
Also, the publishing code only looks at the first post at the moment. That will be changed later.
Test Plan
Same as usual, verify different composer features work.