Repository navigation
Forms: use title at dashboard when at top level - #47446
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
There was a problem hiding this comment.
Pull request overview
Updates the Forms dashboard header rendering so top-level routes use the Page title (larger header text) while deeper routes (single form responses) continue to use breadcrumbs, aligning Forms with other Jetpack admin pages.
Changes:
- Add a
titlereturn field tousePageHeaderDetailsand compute eithertitle(top-level) orbreadcrumbs(single-form depth). - Update Forms and Responses dashboard routes to pass the new
titleprop into the admin-uiPageheader.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| projects/packages/forms/src/dashboard/wp-build/hooks/use-page-header-details.tsx | Introduces title vs breadcrumbs selection logic for header content. |
| projects/packages/forms/routes/forms/stage.tsx | Passes title from usePageHeaderDetails into Page. |
| projects/packages/forms/routes/responses/stage.tsx | Passes title from usePageHeaderDetails into Page. |
Comments suppressed due to low confidence (1)
projects/packages/forms/src/dashboard/wp-build/hooks/use-page-header-details.tsx:54
- The hook now returns a
titlefield in addition to breadcrumbs/subtitle/actions. Please update the docblock above (Build wp-build page header details ...) to includetitleso the documentation matches the exported API.
type UsePageHeaderDetailsReturn = {
breadcrumbs: ReactNode;
title?: ReactNode;
badges?: ReactNode;
subtitle: ReactNode;
actions?: ReactNode;
};
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <Breadcrumbs | ||
| items={ [ | ||
| { label: __( 'Forms', 'jetpack-forms' ), to: '/forms' }, | ||
| { label: formTitle || __( 'Form responses', 'jetpack-forms' ) }, | ||
| ] } |
There was a problem hiding this comment.
The PR description (and the comment above) says "Forms" is a product name and should not be translated, but the breadcrumb label still uses __( 'Forms', 'jetpack-forms' ). Use the non-translated product name here as well to keep behavior consistent.
There was a problem hiding this comment.
Here "forms" refers to forms as CPTs, so I think it's fine to translate.
Code Coverage SummaryCoverage changed in 1 file.
Full summary · PHP report · JS report Coverage check overridden by
I don't care about code coverage for this PR
|
| }, [ sourceIdNumber, formTitle, duplicateForm, previewForm, copyEmbed, copyShortcode ] ); | ||
|
|
||
| const breadcrumbsItems = useMemo( () => { | ||
| const WrapWithJetpackLogo = ( { children }: { children: ReactNode } ) => ( |
There was a problem hiding this comment.
Something to componentize soon, most likely.
enejb
left a comment
There was a problem hiding this comment.
This worked well for me. But I haven't tested it in the CIAB.
|
@ilonagl and @grbicsanja approved in a convo, internal ref p1772622550100669-slack-C052XEUUBL4 |
Fixes JETPACK-1400
Make the header more consistent across all other Jetpack pages by using
title(bigger text) rather thanbreadcrumbs(smaller text) on top-level pages.Proposed changes:
titleinPagecomponent for Forms dashboard when at top level (forms list, all responses) and breadcrumbs only when deeper into the hierarchy (Forms -> Form responses)Before
After
Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
Changelog