Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/renderer/src/components/NewThreadMock.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
</div>

<!-- Heading -->
<h1 class="text-3xl font-semibold text-foreground mb-4">Build and explore</h1>
<h1 class="text-3xl font-semibold text-foreground mb-4">
{{ t('chat.newThread.title') }}
</h1>

<!-- Project selector -->
<DropdownMenu>
Expand All @@ -25,7 +27,7 @@
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="center" class="min-w-[200px]">
<DropdownMenuLabel class="text-xs">Recent Projects</DropdownMenuLabel>
<DropdownMenuLabel class="text-xs">{{ t('common.project.recent') }}</DropdownMenuLabel>
<DropdownMenuItem
v-for="project in recentProjects"
:key="project.path"
Expand All @@ -41,7 +43,7 @@
<DropdownMenuSeparator />
<DropdownMenuItem class="gap-2 text-xs py-1.5 px-2" @click="selectCustomProject">
<Icon icon="lucide:folder-open" class="w-3.5 h-3.5 text-muted-foreground" />
<span>Open folder...</span>
<span>{{ t('common.project.openFolder') }}</span>
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
Expand All @@ -62,6 +64,7 @@

<script setup lang="ts">
import { ref } from 'vue'
import { useI18n } from 'vue-i18n'
import { TooltipProvider } from '@shadcn/components/ui/tooltip'
import { Button } from '@shadcn/components/ui/button'
import {
Expand All @@ -77,6 +80,8 @@ import MockInputBox from './mock/MockInputBox.vue'
import MockInputToolbar from './mock/MockInputToolbar.vue'
import MockStatusBar from './mock/MockStatusBar.vue'

const { t } = useI18n()

const recentProjects = [
{ name: 'deepchat', path: '~/Code/deepchat' },
{ name: 'api-server', path: '~/Code/api-server' },
Expand Down
25 changes: 17 additions & 8 deletions src/renderer/src/components/WindowSideBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<Icon icon="lucide:layers" class="w-4 h-4 text-foreground/80" />
</Button>
</TooltipTrigger>
<TooltipContent side="right">All Agents</TooltipContent>
<TooltipContent side="right">{{ t('chat.sidebar.allAgents') }}</TooltipContent>
</Tooltip>

<div class="w-5 h-px bg-border my-1"></div>
Expand Down Expand Up @@ -65,7 +65,7 @@
</Button>
</TooltipTrigger>
<TooltipContent side="right">{{
collapsed ? 'Expand sidebar' : 'Collapse sidebar'
collapsed ? t('chat.sidebar.expandSidebar') : t('chat.sidebar.collapseSidebar')
}}</TooltipContent>
</Tooltip>

Expand All @@ -88,7 +88,7 @@
<!-- Header -->
<div class="flex items-center justify-between px-3 h-10 shrink-0">
<span class="text-sm font-medium text-foreground truncate">
{{ agentStore.selectedAgentName }}
{{ selectedAgentName }}
</span>
<div class="flex items-center gap-0.5">
<Tooltip>
Expand All @@ -106,7 +106,9 @@
</button>
</TooltipTrigger>
<TooltipContent>{{
sessionStore.groupMode === 'project' ? 'Group by date' : 'Group by project'
sessionStore.groupMode === 'project'
? t('chat.sidebar.groupByDate')
: t('chat.sidebar.groupByProject')
}}</TooltipContent>
</Tooltip>
<Tooltip>
Expand All @@ -118,7 +120,7 @@
<Icon icon="lucide:plus" class="w-4 h-4" />
</button>
</TooltipTrigger>
<TooltipContent>New Chat</TooltipContent>
<TooltipContent>{{ t('common.newChat') }}</TooltipContent>
</Tooltip>
</div>
</div>
Expand Down Expand Up @@ -157,13 +159,17 @@
class="flex flex-col items-center justify-center h-full px-4 text-center"
>
<Icon icon="lucide:message-square-plus" class="w-8 h-8 text-muted-foreground/40 mb-3" />
<p class="text-sm text-muted-foreground/60">No conversations yet</p>
<p class="text-xs text-muted-foreground/40 mt-1">Start a new chat to begin</p>
<p class="text-sm text-muted-foreground/60">{{ t('chat.sidebar.emptyTitle') }}</p>
<p class="text-xs text-muted-foreground/40 mt-1">
{{ t('chat.sidebar.emptyDescription') }}
</p>
</div>

<template v-for="group in filteredGroups" :key="group.label">
<div class="px-1.5 pt-3 pb-1">
<span class="text-xs font-medium text-muted-foreground">{{ group.label }}</span>
<span class="text-xs font-medium text-muted-foreground">{{
group.labelKey ? t(group.labelKey) : group.label
}}</span>
</div>
<button
v-for="session in group.sessions"
Expand Down Expand Up @@ -220,6 +226,9 @@ const sessionStore = useSessionStore()
const collapsed = ref(false)
let agentSwitchSeq = 0
let agentSwitchQueue: Promise<void> = Promise.resolve()
const selectedAgentName = computed(
() => agentStore.selectedAgent?.name ?? t('chat.sidebar.allAgents')
)

const pinnedSessions = computed(() => sessionStore.getPinnedSessions(agentStore.selectedAgentId))
const filteredGroups = computed(() => sessionStore.getFilteredGroups(agentStore.selectedAgentId))
Expand Down
9 changes: 7 additions & 2 deletions src/renderer/src/components/chat/ChatInputBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const props = withDefaults(
}>(),
{
modelValue: '',
placeholder: 'Ask DeepChat anything, @ to mention files, / for commands',
placeholder: '',
sessionId: null,
workspacePath: null,
isAcpSession: false,
Expand All @@ -127,6 +127,7 @@ const emit = defineEmits<{
const isComposing = ref(false)
const fileInput = ref<HTMLInputElement>()
const { t } = useI18n()
const resolvedPlaceholder = computed(() => props.placeholder?.trim() || t('chat.input.placeholder'))
let editorInstance: Editor | null = null
const getEditor = () => editorInstance
const conversationId = computed(() => props.sessionId)
Expand Down Expand Up @@ -204,7 +205,7 @@ const editor = new VueEditor({
deleteTriggerWithBackspace: true
}),
Placeholder.configure({
placeholder: props.placeholder
placeholder: () => resolvedPlaceholder.value
}),
HardBreak.extend({
addKeyboardShortcuts() {
Expand Down Expand Up @@ -250,6 +251,10 @@ watch(
{ deep: true, immediate: true }
)

watch(resolvedPlaceholder, () => {
editor.view.updateState(editor.state)
})

watch(
() => [...skillsData.pendingSkills.value],
(pendingSkills) => {
Expand Down
10 changes: 6 additions & 4 deletions src/renderer/src/components/chat/ChatStatusBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@
:disabled="permissionMode === 'full_access'"
@click="selectPermissionMode('full_access')"
>
Full access
{{ t('chat.permissionMode.fullAccess') }}
</DropdownMenuItem>
<DropdownMenuItem
class="text-xs py-1.5 px-2"
:disabled="permissionMode === 'default'"
@click="selectPermissionMode('default')"
>
Default permissions
{{ t('chat.permissionMode.default') }}
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
Expand All @@ -127,7 +127,7 @@
:disabled="true"
>
<Icon icon="lucide:shield" class="w-3.5 h-3.5" />
<span>Full access</span>
<span>{{ t('chat.permissionMode.fullAccess') }}</span>
</Button>
</div>
</div>
Expand Down Expand Up @@ -1136,7 +1136,9 @@ const currentEffortLabel = computed(() => {
})

const permissionModeLabel = computed(() =>
permissionMode.value === 'default' ? 'Default permissions' : 'Full access'
permissionMode.value === 'default'
? t('chat.permissionMode.default')
: t('chat.permissionMode.fullAccess')
)

const handleDocumentMouseDown = (event: MouseEvent) => {
Expand Down
5 changes: 4 additions & 1 deletion src/renderer/src/components/mock/MockInputBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class="w-full max-w-2xl rounded-xl border bg-card/30 backdrop-blur-lg shadow-sm overflow-hidden"
>
<Textarea
placeholder="Ask DeepChat anything, @ to mention files, / for commands"
:placeholder="t('chat.input.placeholder')"
class="min-h-[80px] resize-none border-0 shadow-none focus-visible:ring-0 focus-visible:border-0 bg-transparent! dark:bg-transparent placeholder:text-muted-foreground px-4 pt-4 pb-2 text-sm"
:model-value="''"
/>
Expand All @@ -14,4 +14,7 @@

<script setup lang="ts">
import { Textarea } from '@shadcn/components/ui/textarea'
import { useI18n } from 'vue-i18n'

const { t } = useI18n()
</script>
12 changes: 9 additions & 3 deletions src/renderer/src/components/mock/MockStatusBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,18 @@
class="h-6 px-2 gap-1.5 text-xs text-muted-foreground hover:text-foreground backdrop-blur-lg"
>
<Icon icon="lucide:shield" class="w-3.5 h-3.5" />
<span>Default permissions</span>
<span>{{ t('chat.permissionMode.default') }}</span>
<Icon icon="lucide:chevron-down" class="w-3 h-3" />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end" class="min-w-0">
<DropdownMenuItem class="text-xs py-1.5 px-2">Default permissions</DropdownMenuItem>
<DropdownMenuItem class="text-xs py-1.5 px-2">{{
t('chat.permissionMode.default')
}}</DropdownMenuItem>
<DropdownMenuItem class="text-xs py-1.5 px-2">Restricted</DropdownMenuItem>
<DropdownMenuItem class="text-xs py-1.5 px-2">Full access</DropdownMenuItem>
<DropdownMenuItem class="text-xs py-1.5 px-2">{{
t('chat.permissionMode.fullAccess')
}}</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
</div>
Expand All @@ -91,8 +95,10 @@ import {
DropdownMenuTrigger
} from '@shadcn/components/ui/dropdown-menu'
import { Icon } from '@iconify/vue'
import { useI18n } from 'vue-i18n'
import ModelIcon from '../icons/ModelIcon.vue'
import { useThemeStore } from '@/stores/theme'

const themeStore = useThemeStore()
const { t } = useI18n()
</script>
18 changes: 17 additions & 1 deletion src/renderer/src/i18n/da-DK/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"historyPlaceholder": "(Udfyld med Tab)",
"inputArea": "Indtastningsområde",
"pasteFiles": "Understøtter kopiering og indsættelse af filer",
"placeholder": "Spørg om noget? Du kan referere til værktøjer, filer, ressourcer osv. ved at bruge {'@'}.",
"placeholder": "Spørg DeepChat om hvad som helst, @ for at nævne filer, / for kommandoer",
"promptFilesAdded": "Prompt-filen er blevet tilføjet",
"promptFilesAddedDesc": "{count} filer er blevet tilføjet successfully",
"promptFilesError": "Filbehandlingsfejl",
Expand Down Expand Up @@ -210,5 +210,21 @@
"compaction": {
"compacting": "Komprimerer automatisk kontekst...",
"compacted": "Konteksten blev automatisk komprimeret"
},
"newThread": {
"title": "Byg og udforsk"
},
"permissionMode": {
"default": "Standardtilladelser",
"fullAccess": "Fuld adgang"
},
"sidebar": {
"allAgents": "Alle agenter",
"expandSidebar": "Udvid sidepanelet",
"collapseSidebar": "Skjul sidepanelet",
"groupByDate": "Gruppér efter dato",
"groupByProject": "Gruppér efter projekt",
"emptyTitle": "Ingen samtaler endnu",
"emptyDescription": "Start en ny samtale for at komme i gang"
}
}
12 changes: 12 additions & 0 deletions src/renderer/src/i18n/da-DK/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,17 @@
},
"size": {
"bytes": "{count} byte"
},
"time": {
"today": "I dag",
"yesterday": "I går",
"lastWeek": "Sidste uge",
"older": "Ældre"
},
"project": {
"select": "Vælg projekt",
"none": "Intet projekt",
"recent": "Seneste projekter",
"openFolder": "Åbn mappe..."
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
}
2 changes: 0 additions & 2 deletions src/renderer/src/i18n/da-DK/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import artifacts from './artifacts.json'
import sync from './sync.json'
import toolCall from './toolCall.json'
import components from './components.json'
import newThread from './newThread.json'
import about from './about.json'
import contextMenu from './contextMenu.json'
import promptSetting from './promptSetting.json'
Expand Down Expand Up @@ -48,7 +47,6 @@ export default {
sync,
toolCall,
components,
newThread,
about,
contextMenu,
promptSetting,
Expand Down
4 changes: 0 additions & 4 deletions src/renderer/src/i18n/da-DK/newThread.json

This file was deleted.

18 changes: 17 additions & 1 deletion src/renderer/src/i18n/en-US/chat.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"input": {
"placeholder": "Ask something? You can quote tools, files, resources via {'@'}...",
"placeholder": "Ask DeepChat anything, @ to mention files, / for commands",
"fileArea": "File Area",
"inputArea": "Input Area",
"functionSwitch": "Function Switch",
Expand Down Expand Up @@ -210,5 +210,21 @@
"aborted": "Aborted"
}
}
},
"newThread": {
"title": "Build and explore"
},
"permissionMode": {
"default": "Default permissions",
"fullAccess": "Full access"
},
"sidebar": {
"allAgents": "All Agents",
"expandSidebar": "Expand sidebar",
"collapseSidebar": "Collapse sidebar",
"groupByDate": "Group by date",
"groupByProject": "Group by project",
"emptyTitle": "No conversations yet",
"emptyDescription": "Start a new chat to begin"
}
}
12 changes: 12 additions & 0 deletions src/renderer/src/i18n/en-US/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,17 @@
},
"size": {
"bytes": "{count} bytes"
},
"time": {
"today": "Today",
"yesterday": "Yesterday",
"lastWeek": "Last week",
"older": "Older"
},
"project": {
"select": "Select project",
"none": "No project",
"recent": "Recent projects",
"openFolder": "Open folder..."
}
}
2 changes: 0 additions & 2 deletions src/renderer/src/i18n/en-US/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import artifacts from './artifacts.json'
import sync from './sync.json'
import toolCall from './toolCall.json'
import components from './components.json'
import newThread from './newThread.json'
import about from './about.json'
import contextMenu from './contextMenu.json'
import promptSetting from './promptSetting.json'
Expand Down Expand Up @@ -48,7 +47,6 @@ export default {
sync,
toolCall,
components,
newThread,
about,
contextMenu,
promptSetting,
Expand Down
4 changes: 0 additions & 4 deletions src/renderer/src/i18n/en-US/newThread.json

This file was deleted.

Loading