Skip to content
This repository has been archived by the owner on Jan 2, 2025. It is now read-only.

Commit

Permalink
UI fixes (#1197)
Browse files Browse the repository at this point in the history
* translation fix, pull config on self-serve

* fix line numbers in symbol search
  • Loading branch information
anastasiya1155 authored Jan 9, 2024
1 parent 1998fff commit a5e4e77
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 10 deletions.
5 changes: 5 additions & 0 deletions client/src/CloudApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: () => {},
Expand Down
1 change: 1 addition & 0 deletions client/src/components/CodeBlock/Code/CodeContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ const CodeContainer = ({
}
showLineNumbers={showLines}
symbols={getSymbols(lineStart + lineNumber)}
isSymbolSearch={!!symbols?.length}
lineHidden={
onlySymbolLines && !getSymbols(lineStart + lineNumber).length
}
Expand Down
14 changes: 9 additions & 5 deletions client/src/components/CodeBlock/Code/CodeLine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ type Props = {
leftHighlight?: boolean;
removePaddings?: boolean;
hoveredBackground?: boolean;
isSymbolSearch?: boolean;
};

const CodeLine = ({
Expand All @@ -66,6 +67,7 @@ const CodeLine = ({
removePaddings,
hoveredBackground,
lineNumbersDiff,
isSymbolSearch,
}: Props) => {
const codeRef = useRef<HTMLTableCellElement>(null);

Expand Down Expand Up @@ -183,12 +185,14 @@ const CodeLine = ({
onMouseSelectEnd?.(lineNumber, index);
}}
>
{symbols?.length ? (
{isSymbolSearch ? (
<div
className={`peer text-center text-purple ${lineHidden ? 'p-0' : ''}`}
className={`peer text-center text-purple ${
lineHidden ? 'p-0' : ''
} min-w-[20px]`}
>
<span className="flex flex-row gap-1">
{symbols.length > 1 ? (
{symbols?.length && symbols.length > 1 ? (
<Tooltip
text={
<div>
Expand All @@ -207,11 +211,11 @@ const CodeLine = ({
>
<SymbolIcon type="multiple" />
</Tooltip>
) : (
) : symbols?.length ? (
<Tooltip text={symbols[0]} placement="top">
<SymbolIcon type={symbols[0]} />
</Tooltip>
)}
) : null}
</span>
</div>
) : null}
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/CodeBlock/Search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,13 @@ const CodeBlockSearch = ({
<pre className={`bg-bg-sub my-0 px-2`}>
<table>
<tbody>
<tr className="token-line">
<tr className="token-line border-l-[3px] border-transparent">
<td
className={`${
snippet.symbols?.length ? 'w-5' : 'w-0 px-1'
} text-center`}
/>
<td className="text-label-muted min-w-6 text-right text-l select-none">
<td className="text-label-muted min-w-[27px] text-right text-l select-none">
..
</td>
</tr>
Expand Down
4 changes: 2 additions & 2 deletions client/src/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -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>?": "你想了解<2>#repo</2>的什么信息?",
"What would you like to know about <2>#repo</2>?": "你想了解<2>{{repoName}}</2>的什么信息?",
"Hi, I'm bloop.": "你好,我是bloop。",
"Done": "已完成",
"Send a message": "发送消息",
Expand Down Expand Up @@ -440,4 +440,4 @@
"Languages": "语言",
"Generating answer...": "生成答案...",
"Your subscription has expired. Please update your payment details to avoid being unsubscribed.": "您的订阅已过期。 请更新您的付款详细信息,以避免被取消订阅。"
}
}
2 changes: 1 addition & 1 deletion client/src/pages/HomeTab/Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const HomePage = ({ randomKey }: { randomKey?: any }) => {
</Trans>
</div>
)}
<div className="w-full flex flex-col mx-auto max-w-6.5xl">
<div className="w-full flex flex-col mx-auto max-w-6.5xl overflow-auto">
<div className="p-8 pb-0">
<h4 className="mb-3">
<Trans>Add</Trans>
Expand Down

0 comments on commit a5e4e77

Please sign in to comment.