milwright commited on
Commit
82a120c
·
1 Parent(s): 9f42b50

Fix white bar issue in metadata display by removing expander and using direct HTML

Browse files
Files changed (1) hide show
  1. app.py +33 -29
app.py CHANGED
@@ -1161,35 +1161,39 @@ with main_tab1:
1161
  # Display Document Contents section
1162
  st.subheader("Document Contents")
1163
 
1164
- # Add Document Metadata section inside the content area
1165
- with st.expander("Document Metadata", expanded=True):
1166
- # Create a clean metadata container
1167
- st.markdown('<div class="metadata-container">', unsafe_allow_html=True)
1168
-
1169
- # Display file info
1170
- st.write(f"**File Name:** {result.get('file_name', uploaded_file.name)}")
1171
-
1172
- # Display info if only limited pages were processed
1173
- if 'limited_pages' in result:
1174
- st.info(f"Processed {result['limited_pages']['processed']} of {result['limited_pages']['total']} pages")
1175
-
1176
- # Display languages if available
1177
- if 'languages' in result:
1178
- languages = [lang for lang in result['languages'] if lang is not None]
1179
- if languages:
1180
- st.write(f"**Languages:** {', '.join(languages)}")
1181
-
1182
- # Display topics if available
1183
- if 'topics' in result and result['topics']:
1184
- st.write(f"**Topics:** {', '.join(result['topics'])}")
1185
-
1186
- # Processing time if available
1187
- if 'processing_time' in result:
1188
- proc_time = result['processing_time']
1189
- st.write(f"**Processing Time:** {proc_time:.1f}s")
1190
-
1191
- # Close the metadata container
1192
- st.markdown('</div>', unsafe_allow_html=True)
 
 
 
 
1193
 
1194
  # Start document content div with consistent styling class
1195
  st.markdown('<div class="document-content">', unsafe_allow_html=True)
 
1161
  # Display Document Contents section
1162
  st.subheader("Document Contents")
1163
 
1164
+ # Add Document Metadata section - use direct HTML instead of expander to avoid white bars
1165
+ st.markdown('<h3 style="margin-bottom:0; padding-bottom:0;">Document Metadata</h3>', unsafe_allow_html=True)
1166
+
1167
+ # Create metadata card with clean styling
1168
+ metadata_html = '<div class="metadata-card" style="background:#f8f9fa; border:1px solid #e0e0e0; border-radius:4px; padding:15px; margin-bottom:20px;">'
1169
+
1170
+ # File info
1171
+ metadata_html += f'<p><strong>File Name:</strong> {result.get("file_name", uploaded_file.name)}</p>'
1172
+
1173
+ # Info about limited pages
1174
+ if 'limited_pages' in result:
1175
+ metadata_html += f'<p style="background:#e1f5fe; padding:8px; border-radius:4px;"><strong>Pages:</strong> {result["limited_pages"]["processed"]} of {result["limited_pages"]["total"]} processed</p>'
1176
+
1177
+ # Languages
1178
+ if 'languages' in result:
1179
+ languages = [lang for lang in result['languages'] if lang is not None]
1180
+ if languages:
1181
+ metadata_html += f'<p><strong>Languages:</strong> {", ".join(languages)}</p>'
1182
+
1183
+ # Topics
1184
+ if 'topics' in result and result['topics']:
1185
+ metadata_html += f'<p><strong>Topics:</strong> {", ".join(result["topics"])}</p>'
1186
+
1187
+ # Processing time
1188
+ if 'processing_time' in result:
1189
+ proc_time = result['processing_time']
1190
+ metadata_html += f'<p><strong>Processing Time:</strong> {proc_time:.1f}s</p>'
1191
+
1192
+ # Close the metadata card
1193
+ metadata_html += '</div>'
1194
+
1195
+ # Render the metadata HTML
1196
+ st.markdown(metadata_html, unsafe_allow_html=True)
1197
 
1198
  # Start document content div with consistent styling class
1199
  st.markdown('<div class="document-content">', unsafe_allow_html=True)