Repository navigation
Show FLORA and Fireworks workspace fields in Settings #900
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
apps/desktop-tauri/src/surfaces/settings/providers/sections/CredentialsDispatcher.test.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| import { render, screen } from "@testing-library/react"; | ||
| import { beforeEach, describe, expect, it, vi } from "vitest"; | ||
| import type { LocaleKey } from "../../../../i18n/keys"; | ||
| import { getProviderWorkspaceId } from "../../../../lib/tauri"; | ||
| import { CredentialsDispatcher } from "./CredentialsDispatcher"; | ||
|
|
||
| vi.mock("../../../../lib/tauri", async (importOriginal) => ({ | ||
| ...(await importOriginal<typeof import("../../../../lib/tauri")>()), | ||
| getProviderWorkspaceId: vi.fn(), | ||
| setProviderWorkspaceId: vi.fn(), | ||
| })); | ||
|
|
||
| const t = (key: LocaleKey) => key as string; | ||
|
|
||
| describe("CredentialsDispatcher", () => { | ||
| beforeEach(() => { | ||
| vi.clearAllMocks(); | ||
| vi.mocked(getProviderWorkspaceId).mockResolvedValue(null); | ||
| }); | ||
|
|
||
| it.each([ | ||
| ["flora", "FLORA workspace"], | ||
| ["fireworks", "Fireworks account"], | ||
| ["cosmic", "CosmicProjectIdTitle"], | ||
| ["openaiapi", "OpenAiAdminApiTitle"], | ||
| ])("shows the workspace field for %s", async (providerId, title) => { | ||
| render(<CredentialsDispatcher providerId={providerId} t={t} />); | ||
| expect(await screen.findByText(title)).toBeInTheDocument(); | ||
| expect(screen.getByRole("textbox")).toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it("renders nothing for providers without a credentials extra", () => { | ||
| const { container } = render(<CredentialsDispatcher providerId="claude" t={t} />); | ||
| expect(container).toBeEmptyDOMElement(); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Add
fireworksto the workspace-settings provider mapping.hasWorkspaceExtra("fireworks")renders the Account slug field, but the Settings save path callsset_provider_workspace_id("fireworks", ...). The Rust command mapping omitsfireworks, so the command rejects the value instead of persisting it. Fireworks can consume an already persisted workspace slot or auto-discover an account, but neither route lets this new Settings field configure the account slug. Addfireworksto the shared provider mapping used by both save and load commands.Suggested fix
+ "fireworks" => ProviderId::Fireworks,🧰 Tools
🪛 React Doctor (0.9.14)
[warning] 101-101: This file exports non-components, so Fast Refresh can't safely preserve component state.
Move non-component exports out of component files so Fast Refresh can preserve component state instead of full-reloading.
(only-export-components)
🤖 Prompt for AI Agents