refactor: updated elevenLabs API module and remove button UX#6781
refactor: updated elevenLabs API module and remove button UX#6781Abhijay007 merged 3 commits intoblock:mainfrom
remove button UX#6781Conversation
There was a problem hiding this comment.
Pull request overview
Refactors the ElevenLabs API key settings UI in the desktop app by simplifying state management and removing some loading/validation UX.
Changes:
- Simplifies initial key detection to a single
useEffectcheck. - Switches save/remove flows to optimistic local state updates (no reload-based recheck).
- Adjusts the UI to show a dedicated “Remove API Key” action outside edit mode and removes inline validation/error messaging.
ui/desktop/src/components/settings/dictation/ElevenLabsKeyInput.tsx
Outdated
Show resolved
Hide resolved
ui/desktop/src/components/settings/dictation/ElevenLabsKeyInput.tsx
Outdated
Show resolved
Hide resolved
ui/desktop/src/components/settings/dictation/ElevenLabsKeyInput.tsx
Outdated
Show resolved
Hide resolved
remove button UX
lifeizhou-ap
left a comment
There was a problem hiding this comment.
Thank you @Abhijay007 for this improvement!
|
@DOsinga, could you please take a look at this as well? I believe it’s ready to be merged. I’m asking since you had initially mentioned the refactor in the other PR |
b6ae3ab to
aa0da6c
Compare
|
Hi @DOsinga , @lifeizhou-ap I updated this PR as during the recent refactor in this PR : #6844, it broke ElevenLabs by using |
|
I'm sorry I refactored the entire way we do this over the weekend - the config now comes from the server, you'll have a terrible merge conflict on your hands |
no problem I updated it , you can review it now :) @DOsinga |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
crates/goose-server/src/routes/dictation.rs:270
- The ElevenLabs multipart part creation discards the underlying reqwest error (map_err(|_| ...)), which makes failures harder to diagnose; preserve the original error message (as is done in transcribe_openai) when constructing the internal ErrorResponse.
let part = reqwest::multipart::Part::bytes(audio_bytes)
.file_name(format!("audio.{}", extension))
.mime_str(mime_type)
.map_err(|_| ErrorResponse::internal("Failed to create multipart"))?;
DOsinga
left a comment
There was a problem hiding this comment.
before we continue, can you make sure you merge in main? this looks different and sorry again for changing everything
5e30bda to
12a3128
Compare
|
we have a merge queue now after some incidents, so it might take a tad longer to see the latest in main |
Oh, okay so should we wait ? Like when I am taking pull, it is not reflecting for me |
|
hmm, what does your routers/dictation.rs ends on? mine has: pub fn routes(state: Arc) -> Router { |
same for me |
|
oh, I am sorry, yes, that is main. I do have another refactor though that changes even more coming up if you can wait on that? that generalizes things even more |
Yea sure will update the PR once those changes get merged |
|
merged |
|
Sure will update it today |
12a3128 to
cbef4b2
Compare
| const keyName = providerConfig.config_key!; | ||
| await upsert(keyName, trimmedKey, true); | ||
| setApiKey(''); | ||
| setIsEditingKey(false); | ||
|
|
||
| const audioConfig = await getDictationConfig(); | ||
| setProviderStatuses(audioConfig.data || {}); | ||
| } catch (error) { | ||
| console.error('Error saving API key:', error); | ||
| setKeyValidationError('Failed to save API key'); | ||
| } | ||
| const audioConfig = await getDictationConfig(); | ||
| setProviderStatuses(audioConfig.data || {}); |
There was a problem hiding this comment.
handleSaveKey no longer catches failures from upsert/getDictationConfig, so a network/backend error will surface as an unhandled promise rejection and the user gets no feedback. Please restore error handling (e.g., try/catch with a toast or inline error) and keep the UI in a sensible state on failure.
There was a problem hiding this comment.
@DOsinga should we consider these try/catch blocks?
There was a problem hiding this comment.
I generally think that the AIs are too eager with their catching errors and logging them. in this case we show the user, Failed to save API key, but that doesn't help them at all. this is just updating preferences in the backend, so I think just letting the error bubbling up seems ok
| const keyName = providerConfig.config_key!; | ||
| await remove(keyName, true); | ||
| setApiKey(''); | ||
| setIsEditingKey(false); | ||
|
|
||
| const audioConfig = await getDictationConfig(); | ||
| setProviderStatuses(audioConfig.data || {}); | ||
| } catch (error) { | ||
| console.error('Error removing API key:', error); | ||
| setKeyValidationError('Failed to remove API key'); | ||
| } | ||
| const audioConfig = await getDictationConfig(); | ||
| setProviderStatuses(audioConfig.data || {}); |
There was a problem hiding this comment.
handleRemoveKey now has no error handling around remove/getDictationConfig, so failures will result in an unhandled promise rejection and no user-visible error. Please wrap this in try/catch and surface a failure state (toast/inline) without leaving the UI ambiguous.
Signed-off-by: Abhijay007 <[email protected]>
Signed-off-by: Abhijay007 <[email protected]>
Signed-off-by: Abhijay007 <[email protected]>
cbef4b2 to
be89613
Compare
| const keyName = providerConfig.config_key!; | ||
| await upsert(keyName, trimmedKey, true); | ||
| setApiKey(''); | ||
| setIsEditingKey(false); | ||
|
|
||
| const audioConfig = await getDictationConfig(); | ||
| setProviderStatuses(audioConfig.data || {}); | ||
| } catch (error) { | ||
| console.error('Error saving API key:', error); | ||
| setKeyValidationError('Failed to save API key'); | ||
| } | ||
| const audioConfig = await getDictationConfig(); | ||
| setProviderStatuses(audioConfig.data || {}); |
There was a problem hiding this comment.
I generally think that the AIs are too eager with their catching errors and logging them. in this case we show the user, Failed to save API key, but that doesn't help them at all. this is just updating preferences in the backend, so I think just letting the error bubbling up seems ok
* origin/main: (107 commits) feat: Allow overriding default bat themes using environment variables (#7140) Make the system prompt smaller (#6991) Pre release script (#7145) Spelling (#7137) feat(mcp): upgrade rmcp to 0.15.0 and advertise MCP Apps UI extension capability (#6927) fix: ensure assistant messages with tool_calls include content field (#7076) fix(canonical): handle gcp_vertex_ai model mapping correctly (#6836) Group dependencies in root Cargo.toml (#6948) refactor: updated elevenLabs API module and `remove button` UX (#6781) fix: we were missing content from langfuse traces (#7135) docs: update username in authors.yml (#7132) fix extension selector syncing issues (#7133) fix(acp): per-session Agent for model isolation and load_session restore (#7115) fix(claude-code): defensive coding improvements for model switching (#7131) feat(claude-code): dynamic model listing and mid-session model switching (#7120) Inline worklet source (#7128) [docs] One shot prompting is dead - Blog Post (#7113) fix: correct spelling of Debbie O'Brien's name in authors.yml (#7127) docs: GCP Vertex AI org policy filtering & update OnboardingProviderSetup component (#7125) feat: replace subagent and skills with unified summon extension (#6964) ... # Conflicts: # Cargo.lock # Cargo.toml
* upstream/main: (109 commits) [docs] Skills Marketplace UI Improvements (block#7158) More no-window flags (block#7122) feat: Allow overriding default bat themes using environment variables (block#7140) Make the system prompt smaller (block#6991) Pre release script (block#7145) Spelling (block#7137) feat(mcp): upgrade rmcp to 0.15.0 and advertise MCP Apps UI extension capability (block#6927) fix: ensure assistant messages with tool_calls include content field (block#7076) fix(canonical): handle gcp_vertex_ai model mapping correctly (block#6836) Group dependencies in root Cargo.toml (block#6948) refactor: updated elevenLabs API module and `remove button` UX (block#6781) fix: we were missing content from langfuse traces (block#7135) docs: update username in authors.yml (block#7132) fix extension selector syncing issues (block#7133) fix(acp): per-session Agent for model isolation and load_session restore (block#7115) fix(claude-code): defensive coding improvements for model switching (block#7131) feat(claude-code): dynamic model listing and mid-session model switching (block#7120) Inline worklet source (block#7128) [docs] One shot prompting is dead - Blog Post (block#7113) fix: correct spelling of Debbie O'Brien's name in authors.yml (block#7127) ...
ref : #6557 (comment), #6557 (comment)
PR Description
updated elevenLabs API module and remove UX
Type of Change
AI Assistance
Testing
Tested In Desktop UI
Screenshots/Demos (for UX changes)