File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -190,9 +190,22 @@ function handleSubmit(event, showLoading = false) {
190
190
// Set plain text content for summary, tree, and content
191
191
document . getElementById ( 'result-summary' ) . value = data . summary || '' ;
192
192
document . getElementById ( 'directory-structure-content' ) . value = data . tree || '' ;
193
- document . getElementById ( 'directory-structure-pre' ) . textContent = data . tree || '' ;
194
193
document . getElementById ( 'result-content' ) . value = data . content || '' ;
195
194
195
+ // Populate directory structure lines as clickable <pre> elements
196
+ const dirPre = document . getElementById ( 'directory-structure-pre' ) ;
197
+ if ( dirPre && data . tree ) {
198
+ dirPre . innerHTML = '' ;
199
+ data . tree . split ( '\n' ) . forEach ( line => {
200
+ const pre = document . createElement ( 'pre' ) ;
201
+ pre . setAttribute ( 'name' , 'tree-line' ) ;
202
+ pre . className = 'cursor-pointer hover:line-through hover:text-gray-500' ;
203
+ pre . textContent = line ;
204
+ pre . onclick = function ( ) { toggleFile ( this ) ; } ;
205
+ dirPre . appendChild ( pre ) ;
206
+ } ) ;
207
+ }
208
+
196
209
// Scroll to results
197
210
resultsSection . scrollIntoView ( { behavior : 'smooth' , block : 'start' } ) ;
198
211
} )
You can’t perform that action at this time.
0 commit comments