Skip to content

feat: UI review implementation - #444

Draft
code-snippets-bot wants to merge 47 commits into
core-betafrom
feat/ui-review/core
Draft

feat: UI review implementation#444
code-snippets-bot wants to merge 47 commits into
core-betafrom
feat/ui-review/core

Conversation

@code-snippets-bot

Copy link
Copy Markdown
Contributor

Summary

Implementation of the Code Snippets UI review findings by John Fraskos. This PR covers all approved visual, accessibility, and behavioral changes across the Manage, Editor, Settings, and Blueprints surfaces.

Canonical design spec: CS Plugin Review (Notion) — refer to this document for design intent, Figma references, and measurements.

Changes

Navigation & layout

  • Unified subnavigation bands across all Manage subpages with white band, divider, and scroll-edge fades
  • Active tab blends into page background using gradient scrollport border (T1 spec)
  • Page titles standardized: 26px, #2c3337, font-weight: 510
  • #screen-meta-links and .show-settings borders unified to #e2e2e4
  • Removed container and notice margins on nav wrapper; -1px compensation for double border
  • Responsive toolbar overflow with toggle/chevron menu at narrow widths
  • Settings navigation overflow parity (scroll-edge fades for PHP-rendered tabs)

Snippets table

  • Table cell padding standardized: padding-block: 16px, padding-inline: 8px
  • Tab-count opacity treatment; Pro-badge tabs hide counts in Core
  • Snippet search with visible submit action (controlled input, Enter key handling)
  • Cloud state icons centered in column
  • Mobile pagination fixes (top hidden at ≤782px, search field constrained)

Editor

  • Heading hierarchy corrected: h2h1 for page title
  • Editor sidebar sticky offset (48px), position: static at ≤782px
  • Control borders unified to #c3c4c7 via theme.$control-border
  • Secondary/outline buttons: transparent background
  • Tags field accessible label retained, visual label removed
  • Asset cache-busting via filemtime() in Edit_Menu.php

Blueprints (Pro)

  • Gallery card layout: min-height 220px, title font-weight: 600, 3-line description clamp
  • Responsive grid: repeat(auto-fill, minmax(400px, 1fr))
  • Blueprint title sizing: 18px / line-height: 1.5

Global & accessibility

  • Badge colours adjusted to WCAG AA-compliant values (core, cloud, cloud_search, private)
  • --cs-* CSS custom properties layer in _theme.scss
  • Tooltip component: inline-size: max-content, max-inline-size: 200px, 12px, dark bg
  • Cloud sync status icons: styled tooltips with aria-label and role="img"
  • Asset versioning via filemtime() in Manage_Menu_Assets.php and Settings_Menu.php
  • Line-height 1.5 on card metadata and description text

Deferred (follow-up)

  • Conditions badge treatment — pending design decision
  • Local snippet Cloud-sync status content — pending design decision
  • Mobile table responsive card view — pending Imants's PR feat: add mobile snippet views #424 approach

QA

  • Verified on dev-site-4 (Core-only) and dev-site-3 (Pro)
  • Reviewed batch-by-batch with John Fraskos, all batches approved

Comment thread package.json Outdated
},
"dependencies": {
"@codemirror/fold": "^0.19.4",
"@tabler/icons-react": "^3.46.0",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would be good to avoid this dependency. We're just using the down chevron – could swap with this? https://developer.wordpress.org/resource/dashicons/#arrow-down-alt2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Agree, we should reduce dependencies. If we use specific icons, we can create icon components. We already do that in src/js/components/common/icons/.

Comment thread src/php/Admin/Menus/Settings_Menu.php Outdated
$handle = 'code-snippets-settings';
$handle = 'code-snippets-settings';
$plugin_dir = plugin_dir_path( PLUGIN_FILE );
$css_version = filemtime( $plugin_dir . 'dist/settings.css' );

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we can avoid this filemtime versioning outside of dev.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 904795d — removed the filemtime versioning, reverted to PLUGIN_VERSION.

Comment thread src/php/Admin/Menus/Edit_Menu.php Outdated

enqueue_code_editor( $this->snippet->type );

$plugin_dir = plugin_dir_path( PLUGIN_FILE );

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same here, we should remove.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Unsure how necessary this is, but I'll leave it as-is.

const SnippetTypeTab: React.FC<SnippetTypeTabProps> = ({ type, count }) => {
const { currentType, setCurrentType } = useSnippetsFilters()
const tabName = type ?? 'all'
const showCount = count !== undefined && (!type || 'php' === type || 'html' === type)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Make this depend on pro status.

</span> <TagsColumn snippet={snippet} />
</span>)}
{0 < snippet.tags.length || snippet.modified
? <div className={`snippet-card-meta${0 < snippet.tags.length ? ' has-tags' : ''}`}>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Use classnames.

Comment thread src/js/components/EditMenu/SnippetForm/page/PageHeading.tsx

return options?.enabled
? <div className="snippet-tags-container">
<h3>{__('Snippet Tags', 'code-snippets')}</h3>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remove.

Comment thread src/js/components/common/Toolbar.tsx Outdated
<details className="toolbar-more-menu">
<summary>
{__('More', 'code-snippets')}
<IconChevronDown size={16} stroke={2} aria-hidden="true" />

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Replace with dashicon?

<div className="code-snippets-preview-modal__buttons">{children}</div>
<div className="code-snippets-preview-modal__buttons">
{children}
<CopyCodeButton code={code} />

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Move this to children.

Comment thread src/css/edit.scss Outdated
Comment thread src/js/components/EditMenu/SnippetForm/fields/TagsEditor.tsx Outdated
Comment thread src/js/components/ManageMenu/SnippetsTable/SnippetsTable.tsx Outdated
Comment thread src/js/components/ManageMenu/SnippetsTable/SnippetsTableSearch.tsx Outdated
Comment on lines +74 to +79
$plugin_dir = plugin_dir_path( PLUGIN_FILE );
$css_version = filemtime( $plugin_dir . 'dist/manage.css' );
$js_version = filemtime( $plugin_dir . 'dist/manage.js' );
$css_version = false !== $css_version ? $css_version : PLUGIN_VERSION;
$js_version = false !== $js_version ? $js_version : PLUGIN_VERSION;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

already requested in #444 (comment)

* @return bool
*/
public function is_upsell_view(): bool {
return in_array( $this->get_current_subpage(), [ 'blueprints', 'cloud-library' ], true );

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should avoid hardcoding view names

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.

4 participants