-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Feature/code supernova #8188
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
Feature/code supernova #8188
Changes from all commits
c411271
e3a96ff
d34aad4
db84a07
d784c28
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -136,6 +136,10 @@ export const CloudView = ({ userInfo, isAuthenticated, cloudApiUrl, onDone }: Cl | |
| vscode.postMessage({ type: "openExternal", url: cloudUrl }) | ||
| } | ||
|
|
||
| const handleStartFreeTrial = () => { | ||
| vscode.postMessage({ type: "openExternal", url: "https://app.roocode.com/billing" }) | ||
| } | ||
|
|
||
| const handleOpenCloudUrl = () => { | ||
| if (cloudApiUrl) { | ||
| vscode.postMessage({ type: "openExternal", url: cloudApiUrl }) | ||
|
|
@@ -272,9 +276,20 @@ export const CloudView = ({ userInfo, isAuthenticated, cloudApiUrl, onDone }: Cl | |
| <div className={cn(authInProgress && "opacity-50")}>{renderCloudBenefitsContent(t)}</div> | ||
|
|
||
| {!authInProgress && ( | ||
| <VSCodeButton appearance="primary" onClick={handleConnectClick} className="w-full"> | ||
| {t("cloud:connect")} | ||
| </VSCodeButton> | ||
| <> | ||
| <VSCodeButton | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This button logic is duplicated in ApiOptions.tsx (lines 666-679). Could we extract this into a shared component to avoid duplication and ensure consistency? |
||
| appearance="primary" | ||
| onClick={handleStartFreeTrial} | ||
| className="w-full"> | ||
| {t("cloud:startFreeTrial")} | ||
| </VSCodeButton> | ||
| <VSCodeButton | ||
| appearance="secondary" | ||
| onClick={handleConnectClick} | ||
| className="w-full"> | ||
| {t("cloud:connect")} | ||
| </VSCodeButton> | ||
| </> | ||
| )} | ||
|
|
||
| {/* Manual entry section */} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -87,6 +87,7 @@ describe("HistoryPreview", () => { | |
| it("renders nothing when no tasks are available", () => { | ||
| mockUseTaskSearch.mockReturnValue({ | ||
| tasks: [], | ||
| recentTasks: [], | ||
| searchQuery: "", | ||
| setSearchQuery: vi.fn(), | ||
| sortOption: "newest", | ||
|
|
@@ -107,6 +108,7 @@ describe("HistoryPreview", () => { | |
| it("renders up to 3 tasks when tasks are available", () => { | ||
| mockUseTaskSearch.mockReturnValue({ | ||
| tasks: mockTasks, | ||
| recentTasks: mockTasks, | ||
| searchQuery: "", | ||
| setSearchQuery: vi.fn(), | ||
| sortOption: "newest", | ||
|
|
@@ -132,6 +134,7 @@ describe("HistoryPreview", () => { | |
| const threeTasks = mockTasks.slice(0, 3) | ||
| mockUseTaskSearch.mockReturnValue({ | ||
| tasks: threeTasks, | ||
| recentTasks: threeTasks, | ||
| searchQuery: "", | ||
| setSearchQuery: vi.fn(), | ||
| sortOption: "newest", | ||
|
|
@@ -156,6 +159,7 @@ describe("HistoryPreview", () => { | |
| const oneTask = mockTasks.slice(0, 1) | ||
| mockUseTaskSearch.mockReturnValue({ | ||
| tasks: oneTask, | ||
| recentTasks: oneTask, | ||
| searchQuery: "", | ||
| setSearchQuery: vi.fn(), | ||
| sortOption: "newest", | ||
|
|
@@ -175,6 +179,7 @@ describe("HistoryPreview", () => { | |
| it("passes correct props to TaskItem components", () => { | ||
| mockUseTaskSearch.mockReturnValue({ | ||
| tasks: mockTasks.slice(0, 3), | ||
| recentTasks: mockTasks.slice(0, 3), | ||
| searchQuery: "", | ||
| setSearchQuery: vi.fn(), | ||
| sortOption: "newest", | ||
|
|
@@ -214,6 +219,7 @@ describe("HistoryPreview", () => { | |
| it("renders with correct container classes", () => { | ||
| mockUseTaskSearch.mockReturnValue({ | ||
| tasks: mockTasks.slice(0, 1), | ||
| recentTasks: mockTasks.slice(0, 1), | ||
| searchQuery: "", | ||
| setSearchQuery: vi.fn(), | ||
| sortOption: "newest", | ||
|
|
@@ -228,4 +234,25 @@ describe("HistoryPreview", () => { | |
|
|
||
| expect(container.firstChild).toHaveClass("flex", "flex-col", "gap-3") | ||
| }) | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good addition of the fallback test case! Consider adding more edge cases:
|
||
| it("falls back to recent tasks when filtered tasks are empty", () => { | ||
| mockUseTaskSearch.mockReturnValue({ | ||
| tasks: [], | ||
| recentTasks: mockTasks, | ||
| searchQuery: "", | ||
| setSearchQuery: vi.fn(), | ||
| sortOption: "newest", | ||
| setSortOption: vi.fn(), | ||
| lastNonRelevantSort: null, | ||
| setLastNonRelevantSort: vi.fn(), | ||
| showAllWorkspaces: false, | ||
| setShowAllWorkspaces: vi.fn(), | ||
| }) | ||
|
|
||
| render(<HistoryPreview />) | ||
|
|
||
| expect(screen.getByTestId("task-item-task-1")).toBeInTheDocument() | ||
| expect(screen.getByTestId("task-item-task-2")).toBeInTheDocument() | ||
| expect(screen.getByTestId("task-item-task-3")).toBeInTheDocument() | ||
| }) | ||
| }) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -665,6 +665,14 @@ const ApiOptions = ({ | |
| <div className="flex flex-col gap-2"> | ||
| <VSCodeButton | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This duplicates the button logic from CloudView.tsx. Consider extracting into a shared component to maintain DRY principles and ensure consistent behavior across the app. |
||
| appearance="primary" | ||
| onClick={() => | ||
| vscode.postMessage({ type: "openExternal", url: "https://app.roocode.com/billing" }) | ||
| } | ||
| className="w-fit"> | ||
| {t("settings:providers.roo.startFreeTrialButton")} | ||
| </VSCodeButton> | ||
| <VSCodeButton | ||
| appearance="secondary" | ||
| onClick={() => vscode.postMessage({ type: "rooCloudSignIn" })} | ||
| className="w-fit"> | ||
| {t("settings:providers.roo.connectButton")} | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
The privacy policy now includes a section on marketing communications. Has this been reviewed by legal to ensure compliance with applicable data protection regulations (GDPR, CCPA, etc.)?