Add collapsible option to Widget header.#12664
Merged
Merged
Conversation
|
Size Change: 0 B Total Size: 2.3 MB ℹ️ View Unchanged
|
Collaborator
Author
eugene-manuilov
requested changes
May 8, 2026
eugene-manuilov
left a comment
Collaborator
There was a problem hiding this comment.
Thanks, @tofumatt. Mostly looks good, just a few minor issues that we should address before merging.
Comment on lines
+23
to
+28
| import { ElementType, FC, ReactNode, useEffect, useState } from 'react'; | ||
|
|
||
| /** | ||
| * WordPress dependencies | ||
| */ | ||
| import { forwardRef } from '@wordpress/element'; |
Collaborator
There was a problem hiding this comment.
I believe we should import useEffect and useState hooks from the @wordpress/i18n library, right?
Collaborator
Author
There was a problem hiding this comment.
Oh, yes, good catch, thanks! 👍🏻
Comment on lines
+36
to
+37
| import { useMount } from 'react-use'; | ||
| import { useInstanceId } from '@wordpress/compose'; |
| import WidgetHeaderTitle from '@/js/googlesitekit/widgets/components/WidgetHeaderTitle'; | ||
| import { useSelect } from 'googlesitekit-data'; | ||
| import { Select, useSelect } from 'googlesitekit-data'; | ||
| import { FC } from 'react'; |
| import WidgetHeaderTitle from '@/js/googlesitekit/widgets/components/WidgetHeaderTitle'; | ||
| import { useSelect } from 'googlesitekit-data'; | ||
| import { Select, useSelect } from 'googlesitekit-data'; | ||
| import { FC } from 'react'; |
eugene-manuilov
requested changes
May 8, 2026
| className?: string; | ||
| } | ||
|
|
||
| const Cell: FC< CellProps > = ( { |
Collaborator
There was a problem hiding this comment.
Looks like changes to this component trigger name changes, which cause VRT failures. Could you please either add the displayName = 'Cell' or approve the new VRT images.
Collaborator
Author
There was a problem hiding this comment.
Oh, I see, sure thing 👍🏻
I've approved the changes.
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.

Summary
Addresses issue:
Relevant technical choices
Converted several components to TypeScript as part of this PR.
I did not add toggle tests to the specific components because the collapsing functionality is already covered. I did add a snapshot to ensure the widget is rendered with a collapsible toggle though.
PR Author Checklist
Do not alter or remove anything below. The following sections will be managed by moderators only.
Code Reviewer Checklist
Merge Reviewer Checklist