refactor(desktop): single-home the definition form as AgentDefinitionDialog (Phase 1B.3a)#1627
Merged
Merged
Conversation
bea5793 to
8f3426f
Compare
…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>
d66a286 to
8ae9b46
Compare
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.
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.tsxmoves toAgentDefinitionDialog.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
personaDialogState) stays load-bearing; the per-surface collapse to a single dialog-state owner is B3b/B3c.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.UpdateManagedAgentInputfor 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+onSubmitwidening had pushed it near the brink. Root-cause fix rather than a guard exception: the self-contained window file-drag-over effect moves touseWindowFileDragOver.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
src/), file-size/px-text/pubkey checks clean-g "agent|persona"56/56 locally, zero spec edits; full suite in CIContext
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.