@@ -87,51 +87,7 @@ def doctree_read(app: Sphinx, doctree: nodes.document):
87
87
if len (app .env .tocs [app .env .docname ][0 ]) == 1 :
88
88
app .env .tocs [app .env .docname ][0 ].append (updated_tocs )
89
89
else :
90
- # SAFE FIX: Check if the original structure has toctree nodes
91
- # If it does, leave it completely unchanged to preserve left navigation
92
- original_toc_item = app .env .tocs [app .env .docname ][0 ][1 ]
93
- has_toctree = False
94
-
95
- if hasattr (original_toc_item , 'children' ) and original_toc_item .children :
96
- for child in original_toc_item .children :
97
- if isinstance (child , addnodes .toctree ):
98
- has_toctree = True
99
- break
100
-
101
- if has_toctree :
102
- # Merge tab headings into the existing right-pane TOC while preserving
103
- # the original toctree (left navigation) structure.
104
- try :
105
- # Find the bullet list in the original toc item (holds section entries)
106
- original_bullets = None
107
- for child in getattr (original_toc_item , "children" , []) or []:
108
- if isinstance (child , nodes .bullet_list ):
109
- original_bullets = child
110
- break
111
-
112
- # Find the bullet list produced by our updated tab-aware TOC
113
- updated_bullets = None
114
- for child in getattr (updated_tocs , "children" , []) or []:
115
- if isinstance (child , nodes .bullet_list ):
116
- updated_bullets = child
117
- break
118
-
119
- # If we have tab headings to merge
120
- if updated_bullets is not None :
121
- if original_bullets is None :
122
- # No existing bullets: attach updated list directly
123
- original_toc_item .append (updated_bullets )
124
- else :
125
- # Append each new tab heading item to existing bullets
126
- for li in list (updated_bullets .children ):
127
- original_bullets .append (li )
128
- except Exception as e :
129
- logger .warning (
130
- f"{ LOG_PREFIX } doctree_read({ app .env .docname } ): failed merging tab headings into TOC: { e } "
131
- )
132
- else :
133
- # Only apply tab modifications if no toctree nodes are present
134
- app .env .tocs [app .env .docname ][0 ][1 ] = updated_tocs
90
+ app .env .tocs [app .env .docname ][0 ][1 ] = updated_tocs
135
91
136
92
137
93
def html_page_context (
0 commit comments