File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -89,13 +89,16 @@ const TreeNode: React.FC<{
8989 style = { { marginLeft : `${ ( level + 1 ) * 20 } px` } }
9090 >
9191 { /* Expand/collapse button */ }
92- { hasChildren && (
92+ { hasChildren ? (
9393 < button
9494 onClick = { onToggle }
9595 className = "mr-1 flex h-3 w-3 flex-shrink-0 items-center justify-center rounded text-xs text-secondary/70 hover:bg-secondary/10 hover:text-primary"
9696 >
9797 { isExpanded ? '−' : '+' }
9898 </ button >
99+ ) : (
100+ // Placeholder to keep alignment consistent for leaf nodes
101+ < span className = "mr-1 h-3 w-3 flex-shrink-0" />
99102 ) }
100103
101104 { /* Node content */ }
Original file line number Diff line number Diff line change @@ -74,12 +74,25 @@ export function processEcoDatabase(ecoDatabase: EcoDatabase): {
7474 // Create popular openings list
7575 const popularOpenings : PopularOpening [ ] = [ ]
7676
77+ const toSlug = ( text : string ) =>
78+ text
79+ . toLowerCase ( )
80+ . trim ( )
81+ . replace ( / [ ^ a - z 0 - 9 ] + / g, '-' )
82+ . replace ( / ( ^ - | - $ ) + / g, '' )
83+
7784 POPULAR_OPENING_IDS . forEach ( ( popularId ) => {
7885 // Find opening in all sections
79- const opening = allOpenings . find ( ( o ) => o . id === popularId . id )
86+ const opening = allOpenings . find (
87+ ( o ) => o . id === popularId . id || toSlug ( o . name ) === popularId . id ,
88+ )
8089 if ( opening ) {
8190 const variation = popularId . variationId
82- ? opening . variations . find ( ( v ) => v . id === popularId . variationId )
91+ ? opening . variations . find (
92+ ( v ) =>
93+ v . id === popularId . variationId ||
94+ toSlug ( v . name ) === popularId . variationId ,
95+ )
8396 : undefined
8497
8598 popularOpenings . push ( {
You can’t perform that action at this time.
0 commit comments