WP Explorer: a list view — ids, slugs, dates and counts in sortable columns, remembered per user - #733
Merged
Conversation
…olumns, remembered per user Every section (posts, pages, media, users, every CPT) gains an Icons / List switch in its search band. The list is a table of the facts a person who thinks in ids needs at a glance: the ID (a chip that copies itself), title with status and lock, slug (what tells a `-2` permalink from the post it shadows), author, dates, comment count, parent for hierarchical types, word count; file name, MIME, size, dimensions and the attached post for media; username, email, role, post count and registration for users. Column headers sort through the same server orders the icon view's "Sort by" menu offers — which grew ID, modified, slug and comment orders for posts and ID, username, email and post-count orders for users — and entering the list with no order chosen sorts by ID, highest first. Rows drag out, select, marquee, keyboard-navigate and infinite-scroll exactly like the tiles; selection and the open item are one state for both views, scrolled into sight after a switch. A per-row action cluster (edit, copy link, copy the `?p=` shortlink, more) and a column chooser complete it; the view mode and each section's hidden columns are remembered per user through the app's storage. Both views' context menus carry Copy ID and Copy shortlink, over a selection. Plugins add columns through the new `os.my-wordpress.list-columns` JS filter (documented, with an example), reading the same REST-visible fields the tiles carry. Two framework additions the surface needed: `copyText()` in `@openstation/app` (the clipboard with an insecure-origin fallback and an honest result), and comment markers for child slots in the kit's `html` renderer — the HTML parser foster-parents stray text out of a table, so cell templates nested in a row used to render after it. Three fixes found on the way: the hover card showed the excerpt's raw `[…]` entity, the sort menu's tick never painted (a dashicon inside the option's shadow root renders empty; the component's own `checked` glyph does), and an `ID`-primary order was silently flipped by the ID tiebreak key replacing it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Every WP Explorer section (posts, pages, media, users, every CPT) gains an Icons / List switch in its search band. The list is a sortable table of the facts an id-minded person needs at a glance — the idea came from a user who runs their newsletter on
?p=123links and reads ids off the CatchIDs plugin.sort_options()grew ID / modified / slug / comment orders for posts and ID / username / email / post-count orders for users. Entering the list with no order chosen sorts by ID, highest first.?p=shortlink, more (the context menu). Users get profile, footprint and archive link.$os->store().os.my-wordpress.list-columnsJS filter for plugin columns, documented indocs/javascript-reference.mdwith a recipe indocs/examples/my-wordpress-list-column.md.Framework additions
copyText()in@openstation/app(andwp.os.apps): async clipboard first, selection +execCommandfallback on insecure origins, resolves to whether the copy actually happened.htmlrenderer marks child slots with comment nodes. The HTML parser foster-parents stray text out of<table>/<tbody>/<tr>, so a text marker between two<td>s landed after the table with the cells. Attribute, comment and raw-text (<style>,<textarea>, …) slots keep text markers. Pinned bysrc/ui/core/html-table-slots.test.ts.Fixes found on the way
[…]; entities are decoded server-side now.os-context-menu-option's shadow root renders empty; both menus use the component'scheckedglyph.ID-primary order was silently flipped by the ID tiebreak key overwriting it in theorderbyarray.Tests
apps/my-wordpress/parts/list-table.test.ts(16): column model per kind, the plugin filter (add / reorder / drop, broken results ignored), sort cycling, header arrows andaria-sort, row facts, selection / activation / menu, the action cluster and the copying id chip, the column chooser, the view switch and selection carry-over.tests/phpunit/tests/myWordPressApp.php: the new sort orders (ID both ways, slug, username), the row facts, the remembered view mode per user, the remembered hidden columns per section, the decoded excerpt. Line budget raised for the new surface, every file still under 1,000 lines.phpcs -nand the app's PHPUnit class all green.🤖 Generated with Claude Code