Skip to content

Show the generate result on the button, with a details modal - #248

Merged
bordoni merged 1 commit into
mainfrom
feature/generate-result
Oct 19, 2026
Merged

bordoni merged 1 commit into
mainfrom
feature/generate-result

Conversation

@bordoni

@bordoni bordoni commented Oct 19, 2026

Copy link
Copy Markdown
Owner

After a run, the React admin only showed "Successfully generated 9 items in 12.39s." in small green text below the button, plus a second notice at the top of the page. The 0.9.x screens linked every generated item. This brings that back, and adds more.

On the button

  • The status is docked to the Generate button: beside it on wide screens, below the full-width button on narrow ones.
  • While it runs: progress and elapsed time.
  • When it's done: what was generated, with the right noun ("9 posts generated · 12.4s", thumbnails for media and users on desktop), or the error message. Includes View details and a dismiss button.
  • The duplicate notices at the top of each page are gone.

Details modal

  • Stats: items, time, per item, requests. A failed run shows the error code and HTTP status instead.
  • Every item, with a short summary and edit and view links:
    • posts: status, author, categories, tags
    • media: file type, dimensions, size
    • users: username, role, email
    • terms: taxonomy, slug, parent
    • comments: author, post, status
  • Copy IDs, and Open list to the matching admin screen.
  • Advanced: full data: every field and meta value of each item, plus the raw request and response of each batch, as JSON with Copy.

REST

  • The generate endpoints now return items and list_url, from a new Describes_Generated_Items trait. Documented in the OpenAPI schema.
  • User data leaves out the password hash, activation key, capabilities and session tokens.

Fixes found along the way

  • REST errors ({ code, message }) showed "An unknown error occurred.". They now show their message.
  • Links from batched runs were merged by index, so each batch overwrote the one before.
  • Term names came back empty when one wp_get_object_terms() call included post_format, a core quirk. They're now fetched one taxonomy at a time.
  • The shadcn Dialog portalled outside the themed React root and sat under the admin bar.

Changelog lines included.

Checked: PHPCS, WPUnit (112 tests, 4 new in GeneratedItemsTest), build, lint, typecheck and Jest (76 tests). On the demo site I clicked through Posts, Users, Terms, Comments and Attachments on desktop and mobile, plus a faked 403. Each click sends one generate request.

Before After

@bordoni
bordoni merged commit f0d9a70 into main Oct 19, 2026
5 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.

1 participant