Skip to content

feat: new admin UI foundation#415

Merged
sheabunge merged 95 commits into
fix/166-ui-review-fixesfrom
feat/168-ui-foundation
Jul 21, 2026
Merged

feat: new admin UI foundation#415
sheabunge merged 95 commits into
fix/166-ui-review-fixesfrom
feat/168-ui-foundation

Conversation

@imantsk

@imantsk imantsk commented Jul 14, 2026

Copy link
Copy Markdown
Member

Summary

Implements the new admin UI foundation across the plugin's admin screens.

  • Top header (76px): logo band resized with 24px/16px padding and a translucent bottom border.
  • Primary nav (60px): items reordered to Snippets, Blueprints, Community Cloud, My Library on the start side with Import (new) and Settings aligned to the end side; 16px/590 labels with a 4px active underline; Pro-gated items now use a muted blue pill in place of the orange chip.
  • Snippet type tabs: restyled as a boxed segmented control on a 53px grey band with vertical rules between tabs and a filled active tile; the "All Snippets" tab is text-only and type tabs keep their badges.
  • Contextual title row: the create button moved out of the tab row into a new page header with a 32px/510 h1 and a right-aligned primary action; status links (All | Active | Inactive) restyled to 13px with rule dividers; search moved into the results toolbar with pagination alone on the end side.
  • View toggle: replaced the checkbox switch with a two-icon segmented pair (38px tiles, filled accent active state), right-aligned in the tab band.
  • Control tokens: global input/select/button overrides updated to 38px height, 5px radius, and #c3c4c7 borders; admin-menu pill and table priority field pinned to their compact sizes.
  • KebabMenu: new reusable popover menu component (src/js/components/common/KebabMenu.tsx) with divider, destructive, and custom-row support; closes on outside click and Escape, traps focus, and flips above the trigger near the viewport edge. Not yet wired into any screen.
  • Settings page: section tabs drop their dashicons and adopt the segmented style; visible 32px/510 page title added; save/reset buttons laid out with a 14px gap.
  • Import and Community Cloud pages: titles aligned with the new shell; controls inherit the global tokens.

Verification

  • npm run build compiles successfully (Node 20).
  • npm run lint:js, npm run lint:styles, and npm run lint:php all pass.
  • npm run test:php: 116 tests, 258 assertions, 0 failures (25 skipped).

@imantsk
imantsk force-pushed the feat/168-ui-foundation branch from d02849c to d69c5f6 Compare July 15, 2026 14:33
@imantsk
imantsk force-pushed the feat/168-ui-foundation branch from d69c5f6 to ee0e4de Compare July 15, 2026 14:52
@code-snippets-bot

code-snippets-bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor
  • Blocking — Update tests for the changed default view. src/php/REST_API/Snippets/Preferences_REST_Controller.php:42 changes DEFAULT_SNIPPET_VIEW from card to table, but tests/unit/REST_API/REST_API_Preferences_Test.php:92,127 still expects card for both the unset and invalid-value cases. Those assertions now contradict production behavior and will fail when PHPUnit runs. Update both expectations, plus the card-specific test name/docblock, to table.

@imantsk

imantsk commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

Updated preference coverage to assert the table default and invalid-value fallback. PHPUnit passes.

@code-snippets-bot

Copy link
Copy Markdown
Contributor

Two small cleanups remain:

  • SnippetsTableSearch.tsx:21-24 adds a Search button whose handler only calls setSearchQuery(searchQuery). Because the controlled input already updates that same state on every keystroke at line 18, clicking the button is a no-op. Please either remove the button or separate draft input from the submitted query so it performs a real search action.
  • src/css/common/_toolbar.scss:203 has an extra blank line at EOF, causing git diff --check to fail.

@imantsk

imantsk commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

The search box now submits through a real form control, and the stray blank line at the toolbar stylesheet EOF is gone.

@code-snippets-bot

Copy link
Copy Markdown
Contributor

Follow-up adversarial re-audit found four remaining issues:

  1. Search submission is still a no-op. SnippetsTableSearch.tsx:13 only calls preventDefault(), while line 21 already applies setSearchQuery() on every keystroke. Clicking Search or pressing Enter changes nothing. Please either remove the redundant form/button or maintain a draft value and commit it from onSubmit.

  2. The Community Cloud selector is mislabelled. CloudSearch.tsx:153 calls the control “Bulk Edit”, but its only action is Download. Please use “Bulk actions” or a download-specific label.

  3. The exact PR introduces four lint warnings in changed code. Full lint reports new max-lines-per-function warnings at SnippetTypeInput.tsx:47, KebabMenu.tsx:118-119, and ListTable.tsx:175; the exact fix: UI review bugs #414 base is warning-free under the same dependency tree. Please split these functions/hooks instead of adding lint debt.

  4. _list-table.scss grows from 313 to 615 lines. This materially increases an existing overage despite the AGENTS.md 300-line source-file limit. The new toolbar, pagination, search, and responsive sections are separable and should be moved into focused partials.

@imantsk

imantsk commented Jul 18, 2026

Copy link
Copy Markdown
Member Author

Resolved. Snippet search is explicitly live with the redundant submit removed, the cloud selector uses “Bulk actions,” warned functions were split, and the list-table additions moved into focused partials within the source limits. Lint, PHPUnit, and build pass.

@code-snippets-bot
code-snippets-bot marked this pull request as ready for review July 18, 2026 10:12
# Conflicts:
#	src/css/common/_subnav.scss
#	src/css/common/_theme.scss
#	src/css/manage.scss
#	src/php/Admin/Menus/Manage_Menu.php
#	tests/unit/Admin/Menus/Manage_Menu_Test.php

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.

This can be moved under list-table/.

export const PartialDataListTable = <T, K extends Key, A extends string>(
props: PartialDataListTableProps<T, K, A>
) => {
const [selected, setSelected] = useState(() => new Set<K>())

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 don't really see any value in taking this out as a separate inner component?

<div className="snippet-editor-sidebar">
<div className="box">
{snippet.id && !isCondition(snippet) && <ActivationSwitch />}
{snippet.id && !isCondition(snippet) ? <ActivationSwitch /> : null}

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.

???

Comment thread src/php/Model/Snippet.php
case 'desc':
// Descriptions render as rich HTML but can originate from remote
// sources such as the cloud, so restrict them to post-safe markup.
return wp_kses_post( $value );

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.

Given that this a rendering/presentation detail, I don't know if it belongs in a setter.

<?php $this->render_section_tabs(); ?>

<h2 class="screen-reader-text"><?php esc_html_e( 'Settings', 'code-snippets' ); ?></h2>
<div class="snippets-page-header">

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.

Is switching a h2 with a h1 okay from an accessibility perspective? @ramiy, do you know?

*
* @return void
*/
public function handle(): void {

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 this be a REST API controller?

icon: <BlueprintIcon />,
pro: true,
subpage: 'blueprints'
},

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.

Pro items should be grouped together.

pro?: boolean
pageSlug?: string
subpage?: typeof SUBPAGES[number]
end?: boolean

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 not need to set this manually.

Co-authored-by: Maisy <maisy@codesnippets.pro>
Co-authored-by: Shea Bunge <shea@sheabunge.com>
@sheabunge
sheabunge merged commit ebf92d8 into fix/166-ui-review-fixes Jul 21, 2026
6 checks passed
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.

3 participants