Skip to content

Commit cb7627f

Browse files
committed
Remove type property from auto closing modals and messages
- remove 'type' from auto closing modal ├── apps │ └── editor │ └── src │ ├── commands │ │ └── apply-response-command │ │ └── apply-response-command.ts │ └── views │ └── prompt │ ├── backend │ │ └── message-handlers │ │ ├── handle-autofill.ts │ │ ├── handle-make-api-call.ts │ │ ├── handle-preview-web-configuration.ts │ │ ├── handle-undo.ts │ │ └── handle-voice-input.ts │ ├── frontend │ │ ├── Prompt.tsx │ │ └── hooks │ │ └── use-modal-manager.ts │ └── types │ └── messages.ts └── packages └── ui └── src └── components └── editor └── prompt └── modals └── AutoClosingModal ├── AutoClosingModal.stories.tsx └── AutoClosingModal.tsx
1 parent 3d6db1c commit cb7627f

8 files changed

Lines changed: 6 additions & 15 deletions

File tree

‎apps/editor/src/commands/apply-response-command/apply-response-command.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,7 @@ export const apply_response_command = (params: {
189189
command: 'SHOW_AUTO_CLOSING_MODAL',
190190
title: t(
191191
'command.apply-response-command.success.patched-successfully'
192-
),
193-
type: 'success'
192+
)
194193
})
195194
} finally {
196195
params.workspace_provider.resume_file_watcher()

‎apps/editor/src/views/prompt/backend/message-handlers/handle-autofill.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,7 @@ export const handle_autofill = async (params: {
116116
if (sent) {
117117
params.prompt_view_provider.send_message({
118118
command: 'SHOW_AUTO_CLOSING_MODAL',
119-
title: t('common.info.continue-in-browser'),
120-
type: 'success'
119+
title: t('common.info.continue-in-browser')
121120
})
122121
}
123122

‎apps/editor/src/views/prompt/backend/message-handlers/handle-make-api-call.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,7 @@ export const handle_make_api_call = async (
161161
command: 'SHOW_AUTO_CLOSING_MODAL',
162162
title: t(
163163
'views.prompt.handlers.handle-make-api-call.instructions-cannot-be-empty'
164-
),
165-
type: 'warning'
164+
)
166165
})
167166
return
168167
}

‎apps/editor/src/views/prompt/backend/message-handlers/handle-preview-web-configuration.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ export const handle_preview_web_configuration = async (
7979
if (sent) {
8080
prompt_view_provider.send_message({
8181
command: 'SHOW_AUTO_CLOSING_MODAL',
82-
title: t('common.info.continue-in-browser'),
83-
type: 'success'
82+
title: t('common.info.continue-in-browser')
8483
})
8584
}
8685
}

‎apps/editor/src/views/prompt/backend/message-handlers/handle-undo.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ export const handle_undo = async (
9191
prompt_view_provider.set_undo_button_state(false)
9292
prompt_view_provider.send_message({
9393
command: 'SHOW_AUTO_CLOSING_MODAL',
94-
title: 'Changes undone successfully',
95-
type: 'success'
94+
title: 'Changes undone successfully'
9695
})
9796
} catch (error) {
9897
Logger.error({

‎apps/editor/src/views/prompt/backend/message-handlers/handle-voice-input.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,7 @@ const stop_recording = async (prompt_view_provider: PromptViewProvider) => {
220220
command: 'SHOW_AUTO_CLOSING_MODAL',
221221
title: t(
222222
'views.prompt.handlers.handle-voice-input.warning.inaudible'
223-
),
224-
type: 'warning'
223+
)
225224
})
226225
} else {
227226
prompt_view_provider.add_text_at_cursor_position(result.response)

‎apps/editor/src/views/prompt/frontend/hooks/use-modal-manager.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ export const use_modal_manager = () => {
3232
const [auto_closing_modal_data, set_auto_closing_modal_data] = useState<
3333
| {
3434
title: string
35-
type: 'success' | 'warning' | 'error' | 'info'
3635
non_dismissable?: boolean
3736
}
3837
| undefined
@@ -80,7 +79,6 @@ export const use_modal_manager = () => {
8079
} else if (message.command == 'SHOW_AUTO_CLOSING_MODAL') {
8180
set_auto_closing_modal_data({
8281
title: message.title,
83-
type: message.type,
8482
non_dismissable: message.non_dismissable
8583
})
8684
} else if (message.command == 'SHOW_PREVIEW_ONGOING_MODAL') {

‎apps/editor/src/views/prompt/types/messages.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,6 @@ export interface HideProgressMessage extends BaseMessage {
815815
export interface ShowAutoClosingModalMessage extends BaseMessage {
816816
command: 'SHOW_AUTO_CLOSING_MODAL'
817817
title: string
818-
type: 'success' | 'warning' | 'error' | 'info'
819818
non_dismissable?: boolean
820819
}
821820

0 commit comments

Comments
 (0)