@@ -24,6 +24,8 @@ import * as tiny from "./tiny_mappings.js";
2424 const buildTargetElement = document . getElementById ( "build-target" ) ;
2525 const diffViewerElement = document . getElementById ( "diff-viewer" ) ;
2626
27+ const hideClassPath = document . getElementById ( "hide-class-path" ) ;
28+
2729 async function updateFeatherBuilds ( ) {
2830 if (
2931 possibleVersions . some ( ( version ) => versionSelectorInput . value === version )
@@ -83,7 +85,7 @@ import * as tiny from "./tiny_mappings.js";
8385 }
8486
8587 function diffMappings ( source , target ) {
86- printDiff ( diffMemberArray ( source . classes , target ) , "classes-diff" )
88+ printDiff ( diffMemberArray ( source . classes , target , hideClassPath . checked ) , "classes-diff" )
8789 printDiff ( diffMemberArray ( source . methods , target ) , "methods-diff" )
8890 printDiff ( diffMemberArray ( source . fields , target ) , "fields-diff" )
8991 }
@@ -92,16 +94,26 @@ import * as tiny from "./tiny_mappings.js";
9294 document . getElementById ( elementID ) . innerText = diff . map ( value => `${ value . source } -> ${ value . target } ` ) . join ( "\n" )
9395 }
9496
95- function diffMemberArray ( source , targetMappings ) {
97+ function diffMemberArray ( source , targetMappings , stripPath = false ) {
9698 let diff = [ ]
9799
98100 source . forEach ( source => {
99101 let target = targetMappings . find ( source . calamus )
100102
101103 if ( target !== undefined && source . feather !== target . feather ) {
104+ let sourceFeather = source . feather ;
105+ let targetFeather = target . feather ;
106+
107+ if ( stripPath ) {
108+ if ( sourceFeather . substring ( 0 , sourceFeather . lastIndexOf ( '/' ) ) === targetFeather . substring ( 0 , targetFeather . lastIndexOf ( '/' ) ) ) {
109+ sourceFeather = sourceFeather . split ( '/' ) . pop ( ) ;
110+ targetFeather = targetFeather . split ( '/' ) . pop ( ) ;
111+ }
112+ }
113+
102114 diff . push ( {
103- source : source . feather ,
104- target : target . feather
115+ source : sourceFeather ,
116+ target : targetFeather
105117 } )
106118 }
107119 } )
@@ -132,6 +144,10 @@ import * as tiny from "./tiny_mappings.js";
132144 async ( _ ) => await updateFeatherDiff ( ) ,
133145 ) ;
134146
147+ hideClassPath . addEventListener ( "change" , async ( _ ) => {
148+ await updateFeatherDiff ( ) ;
149+ } ) ;
150+
135151 function updateVersionList ( ) {
136152 const list = possibleVersions ;
137153 while ( versionListElement . firstChild )
0 commit comments