@@ -88,30 +88,56 @@ export const renderReleaseVisualization = ({
8888 . data ( releaseTopFolderPaths )
8989 . enter ( )
9090 . append ( "text" )
91- . attr ( "class" , "folder-label clickable" )
91+ . attr ( "class" , ( folderPath : string ) => {
92+ const isFile = folderPath . includes ( "." ) ;
93+ return isFile ? "folder-label" : "folder-label clickable" ;
94+ } )
9295 . attr ( "x" , DIMENSIONS . width - DIMENSIONS . margin . right + 10 )
9396 . attr ( "y" , ( folderPath : string ) => ( yScale ( folderPath ) || 0 ) + yScale . bandwidth ( ) / 2 )
9497 . attr ( "text-anchor" , "start" )
9598 . attr ( "dominant-baseline" , "middle" )
9699 . text ( ( folderPath : string ) => {
97100 if ( folderPath === "." ) return "root" ;
98101 const fileName = folderPath . includes ( "/" ) ? folderPath . split ( "/" ) . pop ( ) : folderPath ;
99- return fileName && fileName . length > 15 ? `${ fileName . substring ( 0 , 12 ) } ...` : fileName || "unknown" ;
102+ return fileName && fileName . length > 15 ? `${ fileName . substring ( 0 , 15 ) } ...` : fileName || "unknown" ;
100103 } )
101104 . style ( "font-size" , "12px" )
102105 . style ( "fill" , "#b4bac6" )
103106 . style ( "font-weight" , "500" )
104- . style ( "cursor" , "pointer" )
107+ . style ( "cursor" , ( folderPath : string ) => {
108+ const isFile = folderPath . includes ( "." ) ;
109+ return isFile ? "default" : "pointer" ;
110+ } )
105111 . on ( "click" , ( _event : MouseEvent , folderPath : string ) => {
106- if ( folderPath !== "." ) {
112+ const isFile = folderPath . includes ( "." ) ;
113+ if ( ! isFile && folderPath !== "." ) {
107114 onFolderClick ( folderPath ) ;
108115 }
109116 } )
110- . on ( "mouseover" , function ( ) {
111- d3 . select ( this ) . style ( "fill" , "#e06091" ) ;
117+ . on ( "mouseover" , function ( _event : MouseEvent , folderPath : string ) {
118+ const isFile = folderPath . includes ( "." ) ;
119+ if ( ! isFile ) {
120+ d3 . select ( this ) . style ( "fill" , "#e06091" ) ;
121+ }
112122 } )
113- . on ( "mouseout" , function ( ) {
114- d3 . select ( this ) . style ( "fill" , "#b4bac6" ) ;
123+ . on ( "mouseout" , function ( _event : MouseEvent , folderPath : string ) {
124+ const isFile = folderPath . includes ( "." ) ;
125+ const element = d3 . select ( this ) ;
126+ if ( ! isFile ) {
127+ element . style ( "fill" , "#b4bac6" ) ;
128+ }
129+ // 호버 끝나면 축약된 텍스트로 복원
130+ const fileName = folderPath . includes ( "/" ) ? folderPath . split ( "/" ) . pop ( ) : folderPath ;
131+ const displayName = fileName && fileName . length > 15 ? `${ fileName . substring ( 0 , 15 ) } ...` : fileName || "unknown" ;
132+ element . text ( folderPath === "." ? "root" : displayName ) ;
133+ } ) ;
134+
135+ // 호버 시 전체 이름 표시를 위한 추가 이벤트
136+ mainGroup
137+ . selectAll < SVGTextElement , string > ( ".folder-label" )
138+ . on ( "mouseover.showfull" , function ( _event , folderPath ) {
139+ const fileName = folderPath . includes ( "/" ) ? folderPath . split ( "/" ) . pop ( ) : folderPath ;
140+ d3 . select ( this ) . text ( folderPath === "." ? "root" : fileName || "unknown" ) ;
115141 } ) ;
116142
117143 // 릴리즈 축
0 commit comments