Skip to content

WP Explorer: a list view — ids, slugs, dates and counts in sortable columns, remembered per user - #733

Merged
AllTerrainDeveloper merged 1 commit into
trunkfrom
feature/my-wordpress-list-view
Sep 1, 2026
Merged

WP Explorer: a list view — ids, slugs, dates and counts in sortable columns, remembered per user#733
AllTerrainDeveloper merged 1 commit into
trunkfrom
feature/my-wordpress-list-view

Conversation

@AllTerrainDeveloper

@AllTerrainDeveloper AllTerrainDeveloper commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

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=123 links and reads ids off the CatchIDs plugin.

  • Columns per kind. Posts and CPTs: ID (a chip that copies itself), Title with status badge and lock, Slug, Author, Status, Date, Modified (live relative time), Comments, Parent (hierarchical types), Words (off by default). Media: ID, File, File name, Type, Size, Dimensions, Attached to, Uploaded by, Uploaded, Modified. Users: ID, Name, Username, Email, Role, Posts, Registered.
  • Sortable headers drive the same server orders the icon view's "Sort by" menu offers; 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.
  • Same rows, same behaviour: drag-out, click / Ctrl / Shift / marquee selection, keyboard navigation (arrows, Enter, Space), infinite scroll through the framework's paged list. Selection and the open item are one state for both views and scroll into sight after a switch. The preview pane stays.
  • Row action cluster: edit, copy link, copy the ?p= shortlink, more (the context menu). Users get profile, footprint and archive link.
  • Copy ID and Copy shortlink in both views' context menus, over a selection.
  • Column chooser with ticks, remembered per section; the view mode remembered too — both per user through $os->store().
  • os.my-wordpress.list-columns JS filter for plugin columns, documented in docs/javascript-reference.md with a recipe in docs/examples/my-wordpress-list-column.md.

Framework additions

  • copyText() in @openstation/app (and wp.os.apps): async clipboard first, selection + execCommand fallback on insecure origins, resolves to whether the copy actually happened.
  • The kit's html renderer 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 by src/ui/core/html-table-slots.test.ts.

Fixes found on the way

  • The hover card showed the excerpt's raw [&hellip;]; entities are decoded server-side now.
  • The sort menu's tick never painted — a dashicon inside os-context-menu-option's shadow root renders empty; both menus use the component's checked glyph.
  • An ID-primary order was silently flipped by the ID tiebreak key overwriting it in the orderby array.

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 and aria-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.
  • Full JS suite (427 files), type check, ESLint, phpcs -n and the app's PHPUnit class all green.

🤖 Generated with Claude Code

Open WordPress Playground Preview

…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
`[&hellip;]` 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>
@AllTerrainDeveloper
AllTerrainDeveloper enabled auto-merge (squash) September 1, 2026 22:48
@AllTerrainDeveloper
AllTerrainDeveloper merged commit e6987a0 into trunk Sep 1, 2026
5 checks passed
@AllTerrainDeveloper
AllTerrainDeveloper deleted the feature/my-wordpress-list-view branch September 1, 2026 22:52
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