bluenevus commited on
Commit
f79582d
·
1 Parent(s): 7073225

Update app.py via AI Editor

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -95,7 +95,7 @@ def markdown_table_to_df(md_table):
95
 
96
  def markdown_table_preview(md_text):
97
  if not md_text:
98
- return html.Div() # Always return a preview area, but empty if no text
99
  tables = extract_markdown_tables(md_text)
100
  if not tables:
101
  return html.Div()
@@ -547,8 +547,10 @@ def combined_callback(
547
  else:
548
  preview = markdown_narrative_preview(generated_doc)
549
  logging.info("Document preview updated.")
550
- return dash.no_update, dash.no_update, preview, "", generated_doc
 
551
 
 
552
  return files_display, new_shred, markdown_table_preview(new_shred), loading_msg, generated_doc
553
 
554
  @app.callback(
 
95
 
96
  def markdown_table_preview(md_text):
97
  if not md_text:
98
+ return html.Div()
99
  tables = extract_markdown_tables(md_text)
100
  if not tables:
101
  return html.Div()
 
547
  else:
548
  preview = markdown_narrative_preview(generated_doc)
549
  logging.info("Document preview updated.")
550
+ # Always update document-preview, even if file-list/store-shred do not change
551
+ return files_display, new_shred, preview, "", generated_doc
552
 
553
+ # Always show preview for current shred if nothing else triggered
554
  return files_display, new_shred, markdown_table_preview(new_shred), loading_msg, generated_doc
555
 
556
  @app.callback(