1818 margin-bottom : 30px ;
1919 }
2020 .table-container {
21- max-width : 1200 px ;
21+ max-width : 95 % ;
2222 margin : 0 auto;
2323 overflow-x : auto;
2424 box-shadow : 0 4px 6px rgba (0 , 0 , 0 , 0.1 );
@@ -95,7 +95,7 @@ <h1>Ground TruthReport</h1>
9595 < th > Pitfall / Warning Code</ th >
9696 < th > Description</ th >
9797 < th > Source File</ th >
98- < th > Automated </ th >
98+ < th > Commit ID </ th >
9999 </ tr >
100100 </ thead >
101101 </ table >
@@ -126,11 +126,11 @@ <h1>Ground TruthReport</h1>
126126 let isFirstContext = true ;
127127
128128 for ( const [ code , info ] of pEntries ) {
129- addRow ( tbody , url , code , info , 'p' , isFirstContext , totalRows ) ;
129+ addRow ( tbody , url , code , info , 'p' , isFirstContext , totalRows , repoData ) ;
130130 isFirstContext = false ;
131131 }
132132 for ( const [ code , info ] of wEntries ) {
133- addRow ( tbody , url , code , info , 'w' , isFirstContext , totalRows ) ;
133+ addRow ( tbody , url , code , info , 'w' , isFirstContext , totalRows , repoData ) ;
134134 isFirstContext = false ;
135135 }
136136
@@ -144,7 +144,7 @@ <h1>Ground TruthReport</h1>
144144 } ) ;
145145 } ) ;
146146
147- function addRow ( tbody , url , code , info , type , isFirstContext , totalRows ) {
147+ function addRow ( tbody , url , code , info , type , isFirstContext , totalRows , repoData ) {
148148 const tr = document . createElement ( 'tr' ) ;
149149
150150 if ( isFirstContext ) {
@@ -179,14 +179,30 @@ <h1>Ground TruthReport</h1>
179179 const tdSource = document . createElement ( 'td' ) ;
180180 tdSource . textContent = info . source_file || 'Unknown' ;
181181
182- // Automated Column
183- const tdAutomated = document . createElement ( 'td' ) ;
184- tdAutomated . textContent = 'Yes' ;
185-
186182 tr . appendChild ( tdCode ) ;
187183 tr . appendChild ( tdDesc ) ;
188184 tr . appendChild ( tdSource ) ;
189- tr . appendChild ( tdAutomated ) ;
185+
186+ if ( isFirstContext ) {
187+ const tdCommit = document . createElement ( 'td' ) ;
188+ tdCommit . style . whiteSpace = 'nowrap' ;
189+ const commitId = repoData [ 'commit ID' ] ;
190+ if ( commitId ) {
191+ const aCommit = document . createElement ( 'a' ) ;
192+ let cleanUrl = url . endsWith ( '/' ) ? url . slice ( 0 , - 1 ) : url ;
193+ let treePath = cleanUrl . includes ( 'gitlab' ) ? '/-/tree/' : '/tree/' ;
194+ aCommit . href = `${ cleanUrl } ${ treePath } ${ commitId } ` ;
195+ aCommit . textContent = commitId . substring ( 0 , 7 ) ;
196+ aCommit . className = 'repo-link' ;
197+ aCommit . style . wordBreak = 'normal' ;
198+ aCommit . target = '_blank' ;
199+ tdCommit . appendChild ( aCommit ) ;
200+ } else {
201+ tdCommit . textContent = 'Unknown' ;
202+ }
203+ tdCommit . rowSpan = totalRows ;
204+ tr . appendChild ( tdCommit ) ;
205+ }
190206
191207 tbody . appendChild ( tr ) ;
192208 }
0 commit comments