feat: UI review implementation - #444
Conversation
| }, | ||
| "dependencies": { | ||
| "@codemirror/fold": "^0.19.4", | ||
| "@tabler/icons-react": "^3.46.0", |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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/.
| $handle = 'code-snippets-settings'; | ||
| $handle = 'code-snippets-settings'; | ||
| $plugin_dir = plugin_dir_path( PLUGIN_FILE ); | ||
| $css_version = filemtime( $plugin_dir . 'dist/settings.css' ); |
There was a problem hiding this comment.
I think we can avoid this filemtime versioning outside of dev.
There was a problem hiding this comment.
Fixed in 904795d — removed the filemtime versioning, reverted to PLUGIN_VERSION.
|
|
||
| enqueue_code_editor( $this->snippet->type ); | ||
|
|
||
| $plugin_dir = plugin_dir_path( PLUGIN_FILE ); |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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' : ''}`}> |
|
|
||
| return options?.enabled | ||
| ? <div className="snippet-tags-container"> | ||
| <h3>{__('Snippet Tags', 'code-snippets')}</h3> |
| <details className="toolbar-more-menu"> | ||
| <summary> | ||
| {__('More', 'code-snippets')} | ||
| <IconChevronDown size={16} stroke={2} aria-hidden="true" /> |
| <div className="code-snippets-preview-modal__buttons">{children}</div> | ||
| <div className="code-snippets-preview-modal__buttons"> | ||
| {children} | ||
| <CopyCodeButton code={code} /> |
| $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; | ||
|
|
| * @return bool | ||
| */ | ||
| public function is_upsell_view(): bool { | ||
| return in_array( $this->get_current_subpage(), [ 'blueprints', 'cloud-library' ], true ); |
There was a problem hiding this comment.
should avoid hardcoding view names
…, avoid hardcoded subpage names
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
#2c3337,font-weight: 510#screen-meta-linksand.show-settingsborders unified to#e2e2e4-1pxcompensation for double borderSnippets table
padding-block: 16px,padding-inline: 8pxEditor
h2→h1for page titleposition: staticat ≤782px#c3c4c7viatheme.$control-borderfilemtime()in Edit_Menu.phpBlueprints (Pro)
font-weight: 600, 3-line description clamprepeat(auto-fill, minmax(400px, 1fr))18px/line-height: 1.5Global & accessibility
core,cloud,cloud_search,private)--cs-*CSS custom properties layer in_theme.scssinline-size: max-content,max-inline-size: 200px,12px, dark bgaria-labelandrole="img"filemtime()in Manage_Menu_Assets.php and Settings_Menu.php1.5on card metadata and description textDeferred (follow-up)
QA