From ffa0d1033a8247356e584a2c004f4c8207308026 Mon Sep 17 00:00:00 2001 From: liangfung Date: Fri, 22 Nov 2024 11:17:28 +0700 Subject: [PATCH 1/4] fix(ui): correct the display of Issue/Pull Request documentation --- .../components/assistant-message-section.tsx | 18 ++++++++--- .../components/message-markdown/index.tsx | 31 +++++++++++++------ ee/tabby-ui/components/ui/icons.tsx | 11 ++++++- 3 files changed, 46 insertions(+), 14 deletions(-) diff --git a/ee/tabby-ui/app/search/components/assistant-message-section.tsx b/ee/tabby-ui/app/search/components/assistant-message-section.tsx index 8eebaec4ff4..a39bf263998 100644 --- a/ee/tabby-ui/app/search/components/assistant-message-section.tsx +++ b/ee/tabby-ui/app/search/components/assistant-message-section.tsx @@ -38,8 +38,10 @@ import { IconBlocks, IconBug, IconChevronRight, + IconCircleCheck, IconCircleDot, IconEdit, + IconGitMerge, IconGitPullRequest, IconLayers, IconPlus, @@ -516,14 +518,22 @@ function SourceCardContent({
{isIssue && ( <> - - {source.closed ? 'Closed' : 'Not closed'} + {source.closed ? ( + + ) : ( + + )} + {source.closed ? 'Closed' : 'Open'} )} {isPR && ( <> - - {source.merged ? 'Merged' : 'Not merged'} + {source.merged ? ( + + ) : ( + + )} + {source.merged ? 'Merged' : 'Open'} )}
diff --git a/ee/tabby-ui/components/message-markdown/index.tsx b/ee/tabby-ui/components/message-markdown/index.tsx index 34a1ba978c0..3c971dfb54e 100644 --- a/ee/tabby-ui/components/message-markdown/index.tsx +++ b/ee/tabby-ui/components/message-markdown/index.tsx @@ -28,7 +28,12 @@ import { import { Mention } from '../mention-tag' import { Badge } from '../ui/badge' -import { IconCircleDot, IconGitPullRequest } from '../ui/icons' +import { + IconCircleCheck, + IconCircleDot, + IconGitMerge, + IconGitPullRequest +} from '../ui/icons' import { Skeleton } from '../ui/skeleton' type RelevantDocItem = { @@ -487,13 +492,17 @@ function IssueStateBadge({ closed }: { closed: boolean }) { return ( - - {closed ? 'Closed' : 'Not closed'} + {closed ? ( + + ) : ( + + )} + {closed ? 'Closed' : 'Open'} ) } @@ -502,13 +511,17 @@ function PRStateBadge({ merged }: { merged: boolean }) { return ( - - {merged ? 'Merged' : 'Not merged'} + {merged ? ( + + ) : ( + + )} + {merged ? 'Merged' : 'Open'} ) } diff --git a/ee/tabby-ui/components/ui/icons.tsx b/ee/tabby-ui/components/ui/icons.tsx index 10d0a4297bf..ea6fa7f77a3 100644 --- a/ee/tabby-ui/components/ui/icons.tsx +++ b/ee/tabby-ui/components/ui/icons.tsx @@ -23,6 +23,7 @@ import { FileText, Filter, GitFork, + GitMerge, GitPullRequest, Globe, Hash, @@ -1729,6 +1730,13 @@ function IconGitPullRequest({ return } +function IconGitMerge({ + className, + ...props +}: React.ComponentProps) { + return +} + export { IconEdit, IconNextChat, @@ -1839,5 +1847,6 @@ export { IconEyeOff, IconCircleDot, IconGitPullRequest, - IconCircleCheck + IconCircleCheck, + IconGitMerge } From e96556b0a6d3b886f37d078f175c454f22268d95 Mon Sep 17 00:00:00 2001 From: liangfung Date: Fri, 22 Nov 2024 11:25:24 +0700 Subject: [PATCH 2/4] update: icon --- .../app/search/components/assistant-message-section.tsx | 4 ++-- ee/tabby-ui/components/message-markdown/index.tsx | 4 ++-- ee/tabby-ui/components/ui/icons.tsx | 9 --------- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/ee/tabby-ui/app/search/components/assistant-message-section.tsx b/ee/tabby-ui/app/search/components/assistant-message-section.tsx index a39bf263998..099ed0213be 100644 --- a/ee/tabby-ui/app/search/components/assistant-message-section.tsx +++ b/ee/tabby-ui/app/search/components/assistant-message-section.tsx @@ -37,8 +37,8 @@ import { import { IconBlocks, IconBug, + IconCheckCircled, IconChevronRight, - IconCircleCheck, IconCircleDot, IconEdit, IconGitMerge, @@ -519,7 +519,7 @@ function SourceCardContent({ {isIssue && ( <> {source.closed ? ( - + ) : ( )} diff --git a/ee/tabby-ui/components/message-markdown/index.tsx b/ee/tabby-ui/components/message-markdown/index.tsx index 3c971dfb54e..e5d281ce163 100644 --- a/ee/tabby-ui/components/message-markdown/index.tsx +++ b/ee/tabby-ui/components/message-markdown/index.tsx @@ -29,7 +29,7 @@ import { import { Mention } from '../mention-tag' import { Badge } from '../ui/badge' import { - IconCircleCheck, + IconCheckCircled, IconCircleDot, IconGitMerge, IconGitPullRequest @@ -498,7 +498,7 @@ function IssueStateBadge({ closed }: { closed: boolean }) { })} > {closed ? ( - + ) : ( )} diff --git a/ee/tabby-ui/components/ui/icons.tsx b/ee/tabby-ui/components/ui/icons.tsx index ea6fa7f77a3..6a118e352a5 100644 --- a/ee/tabby-ui/components/ui/icons.tsx +++ b/ee/tabby-ui/components/ui/icons.tsx @@ -13,7 +13,6 @@ import { CaseSensitive, ChevronsDownUp, CircleAlert, - CircleCheck, CircleDot, CircleHelp, CirclePlay, @@ -1716,13 +1715,6 @@ function IconCircleDot({ return } -function IconCircleCheck({ - className, - ...props -}: React.ComponentProps) { - return -} - function IconGitPullRequest({ className, ...props @@ -1847,6 +1839,5 @@ export { IconEyeOff, IconCircleDot, IconGitPullRequest, - IconCircleCheck, IconGitMerge } From 380f45f03f1f7ef201fff8a84e6f234c5465fcb6 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Fri, 22 Nov 2024 04:26:56 +0000 Subject: [PATCH 3/4] [autofix.ci] apply automated fixes --- ee/tabby-ui/components/message-markdown/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ee/tabby-ui/components/message-markdown/index.tsx b/ee/tabby-ui/components/message-markdown/index.tsx index e5d281ce163..f3719717660 100644 --- a/ee/tabby-ui/components/message-markdown/index.tsx +++ b/ee/tabby-ui/components/message-markdown/index.tsx @@ -492,7 +492,7 @@ function IssueStateBadge({ closed }: { closed: boolean }) { return ( Date: Fri, 22 Nov 2024 12:56:46 +0700 Subject: [PATCH 4/4] update --- ee/tabby-ui/components/message-markdown/index.tsx | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/ee/tabby-ui/components/message-markdown/index.tsx b/ee/tabby-ui/components/message-markdown/index.tsx index f3719717660..4a8594a5ad0 100644 --- a/ee/tabby-ui/components/message-markdown/index.tsx +++ b/ee/tabby-ui/components/message-markdown/index.tsx @@ -491,11 +491,8 @@ export function SiteFavicon({ function IssueStateBadge({ closed }: { closed: boolean }) { return ( {closed ? ( @@ -510,11 +507,8 @@ function IssueStateBadge({ closed }: { closed: boolean }) { function PRStateBadge({ merged }: { merged: boolean }) { return ( {merged ? (