Skip to content

Commit

Permalink
Merge pull request #2288 from Parsely/fix/some-pch-editor-sidebar-ui-…
Browse files Browse the repository at this point in the history
…glitches

PCH Editor Sidebar: Fix some UI glitches
  • Loading branch information
acicovic authored Mar 13, 2024
2 parents 9a58ba4 + f6f42b7 commit 316015a
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 23 deletions.
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);
}

.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;
}
}
}
}
}

0 comments on commit 316015a

Please sign in to comment.