Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Fix: Replace the red highlight at the top of the PDF document with yellow. (#15203)

balibabu0f92353bd99b
diff --git a/web/src/components/document-preview/index.module.less b/web/src/components/document-preview/index.module.less
deleted file mode 100644
index 8f456af5a9..0000000000
--- a/web/src/components/document-preview/index.module.less
+++ /dev/null
@@ -1,13 +0,0 @@
-.documentContainer {
- width: 100%;
- // height: calc(100vh - 284px);
- height: calc(100vh - 180px);
- position: relative;
- :global(.PdfHighlighter) {
- overflow-x: hidden;
- }
- :global(.Highlight--scrolledTo .Highlight__part) {
- overflow-x: hidden;
- background-color: rgba(255, 226, 143, 1);
- }
-}
diff --git a/web/src/components/document-preview/index.tsx b/web/src/components/document-preview/index.tsx
index 9e31111d30..37889833c8 100644
--- a/web/src/components/document-preview/index.tsx
+++ b/web/src/components/document-preview/index.tsx
@@ -15,13 +15,13 @@ type PreviewProps = {
className?: string;
url: string;
};
-const Preview = ({
+const DocumentPreview = function ({
fileType,
className,
highlights,
setWidthAndHeight,
url,
-}: PreviewProps & Partial<IProps>) => {
+}: PreviewProps & Partial<IProps>) {
return (
<>
{fileType === 'pdf' && highlights && setWidthAndHeight && (
@@ -91,4 +91,4 @@ const Preview = ({
</>
);
};
-export default memo(Preview);
+export default memo(DocumentPreview);
diff --git a/web/src/components/document-preview/pdf-preview.tsx b/web/src/components/document-preview/pdf-preview.tsx
index ae6699b5b8..7c48ea0325 100644
--- a/web/src/components/document-preview/pdf-preview.tsx
+++ b/web/src/components/document-preview/pdf-preview.tsx
@@ -112,8 +112,8 @@ const PdfPreview = ({
screenshot,
isScrolledTo,
) => {
- const isTextHighlight = !Boolean(
- highlight.content && highlight.content.image,
+ const isTextHighlight = !(
+ highlight.content && highlight.content.image
);
const component = isTextHighlight ? (
diff --git a/web/src/global.less b/web/src/global.less
index ddf5a1d893..4787072542 100644
--- a/web/src/global.less
+++ b/web/src/global.less
@@ -48,3 +48,7 @@ body,
::-webkit-scrollbar-thumb:hover {
background: #888;
}
+
+.Highlight--scrolledTo .Highlight__part {
+ background: #ffe28f !important;
+}