Skip to content

Commit 26a3ff8

Browse files
committed
feat: add send button to home page input area
- Add send button alongside voice input button - Adjust SendMessage icon size to 20px for consistency - Add type annotations for taskId parameters
1 parent 540913a commit 26a3ff8

File tree

4 files changed

+31
-18
lines changed

4 files changed

+31
-18
lines changed

electron/main/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { EkoService } from "./services/eko-service";
2626
import { ServerManager } from "./services/server-manager";
2727
import { MainWindowManager } from "./windows/main-window";
2828
import { taskScheduler } from "./services/task-scheduler";
29-
import { windowContextManager, type WindowContext } from "./services/window-context-manager";
29+
import { windowContextManager } from "./services/window-context-manager";
3030
import { cwd } from "node:process";
3131
import { registerAllIpcHandlers } from "./ipc";
3232

@@ -145,7 +145,7 @@ function setupMainWindowCloseHandler(window: BrowserWindow, service: EkoService)
145145
const allTaskIds = service['eko']?.getAllTaskId() || [];
146146
await service.abortAllTasks();
147147

148-
allTaskIds.forEach(taskId => {
148+
allTaskIds.forEach((taskId: string) => {
149149
window.webContents.send('task-aborted-by-system', {
150150
taskId,
151151
reason: 'User closed window, task terminated',

electron/main/services/task-window-manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export class TaskWindowManager {
109109
const allTaskIds = ekoService['eko']?.getAllTaskId() || [];
110110
await ekoService.abortAllTasks();
111111

112-
allTaskIds.forEach(tid => {
112+
allTaskIds.forEach((tid: string) => {
113113
taskWindow.webContents.send('task-aborted-by-system', {
114114
taskId: tid,
115115
reason: 'User closed scheduled task window, task terminated',

src/icons/deepfundai-icons.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ const StepUpDownSvg = () => (
215215

216216
// Send message
217217
const SendMessageSvg = () => (
218-
<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24" version="1.1">
218+
<svg xmlns="http://www.w3.org/2000/svg" width="20px" height="20px" viewBox="0 0 24 24" version="1.1">
219219
<g id="version-8-26" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
220220
<g id="group-50backup-4" transform="translate(-2.000000, -2.000000)">
221221
<g id="group-48" transform="translate(2.000000, 2.000000)">

src/pages/home.tsx

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { useRouter } from 'next/router'
33
import Header from '@/components/Header'
44
import { Input, Button, App } from 'antd'
55
import { AudioOutlined, AudioMutedOutlined } from '@ant-design/icons'
6+
import { SendMessage } from '@/icons/deepfundai-icons'
67
import { ScheduledTaskModal, ScheduledTaskListPanel } from '@/components/scheduled-task'
78
import { useScheduledTaskStore } from '@/stores/scheduled-task-store'
89
import { ModelConfigBar } from '@/components/ModelConfigBar'
@@ -96,23 +97,35 @@ export default function Home() {
9697
value={query}
9798
onChange={(e) => setQuery(e.target.value)}
9899
onKeyDown={handleKeyDown}
99-
className='!h-full !bg-transparent !text-text-01-dark !placeholder-text-12-dark !py-3 !px-4 !pr-12 !border-none !outline-none focus:!shadow-none'
100+
className='!h-full !bg-transparent !text-text-01-dark !placeholder-text-12-dark !py-3 !px-4 !pr-20 !border-none !outline-none focus:!shadow-none'
100101
placeholder={t('input_placeholder')}
101102
autoSize={false}
102103
/>
103-
{/* Voice input button */}
104-
<Button
105-
type='text'
106-
onClick={(e) => {
107-
e.preventDefault();
108-
e.stopPropagation();
109-
toggleRecording();
110-
}}
111-
className='!p-0 !w-8 !h-8 !min-w-0 !flex !items-center !justify-center !absolute !bottom-3 !right-3 !text-lg'
112-
title={isRecording ? t('voice_input_stop') : t('voice_input_start')}
113-
>
114-
{isRecording ? <AudioOutlined /> : <AudioMutedOutlined />}
115-
</Button>
104+
{/* Action buttons */}
105+
<div className='absolute bottom-3 right-3 flex items-center gap-2'>
106+
{/* Voice input button */}
107+
<Button
108+
type='text'
109+
onClick={(e) => {
110+
e.preventDefault();
111+
e.stopPropagation();
112+
toggleRecording();
113+
}}
114+
className='!p-0 !w-8 !h-8 !min-w-0 flex items-center justify-center text-lg'
115+
title={isRecording ? t('voice_input_stop') : t('voice_input_start')}
116+
>
117+
{isRecording ? <AudioOutlined /> : <AudioMutedOutlined />}
118+
</Button>
119+
{/* Send button */}
120+
<Button
121+
type='text'
122+
onClick={handleSendMessage}
123+
disabled={!query.trim()}
124+
className='!p-0 !w-8 !h-8 !min-w-0 flex items-center justify-center text-lg'
125+
>
126+
<SendMessage/>
127+
</Button>
128+
</div>
116129
</div>
117130
</div>
118131
</div>

0 commit comments

Comments
 (0)