feat(conversation-context-bar): show descriptive tooltips for folder and branch selectors
This commit is contained in:
@@ -64,6 +64,7 @@ export const ConversationContextBar = memo(function ConversationContextBar({
|
||||
folders={folders}
|
||||
currentFolderId={ownFolder.id}
|
||||
currentFolderName={ownFolder.name}
|
||||
title={`${t("folderTitle")}: ${ownFolder.name}`}
|
||||
editable={isNewConversation}
|
||||
onSelect={async (folderId) => {
|
||||
const target = folders.find((f) => f.id === folderId)
|
||||
@@ -87,6 +88,7 @@ export const ConversationContextBar = memo(function ConversationContextBar({
|
||||
folderId={ownFolder.id}
|
||||
folderPath={ownFolder.path}
|
||||
currentBranch={currentBranch}
|
||||
title={`${t("branchTitle")}: ${currentBranch ?? t("noBranch")}`}
|
||||
onCheckout={async (branchName) => {
|
||||
const taskId = `checkout-${ownFolder.id}-${Date.now()}`
|
||||
addTask(taskId, tBd("tasks.checkoutTo", { branchName }))
|
||||
@@ -117,6 +119,7 @@ interface FolderPickerProps {
|
||||
folders: { id: number; name: string; path: string }[]
|
||||
currentFolderId: number
|
||||
currentFolderName: string
|
||||
title: string
|
||||
editable: boolean
|
||||
onSelect: (folderId: number) => void | Promise<void>
|
||||
labelEmpty: string
|
||||
@@ -127,6 +130,7 @@ const FolderPicker = memo(function FolderPicker({
|
||||
folders,
|
||||
currentFolderId,
|
||||
currentFolderName,
|
||||
title,
|
||||
editable,
|
||||
onSelect,
|
||||
labelEmpty,
|
||||
@@ -138,7 +142,7 @@ const FolderPicker = memo(function FolderPicker({
|
||||
<Button
|
||||
variant="outline"
|
||||
size="xs"
|
||||
title={currentFolderName}
|
||||
title={title}
|
||||
className={cn(
|
||||
"min-w-0 bg-transparent",
|
||||
!editable && "cursor-default opacity-60 hover:bg-transparent"
|
||||
@@ -200,6 +204,7 @@ interface BranchPickerProps {
|
||||
folderId: number
|
||||
folderPath: string
|
||||
currentBranch: string | null
|
||||
title: string
|
||||
onCheckout: (branchName: string) => Promise<void>
|
||||
}
|
||||
|
||||
@@ -207,6 +212,7 @@ const BranchPicker = memo(function BranchPicker({
|
||||
folderId,
|
||||
folderPath,
|
||||
currentBranch,
|
||||
title,
|
||||
onCheckout,
|
||||
}: BranchPickerProps) {
|
||||
const t = useTranslations("Folder.conversationContextBar")
|
||||
@@ -240,7 +246,12 @@ const BranchPicker = memo(function BranchPicker({
|
||||
return (
|
||||
<Popover open={open} onOpenChange={setOpen}>
|
||||
<PopoverTrigger asChild>
|
||||
<Button variant="outline" size="xs" className="min-w-0 bg-transparent">
|
||||
<Button
|
||||
variant="outline"
|
||||
size="xs"
|
||||
title={title}
|
||||
className="min-w-0 bg-transparent"
|
||||
>
|
||||
<GitBranch className="size-3 shrink-0 text-muted-foreground" />
|
||||
<span className="max-w-[160px] truncate">
|
||||
{currentBranch ?? t("noBranch")}
|
||||
|
||||
@@ -1797,6 +1797,8 @@
|
||||
"noDiffData": "لا توجد بيانات diff"
|
||||
},
|
||||
"conversationContextBar": {
|
||||
"folderTitle": "مجلد العمل",
|
||||
"branchTitle": "فرع العمل",
|
||||
"searchFolder": "Search folder...",
|
||||
"searchBranch": "Search branch...",
|
||||
"noFolders": "No folders",
|
||||
|
||||
@@ -1797,6 +1797,8 @@
|
||||
"noDiffData": "Keine Diff-Daten"
|
||||
},
|
||||
"conversationContextBar": {
|
||||
"folderTitle": "Arbeitsordner",
|
||||
"branchTitle": "Arbeits-Branch",
|
||||
"searchFolder": "Search folder...",
|
||||
"searchBranch": "Search branch...",
|
||||
"noFolders": "No folders",
|
||||
|
||||
@@ -1797,6 +1797,8 @@
|
||||
"noDiffData": "No diff data"
|
||||
},
|
||||
"conversationContextBar": {
|
||||
"folderTitle": "Working folder",
|
||||
"branchTitle": "Working branch",
|
||||
"searchFolder": "Search folder...",
|
||||
"searchBranch": "Search branch...",
|
||||
"noFolders": "No folders",
|
||||
|
||||
@@ -1797,6 +1797,8 @@
|
||||
"noDiffData": "Sin datos de diff"
|
||||
},
|
||||
"conversationContextBar": {
|
||||
"folderTitle": "Carpeta de trabajo",
|
||||
"branchTitle": "Rama de trabajo",
|
||||
"searchFolder": "Search folder...",
|
||||
"searchBranch": "Search branch...",
|
||||
"noFolders": "No folders",
|
||||
|
||||
@@ -1797,6 +1797,8 @@
|
||||
"noDiffData": "Aucune donnée diff"
|
||||
},
|
||||
"conversationContextBar": {
|
||||
"folderTitle": "Dossier de travail",
|
||||
"branchTitle": "Branche de travail",
|
||||
"searchFolder": "Search folder...",
|
||||
"searchBranch": "Search branch...",
|
||||
"noFolders": "No folders",
|
||||
|
||||
@@ -1797,6 +1797,8 @@
|
||||
"noDiffData": "Diff データがありません"
|
||||
},
|
||||
"conversationContextBar": {
|
||||
"folderTitle": "作業フォルダ",
|
||||
"branchTitle": "作業ブランチ",
|
||||
"searchFolder": "Search folder...",
|
||||
"searchBranch": "Search branch...",
|
||||
"noFolders": "No folders",
|
||||
|
||||
@@ -1797,6 +1797,8 @@
|
||||
"noDiffData": "Diff 데이터 없음"
|
||||
},
|
||||
"conversationContextBar": {
|
||||
"folderTitle": "작업 폴더",
|
||||
"branchTitle": "작업 브랜치",
|
||||
"searchFolder": "Search folder...",
|
||||
"searchBranch": "Search branch...",
|
||||
"noFolders": "No folders",
|
||||
|
||||
@@ -1797,6 +1797,8 @@
|
||||
"noDiffData": "Sem dados de diff"
|
||||
},
|
||||
"conversationContextBar": {
|
||||
"folderTitle": "Pasta de trabalho",
|
||||
"branchTitle": "Branch de trabalho",
|
||||
"searchFolder": "Search folder...",
|
||||
"searchBranch": "Search branch...",
|
||||
"noFolders": "No folders",
|
||||
|
||||
@@ -1797,6 +1797,8 @@
|
||||
"noDiffData": "无差异数据"
|
||||
},
|
||||
"conversationContextBar": {
|
||||
"folderTitle": "工作文件夹",
|
||||
"branchTitle": "工作分支",
|
||||
"searchFolder": "搜索文件夹...",
|
||||
"searchBranch": "搜索分支...",
|
||||
"noFolders": "暂无文件夹",
|
||||
|
||||
@@ -1797,6 +1797,8 @@
|
||||
"noDiffData": "無差異資料"
|
||||
},
|
||||
"conversationContextBar": {
|
||||
"folderTitle": "工作資料夾",
|
||||
"branchTitle": "工作分支",
|
||||
"searchFolder": "Search folder...",
|
||||
"searchBranch": "Search branch...",
|
||||
"noFolders": "No folders",
|
||||
|
||||
Reference in New Issue
Block a user