@@ -60,6 +60,11 @@ type DepositSourceSelectionProps = {
6060 repoEarningEstimateSats ?: number | null ;
6161 /** V48-Gate3-F17: previously anchored repositories, newest first. */
6262 repositoryAnchors ?: DepositRepositoryAnchor [ ] ;
63+ /**
64+ * When true (run detail / post-submit), freeze repository·branch·commit
65+ * selection — the configuration that produced the loaded run is read-only.
66+ */
67+ disabled ?: boolean ;
6368} ;
6469
6570async function readJsonResponse ( response : Response ) {
@@ -119,6 +124,7 @@ export default function DepositSourceSelection({
119124 buildRouteHref,
120125 repoEarningEstimateSats,
121126 repositoryAnchors = [ ] ,
127+ disabled = false ,
122128} : DepositSourceSelectionProps ) {
123129 const router = useRouter ( ) ;
124130 const searchParams = useSearchParams ( ) ;
@@ -564,8 +570,13 @@ export default function DepositSourceSelection({
564570
565571 return (
566572 < section
567- className = "border border-white/10 bg-white/[0.035] px-4 py-4"
573+ className = { `border border-white/10 bg-white/[0.035] px-4 py-4 ${
574+ disabled ? "opacity-80" : ""
575+ } `}
568576 aria-label = "Select deposit repository"
577+ data-testid = "deposit-source-selection"
578+ data-locked = { disabled ? "true" : "false" }
579+ aria-disabled = { disabled || undefined }
569580 >
570581 < div className = "flex flex-wrap items-start justify-between gap-3" >
571582 < div >
@@ -577,8 +588,9 @@ export default function DepositSourceSelection({
577588 < BitcodeInlineExplainer explainer = { DEPOSIT_SECTION_EXPLAINERS . repository } />
578589 </ h2 >
579590 < p className = "mt-2 max-w-3xl text-sm leading-6 text-neutral-400" >
580- One connected repository, branch, and commit form the source package
581- the rest of the Deposit reads.
591+ { disabled
592+ ? "Source package that produced this run — locked while reviewing run detail."
593+ : "One connected repository, branch, and commit form the source package the rest of the Deposit reads." }
582594 </ p >
583595 </ div >
584596 < div className = "flex items-center gap-2" >
@@ -596,7 +608,9 @@ export default function DepositSourceSelection({
596608 : null ,
597609 } ) ) }
598610 value = { null }
611+ disabled = { disabled }
599612 onSelect = { ( key ) => {
613+ if ( disabled ) return ;
600614 const anchor = repositoryAnchors . find ( ( entry ) => entry . id === key ) ;
601615 if ( ! anchor ) return ;
602616 updateSourceParams ( ( params ) => {
@@ -627,7 +641,7 @@ export default function DepositSourceSelection({
627641 < button
628642 type = "button"
629643 aria-label = "Anchor repository to the activity ledger"
630- disabled = { ! selectedRepository || isRecording }
644+ disabled = { disabled || ! selectedRepository || isRecording }
631645 onClick = { ( ) => {
632646 void handleAnchorRepository ( ) ;
633647 } }
@@ -682,7 +696,9 @@ export default function DepositSourceSelection({
682696 : null ,
683697 } ) ) }
684698 value = { provider }
699+ disabled = { disabled }
685700 onSelect = { ( key ) => {
701+ if ( disabled ) return ;
686702 const nextProvider = key ?? "github" ;
687703 updateSourceParams ( ( params ) => {
688704 params . set ( "provider" , nextProvider ) ;
@@ -702,6 +718,7 @@ export default function DepositSourceSelection({
702718 < SourceListRefreshButton
703719 ariaLabel = "Refresh provider connection"
704720 explainer = { DEPOSIT_SECTION_EXPLAINERS . refreshProviderConnection }
721+ disabled = { disabled }
705722 loading = { isLoadingConnection }
706723 onRefresh = { ( ) =>
707724 setConnectionRefreshNonce ( ( nonce ) => nonce + 1 )
@@ -730,7 +747,9 @@ export default function DepositSourceSelection({
730747 repositories = { repositories }
731748 loading = { isLoadingRepositories && repositories . length === 0 }
732749 value = { selectedRepository ?. fullName }
733- onSelect = { ( repository ) =>
750+ disabled = { disabled }
751+ onSelect = { ( repository ) => {
752+ if ( disabled ) return ;
734753 updateSourceParams ( ( params ) => {
735754 if ( repository ) {
736755 params . set ( "repo" , repository . fullName ) ;
@@ -741,8 +760,8 @@ export default function DepositSourceSelection({
741760 params . delete ( "sourceCommit" ) ;
742761 params . delete ( "branch" ) ;
743762 params . delete ( "commit" ) ;
744- } )
745- }
763+ } ) ;
764+ } }
746765 placeholder = {
747766 connectionStatus ?. connected
748767 ? "Select repository supply..."
@@ -756,7 +775,7 @@ export default function DepositSourceSelection({
756775 < SourceListRefreshButton
757776 ariaLabel = "Refresh repository inventory"
758777 explainer = { DEPOSIT_SECTION_EXPLAINERS . refreshRepositoryInventory }
759- disabled = { ! connectionStatus ?. connected }
778+ disabled = { disabled || ! connectionStatus ?. connected }
760779 loading = { isLoadingRepositories }
761780 onRefresh = { ( ) => {
762781 // Hard-refresh inventory next to the inventory select (resets
@@ -792,6 +811,7 @@ export default function DepositSourceSelection({
792811 aria-label = "Repository source branch"
793812 value = { selectedBranch || null }
794813 disabled = {
814+ disabled ||
795815 ! selectedRepository ||
796816 connectionNeedsReconnect ||
797817 ( ! isLoadingBranches && branches . length === 0 )
@@ -810,7 +830,8 @@ export default function DepositSourceSelection({
810830 ? "default"
811831 : null ,
812832 } ) ) }
813- onSelect = { ( branchName ) =>
833+ onSelect = { ( branchName ) => {
834+ if ( disabled ) return ;
814835 updateSourceParams ( ( params ) => {
815836 if ( selectedRepository )
816837 params . set ( "repo" , selectedRepository . fullName ) ;
@@ -819,15 +840,17 @@ export default function DepositSourceSelection({
819840 params . delete ( "sourceCommit" ) ;
820841 params . delete ( "branch" ) ;
821842 params . delete ( "commit" ) ;
822- } )
823- }
843+ } ) ;
844+ } }
824845 className = "h-9 border-white/10 bg-[rgba(10,15,30,0.88)] px-3 text-sm text-white hover:bg-[rgba(10,15,30,0.88)] focus:border-emerald-400/40"
825846 />
826847 </ div >
827848 < SourceListRefreshButton
828849 ariaLabel = "Refresh branches list"
829850 explainer = { DEPOSIT_SECTION_EXPLAINERS . refreshBranches }
830- disabled = { ! selectedRepository || connectionNeedsReconnect }
851+ disabled = {
852+ disabled || ! selectedRepository || connectionNeedsReconnect
853+ }
831854 loading = { isLoadingBranches }
832855 onRefresh = { ( ) => setBranchesRefreshNonce ( ( nonce ) => nonce + 1 ) }
833856 />
@@ -860,6 +883,7 @@ export default function DepositSourceSelection({
860883 : null
861884 }
862885 disabled = {
886+ disabled ||
863887 ! selectedBranch ||
864888 connectionNeedsReconnect ||
865889 ( ! isLoadingCommits && commits . length === 0 )
@@ -902,7 +926,8 @@ export default function DepositSourceSelection({
902926 searchText : `${ commit . sha } ${ commit . message } ` ,
903927 } ) ) ,
904928 ] }
905- onSelect = { ( commitKey ) =>
929+ onSelect = { ( commitKey ) => {
930+ if ( disabled ) return ;
906931 updateSourceParams ( ( params ) => {
907932 if ( selectedRepository )
908933 params . set ( "repo" , selectedRepository . fullName ) ;
@@ -915,15 +940,15 @@ export default function DepositSourceSelection({
915940 }
916941 params . delete ( "branch" ) ;
917942 params . delete ( "commit" ) ;
918- } )
919- }
943+ } ) ;
944+ } }
920945 className = "h-9 border-white/10 bg-[rgba(10,15,30,0.88)] px-3 text-sm text-white hover:bg-[rgba(10,15,30,0.88)] focus:border-emerald-400/40"
921946 />
922947 </ div >
923948 < SourceListRefreshButton
924949 ariaLabel = "Refresh commits list"
925950 explainer = { DEPOSIT_SECTION_EXPLAINERS . refreshLatestCommit }
926- disabled = { ! selectedBranch || connectionNeedsReconnect }
951+ disabled = { disabled || ! selectedBranch || connectionNeedsReconnect }
927952 loading = { isLoadingCommits }
928953 onRefresh = { ( ) => setCommitsRefreshNonce ( ( nonce ) => nonce + 1 ) }
929954 />
0 commit comments