Skip to content

Commit db41e81

Browse files
authored
feat: add key monitoring during reset (#615)
* feat: add key monitoring during reset * docs: update changelog
1 parent 1296755 commit db41e81

2 files changed

Lines changed: 17 additions & 16 deletions

File tree

  • docs/content.en/docs/release-notes
  • src/components/Settings/Advanced/components/Shortcuts

docs/content.en/docs/release-notes/_index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Information about release notes of Coco Server is provided here.
1414
### 🚀 Features
1515

1616
- feat: ai overview support is enabled with shortcut #597
17+
- feat: add key monitoring during reset #615
1718

1819
### 🐛 Bug fix
1920

src/components/Settings/Advanced/components/Shortcuts/index.tsx

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ const Shortcuts = () => {
106106
value: modeSwitch,
107107
setValue: setModeSwitch,
108108
reset: () => {
109-
setModeSwitch(INITIAL_MODE_SWITCH);
109+
handleChange(INITIAL_MODE_SWITCH, setModeSwitch);
110110
},
111111
},
112112
{
@@ -115,7 +115,7 @@ const Shortcuts = () => {
115115
value: returnToInput,
116116
setValue: setReturnToInput,
117117
reset: () => {
118-
setReturnToInput(INITIAL_RETURN_TO_INPUT);
118+
handleChange(INITIAL_RETURN_TO_INPUT, setReturnToInput);
119119
},
120120
},
121121
{
@@ -124,7 +124,7 @@ const Shortcuts = () => {
124124
value: voiceInput,
125125
setValue: setVoiceInput,
126126
reset: () => {
127-
setVoiceInput(INITIAL_VOICE_INPUT);
127+
handleChange(INITIAL_VOICE_INPUT, setVoiceInput);
128128
},
129129
},
130130
{
@@ -133,7 +133,7 @@ const Shortcuts = () => {
133133
value: addFile,
134134
setValue: setAddFile,
135135
reset: () => {
136-
setAddFile(INITIAL_ADD_FILE);
136+
handleChange(INITIAL_ADD_FILE, setAddFile);
137137
},
138138
},
139139
{
@@ -142,7 +142,7 @@ const Shortcuts = () => {
142142
value: deepThinking,
143143
setValue: setDeepThinking,
144144
reset: () => {
145-
setDeepThinking(INITIAL_DEEP_THINKING);
145+
handleChange(INITIAL_DEEP_THINKING, setDeepThinking);
146146
},
147147
},
148148
{
@@ -151,7 +151,7 @@ const Shortcuts = () => {
151151
value: internetSearch,
152152
setValue: setInternetSearch,
153153
reset: () => {
154-
setInternetSearch(INITIAL_INTERNET_SEARCH);
154+
handleChange(INITIAL_INTERNET_SEARCH, setInternetSearch);
155155
},
156156
},
157157
{
@@ -161,7 +161,7 @@ const Shortcuts = () => {
161161
value: internetSearchScope,
162162
setValue: setInternetSearchScope,
163163
reset: () => {
164-
setInternetSearchScope(INITIAL_INTERNET_SEARCH_SCOPE);
164+
handleChange(INITIAL_INTERNET_SEARCH_SCOPE, setInternetSearchScope);
165165
},
166166
},
167167
{
@@ -170,7 +170,7 @@ const Shortcuts = () => {
170170
value: mcpSearch,
171171
setValue: setMcpSearch,
172172
reset: () => {
173-
setMcpSearch(INITIAL_MCP_SEARCH);
173+
handleChange(INITIAL_MCP_SEARCH, setMcpSearch);
174174
},
175175
},
176176
{
@@ -179,7 +179,7 @@ const Shortcuts = () => {
179179
value: mcpSearchScope,
180180
setValue: setMcpSearchScope,
181181
reset: () => {
182-
setMcpSearchScope(INITIAL_MCP_SEARCH_SCOPE);
182+
handleChange(INITIAL_MCP_SEARCH_SCOPE, setMcpSearchScope);
183183
},
184184
},
185185
{
@@ -188,7 +188,7 @@ const Shortcuts = () => {
188188
value: historicalRecords,
189189
setValue: setHistoricalRecords,
190190
reset: () => {
191-
setHistoricalRecords(INITIAL_HISTORICAL_RECORDS);
191+
handleChange(INITIAL_HISTORICAL_RECORDS, setHistoricalRecords);
192192
},
193193
},
194194
{
@@ -197,7 +197,7 @@ const Shortcuts = () => {
197197
value: aiAssistant,
198198
setValue: setAiAssistant,
199199
reset: () => {
200-
setAiAssistant(INITIAL_AI_ASSISTANT);
200+
handleChange(INITIAL_AI_ASSISTANT, setAiAssistant);
201201
},
202202
},
203203
{
@@ -206,7 +206,7 @@ const Shortcuts = () => {
206206
value: newSession,
207207
setValue: setNewSession,
208208
reset: () => {
209-
setNewSession(INITIAL_NEW_SESSION);
209+
handleChange(INITIAL_NEW_SESSION, setNewSession);
210210
},
211211
},
212212
{
@@ -215,7 +215,7 @@ const Shortcuts = () => {
215215
value: fixedWindow,
216216
setValue: setFixedWindow,
217217
reset: () => {
218-
setFixedWindow(INITIAL_FIXED_WINDOW);
218+
handleChange(INITIAL_FIXED_WINDOW, setFixedWindow);
219219
},
220220
},
221221
{
@@ -224,7 +224,7 @@ const Shortcuts = () => {
224224
value: serviceList,
225225
setValue: setServiceList,
226226
reset: () => {
227-
setServiceList(INITIAL_SERVICE_LIST);
227+
handleChange(INITIAL_SERVICE_LIST, setServiceList);
228228
},
229229
},
230230
{
@@ -233,7 +233,7 @@ const Shortcuts = () => {
233233
value: external,
234234
setValue: setExternal,
235235
reset: () => {
236-
setExternal(INITIAL_EXTERNAL);
236+
handleChange(INITIAL_EXTERNAL, setExternal);
237237
},
238238
},
239239
{
@@ -242,7 +242,7 @@ const Shortcuts = () => {
242242
value: aiOverview,
243243
setValue: setAiOverview,
244244
reset: () => {
245-
setAiOverview(INITIAL_AI_OVERVIEW);
245+
handleChange(INITIAL_AI_OVERVIEW, setAiOverview);
246246
},
247247
},
248248
];

0 commit comments

Comments
 (0)