+
{
const target = allFolders.find((f) => f.id === folderId)
@@ -122,7 +111,7 @@ export const ConversationContextBar = memo(function ConversationContextBar() {
const detail = isOpen
? target
: await addFolderToWorkspaceById(folderId)
- setTabFolder(activeTab.id, detail.id, detail.path)
+ setTabFolder(ownTab.id, detail.id, detail.path)
toast.success(t("toasts.folderChanged", { name: detail.name }))
} catch (err) {
console.error(
@@ -142,7 +131,7 @@ export const ConversationContextBar = memo(function ConversationContextBar() {
if (!result) return
const selected = Array.isArray(result) ? result[0] : result
const detail = await openFolder(selected)
- setTabFolder(activeTab.id, detail.id, detail.path)
+ setTabFolder(ownTab.id, detail.id, detail.path)
toast.success(t("toasts.folderChanged", { name: detail.name }))
}
} catch (err) {
@@ -155,20 +144,18 @@ export const ConversationContextBar = memo(function ConversationContextBar() {
labelSearch={t("searchFolder")}
/>
-
-
{
- const taskId = `checkout-${activeFolder.id}-${Date.now()}`
+ const taskId = `checkout-${ownFolder.id}-${Date.now()}`
addTask(taskId, tBd("tasks.checkoutTo", { branchName }))
updateTask(taskId, { status: "running" })
try {
- await gitCheckout(activeFolder.path, branchName)
- setBranch(activeFolder.id, branchName)
- await refreshFolder(activeFolder.id)
+ await gitCheckout(ownFolder.path, branchName)
+ setBranch(ownFolder.id, branchName)
+ await refreshFolder(ownFolder.id)
updateTask(taskId, { status: "completed" })
} catch (err) {
const msg = err instanceof Error ? err.message : String(err)
@@ -177,13 +164,13 @@ export const ConversationContextBar = memo(function ConversationContextBar() {
}
}}
onNewBranch={async (branchName, startPoint) => {
- const taskId = `new-branch-${activeFolder.id}-${Date.now()}`
+ const taskId = `new-branch-${ownFolder.id}-${Date.now()}`
addTask(taskId, tBd("tasks.newBranch", { name: branchName }))
updateTask(taskId, { status: "running" })
try {
- await gitNewBranch(activeFolder.path, branchName, startPoint)
- setBranch(activeFolder.id, branchName)
- await refreshFolder(activeFolder.id)
+ await gitNewBranch(ownFolder.path, branchName, startPoint)
+ setBranch(ownFolder.id, branchName)
+ await refreshFolder(ownFolder.id)
updateTask(taskId, { status: "completed" })
} catch (err) {
const msg = err instanceof Error ? err.message : String(err)
@@ -192,11 +179,11 @@ export const ConversationContextBar = memo(function ConversationContextBar() {
}
}}
onDeleteBranch={async (branchName) => {
- const taskId = `delete-branch-${activeFolder.id}-${Date.now()}`
+ const taskId = `delete-branch-${ownFolder.id}-${Date.now()}`
addTask(taskId, tBd("tasks.deleteBranch", { branchName }))
updateTask(taskId, { status: "running" })
try {
- await gitDeleteBranch(activeFolder.path, branchName, false)
+ await gitDeleteBranch(ownFolder.path, branchName, false)
updateTask(taskId, { status: "completed" })
} catch (err) {
const msg = err instanceof Error ? err.message : String(err)
@@ -205,13 +192,6 @@ export const ConversationContextBar = memo(function ConversationContextBar() {
}
}}
/>
-
-
-
-
)
@@ -250,19 +230,16 @@ const FolderPicker = memo(function FolderPicker({
const trigger = (
)
@@ -381,15 +358,15 @@ const BranchPicker = memo(function BranchPicker({
@@ -517,124 +494,3 @@ const BranchPicker = memo(function BranchPicker({
>
)
})
-
-// ============================================================================
-// GitActionButtons
-// ============================================================================
-
-interface GitActionButtonsProps {
- folderId: number
- currentBranch: string | null
-}
-
-const GitActionButtons = memo(function GitActionButtons({
- folderId,
- currentBranch,
-}: GitActionButtonsProps) {
- const t = useTranslations("Folder.conversationContextBar")
- const tBd = useTranslations("Folder.branchDropdown")
-
- const handleCommit = useCallback(async () => {
- try {
- await openCommitWindow(folderId)
- } catch (err) {
- console.error("[GitActions] commit failed:", err)
- toast.error(tBd("toasts.openCommitWindowFailed"))
- }
- }, [folderId, tBd])
-
- const handlePush = useCallback(async () => {
- try {
- await openPushWindow(folderId)
- } catch (err) {
- console.error("[GitActions] push failed:", err)
- toast.error(tBd("toasts.openPushWindowFailed"))
- }
- }, [folderId, tBd])
-
- const handleStash = useCallback(async () => {
- try {
- await openStashWindow(folderId)
- } catch (err) {
- console.error("[GitActions] stash failed:", err)
- toast.error(t("toasts.openStashFailed"))
- }
- }, [folderId, t])
-
- const handleMerge = useCallback(async () => {
- try {
- await openMergeWindow(folderId, "merge")
- } catch (err) {
- console.error("[GitActions] merge failed:", err)
- toast.error(t("toasts.openMergeFailed"))
- }
- }, [folderId, t])
-
- return (
-
-
-
-
-
- {tBd("openCommitWindow")}
-
-
-
-
-
-
- {tBd("pushCode")}
-
-
-
-
-
-
-
-
-
- {t("merge")}
-
-
-
- {tBd("stashChanges")}
-
-
-
-
- {tBd("openCommitWindow")}
-
-
-
- {tBd("pushCode")}
-
-
-
-
- )
-})
diff --git a/src/components/chat/message-input.tsx b/src/components/chat/message-input.tsx
index 5fba2b7..1c0cc6f 100644
--- a/src/components/chat/message-input.tsx
+++ b/src/components/chat/message-input.tsx
@@ -59,6 +59,7 @@ import {
type AttachFileToSessionDetail,
type AppendTextToSessionDetail,
} from "@/lib/session-attachment-events"
+import { ConversationContextBar } from "@/components/chat/conversation-context-bar"
import { ModeSelector } from "@/components/chat/mode-selector"
import { SessionConfigSelector } from "@/components/chat/session-config-selector"
import {
@@ -1919,6 +1920,7 @@ export function MessageInput({
className
)}
>
+
{(hasImageAttachments || hasResourceAttachments) && (
{hasImageAttachments && (