-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Move ResizerNotifier into SDKContext #30939
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
Conversation
so we don't have to pass it into RoomView
| if (!!this.props.currentUserId) { | ||
| pageElement = ( | ||
| <UserView userId={this.props.currentUserId} resizeNotifier={this.props.resizeNotifier} /> | ||
| <UserView userId={this.props.currentUserId} resizeNotifier={this.context.resizeNotifier} /> |
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.
Can UserView not also consume it via ctx?
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.
Unfortunately UserView uses MatrixClientContext so suffers the multiple-context problem as it's still a class component.
| pageType={this.props.page_type as PageTypes} | ||
| isMinimized={shouldUseMinimizedUI || false} | ||
| resizeNotifier={this.props.resizeNotifier} | ||
| resizeNotifier={this.context.resizeNotifier} |
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.
ditto for LeftPanel
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.
This only gets resizeNotifier so it can pass it into the legacy room list which doesn't seem worth changing at this point, it can just be stripped out when the old room list dies?
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.
Same for everything here =(
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.
I've taken out a bunch of these, most of the remainders are ones involving MessageComposer.
|
I guess this should have another quick look as there's quite a lot more code gone in to get the tests passing again |
| }); | ||
|
|
||
| it("should notify on resize start events", async () => { | ||
| //const user = userEvent.setup(); |
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.
surprise commented out line?
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.
oops, thanks
Half-Shot
left a comment
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.
VoIP files look fine (modulo one commented out line on a test)
* Move ResizerNotifier into SDKContext so we don't have to pass it into RoomView * Fix test * Unused import * Add tests * Remove a bunch of resizeNotifier props * Remove more resizeNotifier props * Add resizenotifier to test * Add more sdkcontext wrappers in tests * More sdkcontext wrappers * Even more sdkcontext wrappers * Add test to make sonarcloud happy * Context isn't always there unlike props * Test actual resizing too * Remove commented line
so we don't have to pass it into RoomView
We should really replace ResizerNotifier with ResizeObservers to do it automatically. This just merges in the change from the module experiments branch which makes it possible to create a roomview from a module (ie. without the module having to know about the ResizeNotifier to pass it to RoomView).
Checklist
public/exportedsymbols have accurate TSDoc documentation.