Skip to content

Commit 718d6b5

Browse files
fix: Add fallback message for preview display issues with tables and special formatting (#1173)
Co-authored-by: Pavan Kumar <v-kupavan.microsoft.com>
1 parent fd8619a commit 718d6b5

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

code/backend/batch/utilities/document_loading/word_document.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ def _download_document(self, document_url: str) -> BytesIO:
2424
return file
2525

2626
def _get_opening_tag(self, heading_level: int) -> str:
27-
return f"<{self.doc_headings_to_markdown_tags.get(f'{heading_level}', '')}>"
27+
return f"<{self.doc_headings_to_markdown_tags.get(f'{heading_level}', 'p')}>"
2828

2929
def _get_closing_tag(self, heading_level: int) -> str:
30-
return f"</{self.doc_headings_to_markdown_tags.get(f'{heading_level}', '')}>"
30+
return f"</{self.doc_headings_to_markdown_tags.get(f'{heading_level}', 'p')}>"
3131

3232
def load(self, document_url: str) -> List[SourceDocument]:
3333
output = ""

code/frontend/src/pages/chat/Chat.module.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,15 @@
249249
flex-grow: 0;
250250
}
251251

252+
.citationPanelDisclaimer {
253+
font-family: "Segoe UI";
254+
font-style: normal;
255+
font-weight: 400;
256+
font-size: 12px;
257+
display: flex;
258+
color: #707070;
259+
}
260+
252261
.citationPanelContent h1 {
253262

254263
line-height: 30px;
@@ -297,6 +306,13 @@
297306
}
298307
}
299308

309+
.mobileCitationPanelDisclaimer {
310+
@media screen and (max-width: 600px) {
311+
font-weight: 250;
312+
font-size: 10px;
313+
}
314+
}
315+
300316
@media screen and (max-width: 600px) {
301317
h1 {
302318
font-weight: 300;

code/frontend/src/pages/chat/Chat.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ const Chat = () => {
381381
/>
382382
</Stack>
383383
<h5 className={`${styles.citationPanelTitle} ${styles.mobileCitationPanelTitle}`}>{activeCitation[2]}</h5>
384+
<div className={`${styles.citationPanelDisclaimer} ${styles.mobileCitationPanelDisclaimer}`}>Tables, images, and other special formatting not shown in this preview. Please follow the link to review the original document.</div>
384385
<ReactMarkdown
385386
className={`${styles.citationPanelContent} ${styles.mobileCitationPanelContent}`}
386387
children={activeCitation[0]}

0 commit comments

Comments
 (0)