From ef67b9488296ac0c6add9c2cedbe7083345b159a Mon Sep 17 00:00:00 2001 From: anastasiia Date: Tue, 9 Jan 2024 07:02:49 -0500 Subject: [PATCH 1/2] translation fix, pull config on self-serve --- client/src/CloudApp.tsx | 5 +++++ client/src/locales/zh-CN.json | 4 ++-- client/src/pages/HomeTab/Content.tsx | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/client/src/CloudApp.tsx b/client/src/CloudApp.tsx index ce7d460644..f86d3d055f 100644 --- a/client/src/CloudApp.tsx +++ b/client/src/CloudApp.tsx @@ -18,6 +18,11 @@ const CloudApp = () => { (getPlainFromStorage(LANGUAGE_KEY) as LocaleType | null) || 'en', ); + useEffect(() => { + getConfig().then(setEnvConfig); + setTimeout(() => getConfig().then(setEnvConfig), 1000); + }, []); + const deviceContextValue = useMemo( () => ({ openFolderInExplorer: () => {}, diff --git a/client/src/locales/zh-CN.json b/client/src/locales/zh-CN.json index 4c3daca479..70ac141873 100644 --- a/client/src/locales/zh-CN.json +++ b/client/src/locales/zh-CN.json @@ -381,7 +381,7 @@ "Index": "指数", "Force index": "力索引", "bloop automatically excludes certain files from indexing. This file might be too big or it might have an excluded file type.": "Bloop自动将某些文件从索引中排除。 该文件可能太大,或者可能具有排除的文件类型。", - "What would you like to know about <2>#repo?": "你想了解<2>#repo的什么信息?", + "What would you like to know about <2>#repo?": "你想了解<2>{{repoName}}的什么信息?", "Hi, I'm bloop.": "你好,我是bloop。", "Done": "已完成", "Send a message": "发送消息", @@ -440,4 +440,4 @@ "Languages": "语言", "Generating answer...": "生成答案...", "Your subscription has expired. Please update your payment details to avoid being unsubscribed.": "您的订阅已过期。 请更新您的付款详细信息,以避免被取消订阅。" -} \ No newline at end of file +} diff --git a/client/src/pages/HomeTab/Content.tsx b/client/src/pages/HomeTab/Content.tsx index a7786dd396..4249f8273f 100644 --- a/client/src/pages/HomeTab/Content.tsx +++ b/client/src/pages/HomeTab/Content.tsx @@ -126,7 +126,7 @@ const HomePage = ({ randomKey }: { randomKey?: any }) => { )} -
+

Add From dd9fda12de12d28272e8d0b1ec5f24c982841885 Mon Sep 17 00:00:00 2001 From: anastasiia Date: Tue, 9 Jan 2024 07:28:06 -0500 Subject: [PATCH 2/2] fix line numbers in symbol search --- .../components/CodeBlock/Code/CodeContainer.tsx | 1 + client/src/components/CodeBlock/Code/CodeLine.tsx | 14 +++++++++----- client/src/components/CodeBlock/Search/index.tsx | 4 ++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/client/src/components/CodeBlock/Code/CodeContainer.tsx b/client/src/components/CodeBlock/Code/CodeContainer.tsx index a935d3aa6e..66b5271285 100644 --- a/client/src/components/CodeBlock/Code/CodeContainer.tsx +++ b/client/src/components/CodeBlock/Code/CodeContainer.tsx @@ -85,6 +85,7 @@ const CodeContainer = ({ } showLineNumbers={showLines} symbols={getSymbols(lineStart + lineNumber)} + isSymbolSearch={!!symbols?.length} lineHidden={ onlySymbolLines && !getSymbols(lineStart + lineNumber).length } diff --git a/client/src/components/CodeBlock/Code/CodeLine.tsx b/client/src/components/CodeBlock/Code/CodeLine.tsx index 5a96ccaf10..ceeed9dca5 100644 --- a/client/src/components/CodeBlock/Code/CodeLine.tsx +++ b/client/src/components/CodeBlock/Code/CodeLine.tsx @@ -41,6 +41,7 @@ type Props = { leftHighlight?: boolean; removePaddings?: boolean; hoveredBackground?: boolean; + isSymbolSearch?: boolean; }; const CodeLine = ({ @@ -66,6 +67,7 @@ const CodeLine = ({ removePaddings, hoveredBackground, lineNumbersDiff, + isSymbolSearch, }: Props) => { const codeRef = useRef(null); @@ -183,12 +185,14 @@ const CodeLine = ({ onMouseSelectEnd?.(lineNumber, index); }} > - {symbols?.length ? ( + {isSymbolSearch ? (
- {symbols.length > 1 ? ( + {symbols?.length && symbols.length > 1 ? ( @@ -207,11 +211,11 @@ const CodeLine = ({ > - ) : ( + ) : symbols?.length ? ( - )} + ) : null}
) : null} diff --git a/client/src/components/CodeBlock/Search/index.tsx b/client/src/components/CodeBlock/Search/index.tsx index dd1d4e38f8..3fab67a295 100644 --- a/client/src/components/CodeBlock/Search/index.tsx +++ b/client/src/components/CodeBlock/Search/index.tsx @@ -131,13 +131,13 @@ const CodeBlockSearch = ({
                       
-                          
+                          
- + ..