Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PCH Editor Sidebar: Fix some UI glitches #2288

Merged
merged 6 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/content-helper/editor-sidebar.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-primitives', 'wp-url'), 'version' => 'a265109c5fa322a0558f');
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-primitives', 'wp-url'), 'version' => 'fe30b8792c8f278e4f90');
4 changes: 2 additions & 2 deletions build/content-helper/editor-sidebar.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/content-helper/excerpt-generator.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-primitives', 'wp-url', 'wp-wordcount'), 'version' => '2d0071eca570bd4ce8c0');
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-primitives', 'wp-url', 'wp-wordcount'), 'version' => 'f7e99682a4b31332222f');
2 changes: 1 addition & 1 deletion build/content-helper/excerpt-generator.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/content-helper/excerpt-generator.js

Large diffs are not rendered by default.

30 changes: 16 additions & 14 deletions src/content-helper/editor-sidebar/editor-sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@
}
}

.content-helper-error-message {
margin-top: to_rem(15px) !important;
}

.wp-parsely-content-helper-error .content-helper-error-message {
margin-top: to_rem(15px) !important;
}

p.content-helper-error-message-hint {
color: var(--gray-700);
}
acicovic marked this conversation as resolved.
Show resolved Hide resolved

.wp-parsely-content-helper {

.wp-parsely-sidebar-header {
Expand All @@ -43,6 +55,10 @@
.wp-parsely-sidebar-main-panel {

.wp-parsely-sidebar-tabs {
// Error messages that are not contained within a panel.
.components-panel > .content-helper-error-message {
margin: var(--grid-unit-20, to_rem(16px));
}

.components-tab-panel__tabs {

Expand All @@ -68,8 +84,6 @@
background: var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
}
}


}
}

Expand All @@ -83,16 +97,4 @@
height: 22px;
}
}

.content-helper-error-message {
margin-top: to_rem(15px) !important;
}

.wp-parsely-content-helper-error .content-helper-error-message {
margin-top: to_rem(15px) !important;
}

p.content-helper-error-message-hint {
color: var(--gray-700);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* WordPress dependencies
*/
import {
__experimentalInputControlPrefixWrapper as InputControlPrefixWrapper,
Button,
__experimentalInputControlPrefixWrapper as InputControlPrefixWrapper,
MenuGroup,
MenuItem,
SelectControl,
Expand Down Expand Up @@ -32,8 +32,8 @@ import { PerformanceCategoriesPanel } from './component-panel-categories';
import { PerformanceOverviewPanel } from './component-panel-overview';
import { PerformanceReferrersPanel } from './component-panel-referrers';
import { PerformanceData } from './model';
import { PerformanceDetailsProvider } from './provider';
import './performance-details.scss';
import { PerformanceDetailsProvider } from './provider';

// Number of attempts to fetch the data before displaying an error.
const FETCH_RETRIES = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
border-top: 1px solid rgb(221, 221, 221);
margin-top: -1px;

.content-helper-error-message {
margin: 0 !important;
}

/** View in Parse.ly button */
.components-button.wp-parsely-view-post {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ const PostExcerptGenerator = () => {
const generateExcerpt = async () => {
setLoading( true );
setError( undefined );
setGeneratedExcerptCount( generatedExcerptCount + 1 );

try {
Telemetry.trackEvent( 'excerpt_generator_pressed' );
const requestedExcerpt = await excerptGeneratorProvider.generateExcerpt( postTitle, postContent );
setGeneratedExcerpt( requestedExcerpt );
setGeneratedExcerptCount( generatedExcerptCount + 1 );
} catch ( err: any ) { // eslint-disable-line @typescript-eslint/no-explicit-any
setError( err );
} finally {
Expand Down
16 changes: 16 additions & 0 deletions src/content-helper/excerpt-generator/excerpt-generator.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,20 @@
padding: var(--grid-unit-10, to_rem(8px)) var(--grid-unit-15, to_rem(12px));
}
}

.components-notice {
margin: var(--grid-unit-20, to_rem(16px)) 0 var(--grid-unit-15, to_rem(12px)) 0;

.components-notice__content {
margin: 0;

.content-helper-error-message {
margin-top: 0 !important;

p:last-child {
margin-bottom: 0 !important;
}
}
}
}
}