Spaces:
Sleeping
Sleeping
HsiehMinChieh Claude Opus 4.6 commited on
Commit ·
ebe764a
1
Parent(s): eb29020
Add empty state messages for main function list and flowchart
Browse filesWhen all functions are classified as UI/anonymous, show helpful
messages instead of blank content in the report and Mermaid tabs.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Files changed (2)
- app.py+4-1
- export_html.py+2-3
25 unmodified lines262728292930313233343525 unmodified lines md_content = exporter.render_markdown() ui_content = exporter.render_ui_markdown() mmd_content = exporter.render_mermaid() if exporter.main_funcs: mermaid_markdown = f"```mermaid\n{mmd_content}\n```" mermaid_markdown = f"```mermaid\n{mmd_content}\n```" else: mermaid_markdown = "*無主函式呼叫關係可顯示。*"
raw_html_report_path = generate_html_report(html_path, temp_dir, report=report_data) original_basename = os.path.splitext(os.path.basename(html_path))[0]138 unmodified lines1391401411421421431441454 unmodified lines150151152153154153154155156138 unmodified lines </div> </div> <h2>主函式詳細清單</h2> {_generate_func_cards_html(main_funcs, icons, main_caller_index)} {_generate_func_cards_html(main_funcs, icons, main_caller_index) if main_funcs else "<p><em>未偵測到主函式。所有函式皆歸類為常規腳本 (見「常規腳本」頁籤)。</em></p>"} </div>
<div id="tab-ui-scripts" class="tab-content">4 unmodified lines
<div id="tab-flowchart" class="tab-content"> <div class="mermaid-container"> <pre id="mermaid-graph" style="display: none;">\n{mermaid_str}\n</pre> <div id="mermaid-output"></div> {'<p><em>無主函式呼叫關係可顯示。</em></p>' if not main_funcs else f'<pre id="mermaid-graph" style="display: none;">\\n{mermaid_str}\\n</pre><div id="mermaid-output"></div>'} </div> </div> </div>app.py+4-1
export_html.py+2-3