feat(conversation-context-bar): show descriptive tooltips for folder and branch selectors

This commit is contained in:
xintaofei
2026-04-23 15:21:18 +08:00
parent ba7f3c598b
commit 1dd40d0baf
11 changed files with 33 additions and 2 deletions

View File

@@ -64,6 +64,7 @@ export const ConversationContextBar = memo(function ConversationContextBar({
folders={folders} folders={folders}
currentFolderId={ownFolder.id} currentFolderId={ownFolder.id}
currentFolderName={ownFolder.name} currentFolderName={ownFolder.name}
title={`${t("folderTitle")}: ${ownFolder.name}`}
editable={isNewConversation} editable={isNewConversation}
onSelect={async (folderId) => { onSelect={async (folderId) => {
const target = folders.find((f) => f.id === folderId) const target = folders.find((f) => f.id === folderId)
@@ -87,6 +88,7 @@ export const ConversationContextBar = memo(function ConversationContextBar({
folderId={ownFolder.id} folderId={ownFolder.id}
folderPath={ownFolder.path} folderPath={ownFolder.path}
currentBranch={currentBranch} currentBranch={currentBranch}
title={`${t("branchTitle")}: ${currentBranch ?? t("noBranch")}`}
onCheckout={async (branchName) => { onCheckout={async (branchName) => {
const taskId = `checkout-${ownFolder.id}-${Date.now()}` const taskId = `checkout-${ownFolder.id}-${Date.now()}`
addTask(taskId, tBd("tasks.checkoutTo", { branchName })) addTask(taskId, tBd("tasks.checkoutTo", { branchName }))
@@ -117,6 +119,7 @@ interface FolderPickerProps {
folders: { id: number; name: string; path: string }[] folders: { id: number; name: string; path: string }[]
currentFolderId: number currentFolderId: number
currentFolderName: string currentFolderName: string
title: string
editable: boolean editable: boolean
onSelect: (folderId: number) => void | Promise<void> onSelect: (folderId: number) => void | Promise<void>
labelEmpty: string labelEmpty: string
@@ -127,6 +130,7 @@ const FolderPicker = memo(function FolderPicker({
folders, folders,
currentFolderId, currentFolderId,
currentFolderName, currentFolderName,
title,
editable, editable,
onSelect, onSelect,
labelEmpty, labelEmpty,
@@ -138,7 +142,7 @@ const FolderPicker = memo(function FolderPicker({
<Button <Button
variant="outline" variant="outline"
size="xs" size="xs"
title={currentFolderName} title={title}
className={cn( className={cn(
"min-w-0 bg-transparent", "min-w-0 bg-transparent",
!editable && "cursor-default opacity-60 hover:bg-transparent" !editable && "cursor-default opacity-60 hover:bg-transparent"
@@ -200,6 +204,7 @@ interface BranchPickerProps {
folderId: number folderId: number
folderPath: string folderPath: string
currentBranch: string | null currentBranch: string | null
title: string
onCheckout: (branchName: string) => Promise<void> onCheckout: (branchName: string) => Promise<void>
} }
@@ -207,6 +212,7 @@ const BranchPicker = memo(function BranchPicker({
folderId, folderId,
folderPath, folderPath,
currentBranch, currentBranch,
title,
onCheckout, onCheckout,
}: BranchPickerProps) { }: BranchPickerProps) {
const t = useTranslations("Folder.conversationContextBar") const t = useTranslations("Folder.conversationContextBar")
@@ -240,7 +246,12 @@ const BranchPicker = memo(function BranchPicker({
return ( return (
<Popover open={open} onOpenChange={setOpen}> <Popover open={open} onOpenChange={setOpen}>
<PopoverTrigger asChild> <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" /> <GitBranch className="size-3 shrink-0 text-muted-foreground" />
<span className="max-w-[160px] truncate"> <span className="max-w-[160px] truncate">
{currentBranch ?? t("noBranch")} {currentBranch ?? t("noBranch")}

View File

@@ -1797,6 +1797,8 @@
"noDiffData": "لا توجد بيانات diff" "noDiffData": "لا توجد بيانات diff"
}, },
"conversationContextBar": { "conversationContextBar": {
"folderTitle": "مجلد العمل",
"branchTitle": "فرع العمل",
"searchFolder": "Search folder...", "searchFolder": "Search folder...",
"searchBranch": "Search branch...", "searchBranch": "Search branch...",
"noFolders": "No folders", "noFolders": "No folders",

View File

@@ -1797,6 +1797,8 @@
"noDiffData": "Keine Diff-Daten" "noDiffData": "Keine Diff-Daten"
}, },
"conversationContextBar": { "conversationContextBar": {
"folderTitle": "Arbeitsordner",
"branchTitle": "Arbeits-Branch",
"searchFolder": "Search folder...", "searchFolder": "Search folder...",
"searchBranch": "Search branch...", "searchBranch": "Search branch...",
"noFolders": "No folders", "noFolders": "No folders",

View File

@@ -1797,6 +1797,8 @@
"noDiffData": "No diff data" "noDiffData": "No diff data"
}, },
"conversationContextBar": { "conversationContextBar": {
"folderTitle": "Working folder",
"branchTitle": "Working branch",
"searchFolder": "Search folder...", "searchFolder": "Search folder...",
"searchBranch": "Search branch...", "searchBranch": "Search branch...",
"noFolders": "No folders", "noFolders": "No folders",

View File

@@ -1797,6 +1797,8 @@
"noDiffData": "Sin datos de diff" "noDiffData": "Sin datos de diff"
}, },
"conversationContextBar": { "conversationContextBar": {
"folderTitle": "Carpeta de trabajo",
"branchTitle": "Rama de trabajo",
"searchFolder": "Search folder...", "searchFolder": "Search folder...",
"searchBranch": "Search branch...", "searchBranch": "Search branch...",
"noFolders": "No folders", "noFolders": "No folders",

View File

@@ -1797,6 +1797,8 @@
"noDiffData": "Aucune donnée diff" "noDiffData": "Aucune donnée diff"
}, },
"conversationContextBar": { "conversationContextBar": {
"folderTitle": "Dossier de travail",
"branchTitle": "Branche de travail",
"searchFolder": "Search folder...", "searchFolder": "Search folder...",
"searchBranch": "Search branch...", "searchBranch": "Search branch...",
"noFolders": "No folders", "noFolders": "No folders",

View File

@@ -1797,6 +1797,8 @@
"noDiffData": "Diff データがありません" "noDiffData": "Diff データがありません"
}, },
"conversationContextBar": { "conversationContextBar": {
"folderTitle": "作業フォルダ",
"branchTitle": "作業ブランチ",
"searchFolder": "Search folder...", "searchFolder": "Search folder...",
"searchBranch": "Search branch...", "searchBranch": "Search branch...",
"noFolders": "No folders", "noFolders": "No folders",

View File

@@ -1797,6 +1797,8 @@
"noDiffData": "Diff 데이터 없음" "noDiffData": "Diff 데이터 없음"
}, },
"conversationContextBar": { "conversationContextBar": {
"folderTitle": "작업 폴더",
"branchTitle": "작업 브랜치",
"searchFolder": "Search folder...", "searchFolder": "Search folder...",
"searchBranch": "Search branch...", "searchBranch": "Search branch...",
"noFolders": "No folders", "noFolders": "No folders",

View File

@@ -1797,6 +1797,8 @@
"noDiffData": "Sem dados de diff" "noDiffData": "Sem dados de diff"
}, },
"conversationContextBar": { "conversationContextBar": {
"folderTitle": "Pasta de trabalho",
"branchTitle": "Branch de trabalho",
"searchFolder": "Search folder...", "searchFolder": "Search folder...",
"searchBranch": "Search branch...", "searchBranch": "Search branch...",
"noFolders": "No folders", "noFolders": "No folders",

View File

@@ -1797,6 +1797,8 @@
"noDiffData": "无差异数据" "noDiffData": "无差异数据"
}, },
"conversationContextBar": { "conversationContextBar": {
"folderTitle": "工作文件夹",
"branchTitle": "工作分支",
"searchFolder": "搜索文件夹...", "searchFolder": "搜索文件夹...",
"searchBranch": "搜索分支...", "searchBranch": "搜索分支...",
"noFolders": "暂无文件夹", "noFolders": "暂无文件夹",

View File

@@ -1797,6 +1797,8 @@
"noDiffData": "無差異資料" "noDiffData": "無差異資料"
}, },
"conversationContextBar": { "conversationContextBar": {
"folderTitle": "工作資料夾",
"branchTitle": "工作分支",
"searchFolder": "Search folder...", "searchFolder": "Search folder...",
"searchBranch": "Search branch...", "searchBranch": "Search branch...",
"noFolders": "No folders", "noFolders": "No folders",