Skip to content

refactor(desktop): single-home the definition form as AgentDefinitionDialog (Phase 1B.3a)#1627

Merged
wesbillman merged 1 commit into
mainfrom
feat/agent-definition-form
Jul 8, 2026
Merged

refactor(desktop): single-home the definition form as AgentDefinitionDialog (Phase 1B.3a)#1627
wesbillman merged 1 commit into
mainfrom
feat/agent-definition-form

Conversation

@wesbillman

Copy link
Copy Markdown
Collaborator

Phase 1B.3a — single-home the definition form

First slice of Phase 1B.3 (#centralize-personas-and-agents). Mechanical re-homing, zero behavior change: PersonaDialog.tsx moves to AgentDefinitionDialog.tsx (component renamed to match its single-homed role), and its three consumers re-import:

  • AgentDialog (B2's unified create — definition family)
  • AgentsView (edit / duplicate / import mount)
  • UserProfilePersonaDialogs (profile-panel edit / duplicate)

Stacked on #1626 (B2). git records the move at 94% similarity — the body moved, it didn't change.

What deliberately does NOT change

  • Mount topology & state: every surface keeps its own dialog state and mounts. B2's mount-exclusivity insurance (create never sets personaDialogState) stays load-bearing; the per-surface collapse to a single dialog-state owner is B3b/B3c.
  • Testids, element ids, user-facing copy: persona-dialog, persona-dialog-submit, #persona-runtime, … move with the form body, so the persona-path e2e specs run unchanged — that is the review criterion for this slice (zero spec edits). Vocabulary renames remain B4.
  • Wire shapes: untouched, per the standing pin (now explicitly extended to UpdateManagedAgentInput for the rest of B3).

One disclosed extraction (forced by the file-size guard, not preference)

The rename-move landed the file at 1005 lines against the 1000-line guard — B2's createFooterSlot + onSubmit widening had pushed it near the brink. Root-cause fix rather than a guard exception: the self-contained window file-drag-over effect moves to useWindowFileDragOver.ts (behavior-identical: depth-counted enter/leave, copy dropEffect, reset-on-disable — the dep-conjunction collapse and dropped redundant close-reset were both proven no-ops in review). File is now 944 lines — 56 under the guard, real headroom rather than a shave.

Verification

  • tsc, biome (full src/), file-size/px-text/pubkey checks clean
  • 2061/0 unit tests
  • smoke e2e -g "agent|persona" 56/56 locally, zero spec edits; full suite in CI
  • Cross-reviewed by Pinky (scope pressure-test + independent line-by-line and verification run, channel thread)

Context

Next slices: B3b re-hosts the instance-edit form around the existing pure modules (personaRuntimeModel.ts, useRequiredCredentialState.ts) preserving the [open, agent.pubkey] reset lifecycle; B3c cuts the profile panel over (cascade kept as-is, re-pointed); B3.5 is an explicit mapping-convergence slice with a per-divergence decision table — three definition→instance mappings exist today and converging them silently inside a cutover PR is exactly what the slice discipline bans.

@wesbillman wesbillman force-pushed the feat/agent-dialog-create branch from bea5793 to 8f3426f Compare July 8, 2026 14:16
Base automatically changed from feat/agent-dialog-create to main July 8, 2026 14:42
…Dialog (Phase 1B.3a)

Mechanical re-homing: PersonaDialog.tsx moves to AgentDefinitionDialog.tsx
(component renamed to match its single-homed role), and its three consumers
(AgentDialog's definition family, AgentsView's edit/duplicate/import mount,
UserProfilePersonaDialogs) re-import. Zero mount-topology changes, zero
behavior changes: every surface keeps its own dialog state and mounts;
the B2 exclusivity insurance stays load-bearing until B3b/B3c collapse
each surface to a single dialog-state owner.

Testids, element ids, and user-facing copy are untouched — they move with
the form body, so the persona-path e2e specs run unchanged. Vocabulary
renames remain Phase 1B.4.

One extraction forced by the file-size guard, not preference: the
self-contained window file-drag-over effect moves to useWindowFileDragOver.ts
(behavior-identical, depth-counted enter/leave with disabled reset). The
rename-move landed the file at 1005 lines against the 1000 limit; splitting
the standalone effect is the root-cause fix, an exception would be a bandage.

Verified: tsc, biome (full src), file-size checks, 2061/0 unit tests,
smoke e2e -g "agent|persona" 56/56 locally.

Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
@wesbillman wesbillman force-pushed the feat/agent-definition-form branch from d66a286 to 8ae9b46 Compare July 8, 2026 14:43
@wesbillman wesbillman merged commit 48bd8ab into main Jul 8, 2026
25 checks passed
@wesbillman wesbillman deleted the feat/agent-definition-form branch July 8, 2026 14:56
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