This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 827
Convert tabbedview to functional component #12478
Merged
Merged
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
The 'Tab' is still a class, so now it's a functional component that has a supporting class, which is maybe a bit... jarring, but I think is actually perfectly logical.
dbkr
added a commit
that referenced
this pull request
May 1, 2024
This does mean the logic of keeping what tab is active is now in each container component, but for a functional component, this is a single line. It makes TabbedView simpler and the container components always know exactly what tab is being displayed rather than having to effectively keep the state separately themselves if they wanted it. Based on #12478
4 tasks
florianduros
suggested changes
May 2, 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.
Looks good!
I think we can improve it by creating more small components for its children and add more documentation
and use contitional call syntax
florianduros
approved these changes
May 3, 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.
Thanks
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 3, 2024
* Convert tabbedview to functional component The 'Tab' is still a class, so now it's a functional component that has a supporting class, which is maybe a bit... jarring, but I think is actually perfectly logical. * put comment back * Fix bad tab ID behaviour * Make TabbedView a controlled component This does mean the logic of keeping what tab is active is now in each container component, but for a functional component, this is a single line. It makes TabbedView simpler and the container components always know exactly what tab is being displayed rather than having to effectively keep the state separately themselves if they wanted it. Based on #12478 * Fix some types & unused prop * Remove weird behaviour of using first tab is active isn't valid * Don't pass initialTabID here now it no longer has the prop * Fix test * bleh... id, not icon * Change to sub-components and use contitional call syntax * Comments * Fix element IDs * Fix merge * Test DesktopCapturerSourcePicker to make sonarcloud the right colour * Use custom hook for the fllback tab behaviour
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 7, 2024
* Convert tabbedview to functional component The 'Tab' is still a class, so now it's a functional component that has a supporting class, which is maybe a bit... jarring, but I think is actually perfectly logical. * put comment back * Fix bad tab ID behaviour * Make TabbedView a controlled component This does mean the logic of keeping what tab is active is now in each container component, but for a functional component, this is a single line. It makes TabbedView simpler and the container components always know exactly what tab is being displayed rather than having to effectively keep the state separately themselves if they wanted it. Based on #12478 * Move the active tab in user settings to the dialog title Separated by a colon, as per the new design. * Update snapshots * Update a playwright test * Fix more tests / snapshots * Attempt to test all the cases of titleForTabID * More tests
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 'Tab' is still a class, so now it's a functional component that has a supporting class, which is maybe a bit... jarring, but I think is actually perfectly logical.
Checklist
public
/exported
symbols have accurate TSDoc documentation.