Skip to content

Add collapsible option to Widget header.#12664

Merged
techanvil merged 8 commits into
developfrom
12599-collapsible
May 11, 2026
Merged

Add collapsible option to Widget header.#12664
techanvil merged 8 commits into
developfrom
12599-collapsible

Conversation

@tofumatt

@tofumatt tofumatt commented May 7, 2026

Copy link
Copy Markdown
Collaborator

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

  • My code is tested and passes existing unit tests.
  • My code has an appropriate set of unit tests which all pass.
  • My code is backward-compatible with WordPress 5.2 and PHP 7.4.
  • My code follows the WordPress coding standards.
  • My code has proper inline documentation.
  • I have added a QA Brief on the issue linked above.
  • I have signed the Contributor License Agreement (see https://cla.developers.google.com/).

Do not alter or remove anything below. The following sections will be managed by moderators only.

Code Reviewer Checklist

  • Run the code.
  • Ensure the acceptance criteria are satisfied.
  • Reassess the implementation with the IB.
  • Ensure no unrelated changes are included.
  • Ensure CI checks pass.
  • Check Storybook where applicable.
  • Ensure there is a QA Brief.
  • Ensure there are no unexpected significant changes to file sizes.

Merge Reviewer Checklist

  • Ensure the PR has the correct target branch.
  • Double-check that the PR is okay to be merged.
  • Ensure the corresponding issue has a ZenHub release assigned.
  • Add a changelog message to the issue.

@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown

🤖 This comment is automatically updated by CI workflows. Each section is managed independently.

📚 Storybook for 933d236:

  • Storybook has been deleted.

📦 Build files for 933d236:

  • Build files have been deleted.

🎭 Playwright reports for 933d236:

@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown

Size Change: 0 B

Total Size: 2.3 MB

ℹ️ View Unchanged
Filename Size Change
dist/assets/blocks/reader-revenue-manager/block-editor-plugin/editor-styles.css 124 B 0 B
dist/assets/blocks/reader-revenue-manager/block-editor-plugin/editor-styles.js 0 B 0 B 🆕
dist/assets/blocks/reader-revenue-manager/block-editor-plugin/index.js 42.7 kB 0 B
dist/assets/blocks/reader-revenue-manager/common/editor-styles.css 307 B 0 B
dist/assets/blocks/reader-revenue-manager/common/editor-styles.js 0 B 0 B 🆕
dist/assets/blocks/reader-revenue-manager/contribute-with-google/index.js 5.81 kB 0 B
dist/assets/blocks/reader-revenue-manager/contribute-with-google/non-site-kit-user.js 5 kB 0 B
dist/assets/blocks/reader-revenue-manager/subscribe-with-google/index.js 5.81 kB 0 B
dist/assets/blocks/reader-revenue-manager/subscribe-with-google/non-site-kit-user.js 5 kB 0 B
dist/assets/blocks/sign-in-with-google/editor-styles.css 84 B 0 B
dist/assets/blocks/sign-in-with-google/editor-styles.js 0 B 0 B 🆕
dist/assets/blocks/sign-in-with-google/index.js 18.5 kB 0 B
dist/assets/css/googlesitekit-admin-css-********************.min.css 68.4 kB +98 B (+0.14%)
dist/assets/css/googlesitekit-adminbar-css-********************.min.css 12.2 kB 0 B
dist/assets/css/googlesitekit-authorize-application-css-********************.min.css 851 B 0 B
dist/assets/css/googlesitekit-wp-dashboard-css-********************.min.css 8.88 kB 0 B
dist/assets/js/146-********************.js 960 B 0 B
dist/assets/js/201-********************.js 2.85 kB 0 B
dist/assets/js/314-********************.js 100 kB 0 B
dist/assets/js/315-********************.js 3.08 kB 0 B
dist/assets/js/379-********************.js 3.7 kB 0 B
dist/assets/js/590-********************.js 1.88 kB 0 B
dist/assets/js/640-********************.js 2.35 kB 0 B
dist/assets/js/909-********************.js 1.01 kB 0 B
dist/assets/js/analytics-advanced-tracking-********************.js 404 B 0 B
dist/assets/js/googlesitekit-activation-********************.js 24.8 kB -160 B (-0.64%)
dist/assets/js/googlesitekit-ad-blocking-recovery-********************.js 59.9 kB -200 B (-0.33%)
dist/assets/js/googlesitekit-admin-pointers-tracking-********************.js 5.36 kB 0 B
dist/assets/js/googlesitekit-adminbar-********************.js 36 kB +262 B (+0.73%)
dist/assets/js/googlesitekit-api-********************.js 8.01 kB 0 B
dist/assets/js/googlesitekit-block-tracking-********************.js 5.56 kB 0 B
dist/assets/js/googlesitekit-components-********************.js 5.58 kB -120 B (-2.11%)
dist/assets/js/googlesitekit-consent-mode-********************.js 25.5 kB 0 B
dist/assets/js/googlesitekit-data-********************.js 1.76 kB 0 B
dist/assets/js/googlesitekit-datastore-forms-********************.js 7.21 kB 0 B
dist/assets/js/googlesitekit-datastore-location-********************.js 1.52 kB 0 B
dist/assets/js/googlesitekit-datastore-site-********************.js 18.6 kB 0 B
dist/assets/js/googlesitekit-datastore-ui-********************.js 7.37 kB 0 B
dist/assets/js/googlesitekit-datastore-user-********************.js 23.1 kB 0 B
dist/assets/js/googlesitekit-entity-dashboard-********************.js 73.2 kB +369 B (+0.51%)
dist/assets/js/googlesitekit-events-provider-contact-form-7-********************.js 1.23 kB 0 B
dist/assets/js/googlesitekit-events-provider-easy-digital-downloads-********************.js 629 B 0 B
dist/assets/js/googlesitekit-events-provider-mailchimp-********************.js 1.22 kB 0 B
dist/assets/js/googlesitekit-events-provider-ninja-forms-********************.js 1.22 kB 0 B
dist/assets/js/googlesitekit-events-provider-optin-monster-********************.js 1.25 kB 0 B
dist/assets/js/googlesitekit-events-provider-popup-maker-********************.js 1.29 kB 0 B
dist/assets/js/googlesitekit-events-provider-woocommerce-********************.js 918 B 0 B
dist/assets/js/googlesitekit-events-provider-wpforms-********************.js 1.25 kB 0 B
dist/assets/js/googlesitekit-i18n-********************.js 6.1 kB 0 B
dist/assets/js/googlesitekit-key-metrics-setup-********************.js 53 kB -193 B (-0.36%)
dist/assets/js/googlesitekit-main-dashboard-********************.js 157 kB +211 B (+0.13%)
dist/assets/js/googlesitekit-metric-selection-********************.js 59.1 kB -201 B (-0.34%)
dist/assets/js/googlesitekit-modules-********************.js 25.9 kB -192 B (-0.74%)
dist/assets/js/googlesitekit-modules-ads-********************.js 47.9 kB -213 B (-0.44%)
dist/assets/js/googlesitekit-modules-adsense-********************.js 136 kB -196 B (-0.14%)
dist/assets/js/googlesitekit-modules-analytics-4-********************.js 188 kB +211 B (+0.11%)
dist/assets/js/googlesitekit-modules-pagespeed-insights-********************.js 23.3 kB -183 B (-0.78%)
dist/assets/js/googlesitekit-modules-reader-revenue-manager-********************.js 52.5 kB -199 B (-0.38%)
dist/assets/js/googlesitekit-modules-search-console-********************.js 65.3 kB -278 B (-0.42%)
dist/assets/js/googlesitekit-modules-sign-in-with-google-********************.js 33.8 kB -241 B (-0.71%)
dist/assets/js/googlesitekit-modules-tagmanager-********************.js 30.1 kB 0 B
dist/assets/js/googlesitekit-notifications-********************.js 66.6 kB -266 B (-0.4%)
dist/assets/js/googlesitekit-polyfills-********************.js 228 B 0 B
dist/assets/js/googlesitekit-settings-********************.js 135 kB +84 B (+0.06%)
dist/assets/js/googlesitekit-splash-********************.js 79 kB -222 B (-0.28%)
dist/assets/js/googlesitekit-user-input-********************.js 51.5 kB -174 B (-0.34%)
dist/assets/js/googlesitekit-vendor-********************.js 315 kB 0 B
dist/assets/js/googlesitekit-widgets-********************.js 104 kB +303 B (+0.29%)
dist/assets/js/googlesitekit-wp-dashboard-********************.js 61 kB +233 B (+0.38%)
dist/assets/js/runtime-********************.js 1.86 kB 0 B

compressed-size-action

@tofumatt

tofumatt commented May 7, 2026

Copy link
Copy Markdown
Collaborator Author

VRT failures I saw were unrelated:

Screenshot 2026-05-07 at 23 29 15

@eugene-manuilov eugene-manuilov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we should import useEffect and useState hooks from the @wordpress/i18n library, right?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, yes, good catch, thanks! 👍🏻

Comment on lines +36 to +37
import { useMount } from 'react-use';
import { useInstanceId } from '@wordpress/compose';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong location.

import WidgetHeaderTitle from '@/js/googlesitekit/widgets/components/WidgetHeaderTitle';
import { useSelect } from 'googlesitekit-data';
import { Select, useSelect } from 'googlesitekit-data';
import { FC } from 'react';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong location.

import WidgetHeaderTitle from '@/js/googlesitekit/widgets/components/WidgetHeaderTitle';
import { useSelect } from 'googlesitekit-data';
import { Select, useSelect } from 'googlesitekit-data';
import { FC } from 'react';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong location.

className?: string;
}

const Cell: FC< CellProps > = ( {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see, sure thing 👍🏻

I've approved the changes.

@techanvil techanvil left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @tofumatt, this LGTM.

Note that I've confirmed the failing CI checks are unrelated to this PR.

@techanvil techanvil merged commit d9c8f23 into develop May 11, 2026
31 of 33 checks passed
@techanvil techanvil deleted the 12599-collapsible branch May 11, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants