Skip to content

Don't ask for a Trac ticket while creating a site - #165

Merged
juanmaguitar merged 1 commit into
juanmaguitar/apply-panel-polishfrom
juanmaguitar/remove-trac-ticket-on-creation
Aug 7, 2026
Merged

Don't ask for a Trac ticket while creating a site#165
juanmaguitar merged 1 commit into
juanmaguitar/apply-panel-polishfrom
juanmaguitar/remove-trac-ticket-on-creation

Conversation

@juanmaguitar

Copy link
Copy Markdown
Collaborator

Fixes #164. Stacked on #142 — review the two-file diff, not the base.

What and why

The Create WordPress Core site modal asked for a Trac ticket alongside the site name and location. That is the moment someone is least likely to have an answer — they may be creating the site precisely so they can go find something to work on — and the field made the modal look longer and more demanding than it is.

It was also a second entry point for an association the site row already handles, better: link, change and unlink, at any point in the site's life. This removes the creation-time shortcut and leaves that panel as the only way in.

Changes

  • src/renderer/index.jsx — the field, its state, its resets and its creation-time validation are gone; parseTicketRef is no longer needed in the renderer (the panel validates in the main process), so the import narrows to ticketUrl.
  • src/main.js — with the renderer no longer passing one, the options.tracTicket branch of the wordpress:setup handler had no caller left. Removed rather than kept as dead code. parseTicketRef stays imported: sites:set-ticket still uses it.

The post-creation path — sites:set-ticket, trac-ticket.cjs, the ticket panel in SiteRow — is byte-identical.

Review

Ran the pass in .github/instructions/code-review.instructions.md, judgement dimensions dispatched to a fresh context per /self-review.

  • npm run lint — clean. npm test — 337/337.
  • 0 [fix here] · 0 [follow-up]. No findings across the five dimensions.

Three things the review verified rather than assumed, since they were the plausible failure modes:

  • Nothing else in src/, test/ or the docs expects a ticket at creation time — no test exercised wordpress:setup with options.tracTicket, so the deletion orphans no assertion.
  • Dropping tracTicket: null from the optimistic setSiteMeta patch cannot resurrect a stale ticket when a site is re-created at the same path: sites:forget and sites:delete both delete the meta entry, and the renderer refreshes wholesale from the store before a re-create can spread it.
  • No test added, deliberately: this removes a feature rather than adding one, the removed main-process branch had none, and there is no renderer-component harness in the repo. The behaviour that survives — validating and persisting a ticket — is already covered by the sites:set-ticket tests and test/trac-ticket.test.cjs.

Testing

Open Create WordPress Core site: only Site name and Site location. Create a site, then link a ticket from its row and confirm it saves, opens in Trac and unlinks.

🤖 Generated with Claude Code

The create-site modal asked for a ticket alongside name and location. That is
the moment someone is least likely to have one — they may be creating the site
precisely so they can go find a ticket to work on — and the site row already
offers linking, changing and unlinking at any point afterwards.

Removes the field, its state and its creation-time validation, and with the
renderer no longer passing one, the now-dead `tracTicket` branch of the
`wordpress:setup` handler. The post-creation path (`sites:set-ticket`, the
ticket panel, `trac-ticket.cjs`) is untouched.

Fixes #164

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@juanmaguitar
juanmaguitar merged commit 8d801ec into trunk Aug 7, 2026
3 checks passed
@juanmaguitar
juanmaguitar deleted the juanmaguitar/remove-trac-ticket-on-creation branch August 11, 2026 11:29
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.

Don't ask for a Trac ticket while creating a site

1 participant