Merged
Conversation
gzdunek
commented
Mar 20, 2025
| /> | ||
| ); | ||
|
|
||
| export const TdpProcessing = () => ( |
Contributor
Author
There was a problem hiding this comment.
We had stories that looked the same, I removed them.
zmb3
reviewed
Mar 20, 2025
Collaborator
zmb3
left a comment
There was a problem hiding this comment.
I'll try to run it a bit later.
avatus
approved these changes
Mar 21, 2025
Comment on lines
+763
to
766
| resize = (spec: ClientScreenSpec) => { | ||
| this.sendClientScreenSpec(spec); | ||
| } | ||
| }; | ||
|
|
Contributor
There was a problem hiding this comment.
how was it working before without the lexical binding?
Contributor
Author
There was a problem hiding this comment.
It was wrapped in an arrow function:
const onResize = (e: { height: number; width: number }) => {
tdpClient.resize(e);
};I removed it and called the function directly.
zmb3
approved these changes
Mar 21, 2025
Contributor
gzdunek
added a commit
that referenced
this pull request
Mar 21, 2025
* Continue removing `useTdpClientCanvas` * Simplify connection state and `nextScreenState` * Call `initWasm` only once * Do not overwrite the keyboard handler (cherry picked from commit 4780986)
This file contains hidden or 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
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.
The primary goal of this PR is to simplify
nextScreenState, which was previously unnecessarily complicated.Additionally, the previous implementation used
useStateto manage this state and updated it inside auseEffect, which is a React anti-pattern.To improve this,
wsConnectionandtdpConnectionattempts were combined into a singletdpConnectionStatuswhich has the following states:Note that we don't keep information about graceful/non-graceful disconnection, everything is mapped to a generic "disconnected" status with a message. Why? Because the UI treats all disconnections the same, displaying the same component regardless of the reason.
I recommend reviewing commit by commit.
PS: This is still not the final version of this component. I’m opening smaller PRs to keep the review process manageable.