@@ -186,6 +186,13 @@ export function ContextDrawer({ agents, attentionHistory = [], onSelectAttention
186186 const visibleProposalFields = selection . kind === "proposal"
187187 ? selection . item . fields . filter ( field => ! completionProofFields . includes ( field ) ) : [ ] ;
188188 const proposalTarget = selection . kind === "proposal" ? selection . item : null ;
189+ const recoveringTodoCreation = proposalTarget ?. reviewPlan ?. reason === "todo_creation_retry" ;
190+ const preserveOriginalProposal = proposalTarget ?. reviewPlan ?. prohibitRegeneration === true ;
191+ const retainedTodoGate = preserveOriginalProposal && proposalTarget ?. actionKind === "todo.create"
192+ && proposalTarget . gate ?. kind === "canonical_authority_required" ? proposalTarget . gate : null ;
193+ const shownProposalFields = retainedTodoGate ? [ ] : recoveringTodoCreation
194+ ? visibleProposalFields . filter ( field => field . key !== "text" && field . key !== "goal_id" )
195+ : visibleProposalFields ;
189196 const taskExecution = proposalTarget ?. status === "applied" && ! proposalReadbackUnavailable && ! readOnly
190197 ? proposalTarget . reviewPlan ?. taskExecution : undefined ;
191198 const proposalRequests = proposalTarget ?. todoId
@@ -347,6 +354,8 @@ export function ContextDrawer({ agents, attentionHistory = [], onSelectAttention
347354 && selection . item . reviewPlan ?. operationFrame ?. kind === "result"
348355 && selection . item . reviewPlan . operationFrame . resultKind === "unknown" ;
349356 const decisionFrame = selection . kind === "proposal" ? selection . item . reviewPlan ?. decisionFrame : undefined ;
357+ const completedTodoCreation = proposalTarget ?. actionKind === "todo.create"
358+ && proposalTarget . reviewPlan ?. interaction === "completed" ;
350359 const title = taskExecution ? t ( "drawer.taskLaunchReceipt" )
351360 : selection . kind === "attention" ? t ( "drawer.titleAttention" )
352361 : selection . kind === "todo" ? t ( "drawer.taskDetails" )
@@ -1224,15 +1233,17 @@ export function ContextDrawer({ agents, attentionHistory = [], onSelectAttention
12241233 ? < div role = "status" className = "personal-proposal-state is-error" data-testid = "operation-readback-unavailable" > < p > { t ( "proposal.readbackUnavailable" ) } </ p >
12251234 { onRetryProposalReadback ? < button type = "button" className = "personal-secondary-action" disabled = { proposalReadbackFetching } onClick = { onRetryProposalReadback } > { t ( "proposal.readbackRetry" ) } </ button > : null } </ div > : null }
12261235 { selection . item . actionKind === "team.plan" && selection . item . status === "applied" ? < TeamPlanResult proposal = { selection . item } t = { t } /> : < section className = "personal-proposal-card" >
1227- { ! taskExecution ? < small > { selection . item . reviewPlan ?. operationFrame ?. kind === "pending"
1236+ { ! taskExecution ? < small > { ( selection . item . reviewPlan ?. operationFrame ?. kind === "pending" || recoveringTodoCreation )
12281237 ? t ( `proposal.kind.${ selection . item . actionKind } ` )
12291238 : `${ t ( `proposal.kind.${ selection . item . actionKind } ` ) } · ${ t ( `proposal.status.${ selection . item . status } ` ) } ` } </ small > : null }
12301239 { decisionFrame ? < span className = { `personal-decision-chip is-${ decisionFrame . decision } ` } > { t ( `proposal.decision.${ decisionFrame . decision } ` ) } </ span > : null }
12311240 < h3 > { selection . item . title } </ h3 >
12321241 { selection . item . todoId && ( selection . item . actionKind === "gate.resolve" || selection . item . actionKind === "todo.update" )
12331242 ? < div className = "personal-attention-meta" > < AttentionProvenance detail = { proposalRequests . length === 1 ? proposalRequests [ 0 ] . details : undefined } /> </ div > : null }
1234- { selection . item . impact ? < p > { selection . item . impact } </ p > : null }
1235- { selection . item . reviewPlan && ! selection . item . reviewPlan . creationExecution && ! selection . item . reviewPlan . retryOriginal && ! taskExecution && selection . item . actionKind !== "team.plan" && ! ( decisionFrame && [ "ready" , "applied" ] . includes ( selection . item . status ) ) ? < p className = "personal-proposal-explainer" data-action-review = { selection . item . reviewPlan . interaction } > { operationUnknown
1243+ { retainedTodoGate ? < div className = "personal-proposal-state is-gated" role = "status" >
1244+ < span > { retainedTodoGate . summary } { retainedTodoGate . nextAction ? < small > { retainedTodoGate . nextAction } </ small > : null } </ span >
1245+ </ div > : selection . item . impact ? < p > { selection . item . impact } </ p > : null }
1246+ { selection . item . reviewPlan && ! retainedTodoGate && ! selection . item . reviewPlan . creationExecution && ! selection . item . reviewPlan . retryOriginal && ! taskExecution && selection . item . actionKind !== "team.plan" && ! ( decisionFrame && [ "ready" , "applied" ] . includes ( selection . item . status ) ) ? < p className = "personal-proposal-explainer" data-action-review = { selection . item . reviewPlan . interaction } > { operationUnknown
12361247 ? t ( "actionReview.operation_reconcile_original" )
12371248 : selection . item . reviewPlan . operationFrame ?. kind === "inactive"
12381249 ? t ( `actionReview.${ selection . item . reviewPlan . operationFrame . reason } ` )
@@ -1245,7 +1256,7 @@ export function ContextDrawer({ agents, attentionHistory = [], onSelectAttention
12451256 : t ( `actionReview.${ selection . item . reviewPlan . reason } ` ) } </ p > : null }
12461257 { selection . item . status === "ready" && ! selection . item . reviewPlan ?. creationExecution && selection . item . actionKind !== "team.plan" && ! decisionFrame ? < p className = "personal-proposal-explainer" > { t ( "drawer.proposalExplainer" ) } </ p > : null }
12471258 { selection . item . reviewPlan ?. creationExecution ? < GoalCreationExecution execution = { selection . item . reviewPlan . creationExecution } /> : null }
1248- { ! taskExecution && visibleProposalFields . length ? < dl > { visibleProposalFields . map ( ( field ) => < div key = { field . key } > < dt > { field . label } </ dt > < dd > { field . value } </ dd > </ div > ) } </ dl > : null }
1259+ { ! taskExecution && shownProposalFields . length ? < dl > { shownProposalFields . map ( ( field ) => < div key = { field . key } > < dt > { field . label } </ dt > < dd > { field . value } </ dd > </ div > ) } </ dl > : null }
12491260 </ section > }
12501261 { selection . item . reviewPlan ?. creationProgress ?. goalId && selection . item . status !== "applied" ? < div className = "personal-proposal-state is-applied" role = "status" data-testid = "goal-creation-committed" > < Check size = { 16 } /> < span >
12511262 < strong > { t ( "proposal.field.goalId" ) } : { selection . item . reviewPlan . creationProgress . goalId } · { t ( "proposal.status.applied" ) } </ strong >
@@ -1266,10 +1277,23 @@ export function ContextDrawer({ agents, attentionHistory = [], onSelectAttention
12661277 ? < p className = "personal-proposal-state is-stale" > { t ( "proposal.primary.operationCancelled" ) } </ p > : null }
12671278 { selection . item . status === "deferred" ? < p className = "personal-proposal-state is-gated" > { t ( "drawer.proposalDeferred" ) } </ p > : null }
12681279 { selection . item . status === "gated" && selection . item . actionKind === "gate.resolve" ? < div className = "personal-proposal-state is-gated" > < span > < strong > { t ( "drawer.gateDecisionRecheckTitle" ) } </ strong > { t ( "drawer.gateDecisionRecheck" ) } </ span > </ div >
1269- : selection . item . status === "gated" ? < div className = "personal-proposal-state is-gated" > < span > < strong > { selection . item . actionKind === "operation.execute" ? selection . item . primaryLabel : selection . item . workspaceCandidates ?. length || selection . item . gate ?. kind === "agent_unavailable" ? selection . item . title : t ( "drawer.gateRequiresHost" ) } </ strong > { selection . item . actionKind === "operation.execute" || selection . item . workspaceCandidates ?. length || selection . item . gate ?. kind === "agent_unavailable" ? selection . item . impact : t ( "drawer.gateRequiresHostDescription" ) } </ span > { selection . item . gate ?. nextAction ? < small > { selection . item . gate . nextAction } </ small > : null } </ div > : null }
1280+ : selection . item . status === "gated" && ! retainedTodoGate ? < div className = "personal-proposal-state is-gated" > < span > < strong > { selection . item . actionKind === "operation.execute" ? selection . item . primaryLabel : selection . item . workspaceCandidates ?. length || selection . item . gate ?. kind === "agent_unavailable" ? selection . item . title : t ( "drawer.gateRequiresHost" ) } </ strong > { selection . item . actionKind === "operation.execute" || selection . item . workspaceCandidates ?. length || selection . item . gate ?. kind === "agent_unavailable" ? selection . item . impact : t ( "drawer.gateRequiresHostDescription" ) } </ span > { selection . item . gate ?. nextAction ? < small > { selection . item . gate . nextAction } </ small > : null } </ div > : null }
12701281 { ! readOnly && selection . item . workspaceCandidates ?. length ? < div className = "personal-workspace-candidates" aria-label = { t ( "drawer.workspaceCandidates" ) } > { selection . item . workspaceCandidates . map ( ( candidate ) => < button key = { candidate . workspaceRef } onClick = { ( ) => void callbacks . onSelectWorkspaceCandidate ?.( selection . item , candidate . workspaceRef ) } type = "button" > < strong > { candidate . label } </ strong > < small > { t ( "proposal.workspaceGate.candidateValue" ) } </ small > </ button > ) } </ div > : null }
1271- { ! readOnly && selection . item . actionKind !== "operation.execute" && selection . item . status === "error" && ( ! [ "team.plan" , "goal.create" ] . includes ( selection . item . actionKind ) || ( selection . item . reviewPlan ?. retryOriginal && selection . item . reviewPlan . canApply ) ) ? < button className = "personal-primary-action" onClick = { ( ) => void ( selection . item . reviewPlan ?. retryOriginal ? callbacks . onApplyProposal ?.( selection . item ) : callbacks . onTransitionProposal ?.( selection . item , "regenerate" ) ) } type = "button" > < RotateCcw size = { 17 } /> { t ( selection . item . reviewPlan ?. retryOriginal ? "drawer.retryOriginal" : "drawer.proposalRegenerate" ) } </ button > : ! readOnly && selection . item . actionKind !== "operation.execute" && selection . item . status !== "gated" && ! ( [ "team.plan" , "goal.create" ] . includes ( selection . item . actionKind ) && [ "error" , "stale" ] . includes ( selection . item . status ) ) && ! ( ( selection . item . actionKind === "team.plan" || decisionFrame || taskExecution ) && selection . item . status === "applied" ) ? < button className = "personal-primary-action" disabled = { ! [ 'ready' , 'deferred' ] . includes ( selection . item . status ) || selection . item . reviewPlan ?. canApply === false } onClick = { ( ) => void callbacks . onApplyProposal ?.( selection . item ) } type = "button" > < Check size = { 17 } /> { selection . item . status === "applying" ? t ( "drawer.applying" ) : selection . item . primaryLabel ?? t ( "drawer.apply" ) } </ button > : null }
1272- { ! readOnly && selection . item . actionKind !== "operation.execute" && ! selection . item . reviewPlan ?. creationProgress ?. goalId && ( [ "stale" , "gated" , "rejected" ] . includes ( selection . item . status ) || ( selection . item . status === "ready" && selection . item . reviewPlan ?. canApply === false ) ) ? < button className = "personal-secondary-action" onClick = { ( ) => void callbacks . onTransitionProposal ?.( selection . item , "regenerate" ) } type = "button" > < RotateCcw size = { 16 } /> { t ( "drawer.proposalRecheck" ) } </ button > : null }
1282+ { ! readOnly && selection . item . actionKind !== "operation.execute" && selection . item . status === "error"
1283+ && ( ( selection . item . reviewPlan ?. retryOriginal && selection . item . reviewPlan . canApply )
1284+ || ( ! preserveOriginalProposal && ! [ "team.plan" , "goal.create" ] . includes ( selection . item . actionKind ) ) )
1285+ ? < button className = "personal-primary-action" onClick = { ( ) => void ( selection . item . reviewPlan ?. retryOriginal ? callbacks . onApplyProposal ?.( selection . item ) : callbacks . onTransitionProposal ?.( selection . item , "regenerate" ) ) } type = "button" > < RotateCcw size = { 17 } /> { t ( selection . item . reviewPlan ?. retryOriginal ? "drawer.retryOriginal" : "drawer.proposalRegenerate" ) } </ button >
1286+ : ! readOnly && selection . item . actionKind !== "operation.execute" && selection . item . status !== "gated"
1287+ && ! ( ( preserveOriginalProposal || [ "team.plan" , "goal.create" ] . includes ( selection . item . actionKind ) )
1288+ && [ "error" , "stale" ] . includes ( selection . item . status ) )
1289+ && ! ( ( selection . item . actionKind === "team.plan" || decisionFrame || taskExecution || completedTodoCreation )
1290+ && selection . item . status === "applied" )
1291+ ? < button className = "personal-primary-action" disabled = { ! [ 'ready' , 'deferred' ] . includes ( selection . item . status ) || selection . item . reviewPlan ?. canApply === false } onClick = { ( ) => void callbacks . onApplyProposal ?.( selection . item ) } type = "button" > < Check size = { 17 } /> { selection . item . status === "applying" ? t ( "drawer.applying" ) : selection . item . primaryLabel ?? t ( "drawer.apply" ) } </ button >
1292+ : null }
1293+ { ! readOnly && selection . item . actionKind !== "operation.execute" && ! preserveOriginalProposal
1294+ && ! selection . item . reviewPlan ?. creationProgress ?. goalId && ( [ "stale" , "gated" , "rejected" ] . includes ( selection . item . status )
1295+ || ( selection . item . status === "ready" && selection . item . reviewPlan ?. canApply === false ) )
1296+ ? < button className = "personal-secondary-action" onClick = { ( ) => void callbacks . onTransitionProposal ?.( selection . item , "regenerate" ) } type = "button" > < RotateCcw size = { 16 } /> { t ( "drawer.proposalRecheck" ) } </ button > : null }
12731297 { ! readOnly && selection . item . persisted !== false && selection . item . actionKind !== "operation.execute" && selection . item . actionKind !== "gate.resolve" && [ "ready" , "gated" ] . includes ( selection . item . status ) ? < div className = "personal-drawer-action-grid" > < button className = "personal-secondary-action" onClick = { ( ) => void callbacks . onTransitionProposal ?.( selection . item , "defer" ) } type = "button" > { t ( "drawer.proposalDefer" ) } </ button > < button className = "personal-secondary-action" onClick = { ( ) => void callbacks . onTransitionProposal ?.( selection . item , "reject" ) } type = "button" > { t ( "drawer.decisionReject" ) } </ button > </ div > : null }
12741298 { ! [ "applied" , "applying" ] . includes ( selection . item . status ) ? < button className = "personal-secondary-action" onClick = { onClose } type = "button" > { t ( "drawer.proposalClose" ) } </ button > : null }
12751299 </ >
0 commit comments