Skip to content

Give the import page a way in on a desktop - #8

Merged
AllTerrainDeveloper merged 1 commit into
mainfrom
fix/import-dock-row
Aug 16, 2026
Merged

AllTerrainDeveloper merged 1 commit into
mainfrom
fix/import-dock-row

Conversation

@AllTerrainDeveloper

Copy link
Copy Markdown
Owner

A bug in the importers I just shipped, found by running the plugin on the OpenStation desktop site it is built to integrate with rather than on a bare WordPress install.

The bug

With the shell active, atf_register_admin_pages() deliberately does not register the Forms admin menu — every surface is reached through the dock tile, and a menu would put a second, duplicate tile in the dock. Each of those surfaces has a native window, so nothing is lost.

The import page is the exception: it has no native window, and it had no dock row. So on a desktop site, Forms → Import existed at a URL nobody could navigate to — no menu entry, no tile row, no icon. The feature shipped unreachable on exactly the sites it was written for.

The fix

The dock tile gains an Import forms row. It is the only row that carries a real url instead of an onSelect callback, and that is deliberate: the shell's own contract says a row with a real URL "stays the fallback for anything that can express itself as one", opening it as a window of its own. The import page is one of those things — a server-rendered page whose buttons POST to admin-post.php, which is the right shape for a one-time migration and the wrong shape for a native window rendering into the shell's DOM.

Gated on canEdit, same as the builder and Themes rows, and on there being an adminUrl in the config blob to point at — rather than a row that opens undefinedadmin.php.

Verified on the desktop, not in the abstract

  • The tile's constellation now reads: Forms · Form entries · Analytics · Themes · Import forms · Demo data.
  • Clicking it opens a proper "Import forms" window in the desktop.
  • Seeded a real Contact Form 7 form on that site and imported it from inside the window: "1 form imported", with the admin-post.php POST and its redirect staying inside the window. The stored schema came out right — five fields with their labels, {site} "{field:f3}" as the subject, {field:f2} as reply-to, confirmation and submit label carried over.
  • 4 new vitest cases on submenuFor() (offered to editors, carries a URL and no callback, absent without the capability, absent without an admin URL). Suites: 246 vitest + 556 PHPUnit, all green. tsc clean.

docs/architecture.md gains a short section on why Import is the one page with no native window, so the next person does not "fix" it into one.

🤖 Generated with Claude Code

https://claude.ai/code/session_0119U4sRRWGcTQdwYreTwpAp

With OpenStation active the Forms admin menu is not registered -- every
surface is reached through the dock tile instead -- so the import page,
which has no native window and had no dock row, existed at a URL nobody
could navigate to. The feature shipped unreachable on exactly the sites
it was built for.

The tile gains an "Import forms" row: the one row carrying a real `url`
rather than a callback, because the shell opens such a row as a window
of its own, and an admin page whose buttons POST is the wrong shape for
a native window rendering into the shell's DOM. Gated on the same
capability as the builder, and on there being an admin URL in the config
to point at.

Found by running the plugin on the desktop site it integrates with,
rather than on a bare WordPress.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0119U4sRRWGcTQdwYreTwpAp
@AllTerrainDeveloper
AllTerrainDeveloper merged commit 98453a5 into main Aug 16, 2026
3 checks passed
@AllTerrainDeveloper
AllTerrainDeveloper deleted the fix/import-dock-row branch August 16, 2026 20:03
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