Spaces:
Running
Running
Fix white bar issue in metadata display by removing expander and using direct HTML
Browse files
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
|
1165 |
-
|
1166 |
-
|
1167 |
-
|
1168 |
-
|
1169 |
-
|
1170 |
-
|
1171 |
-
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
1178 |
-
|
1179 |
-
|
1180 |
-
|
1181 |
-
|
1182 |
-
|
1183 |
-
|
1184 |
-
|
1185 |
-
|
1186 |
-
|
1187 |
-
|
1188 |
-
|
1189 |
-
|
1190 |
-
|
1191 |
-
|
1192 |
-
|
|
|
|
|
|
|
|
|
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)
|