Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
} from "renderer/components/OpenInButton";
import { shortenHomePath } from "renderer/lib/formatPath";
import { trpc } from "renderer/lib/trpc";
import { ConvertToCloudButton } from "../ConvertToCloudButton";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Fix the incorrect import path causing pipeline failure.

The import path ../ConvertToCloudButton is incorrect and causes a module resolution error. Based on the AI summary, the component is located in WorkspaceFooter/components/ConvertToCloudButton/, but this file is in WorkspaceActionBar/components/WorkspaceActionBarRight/.

🔎 Proposed fix
-import { ConvertToCloudButton } from "../ConvertToCloudButton";
+import { ConvertToCloudButton } from "../../../WorkspaceFooter/components/ConvertToCloudButton";

Or preferably, use an alias as per coding guidelines:

-import { ConvertToCloudButton } from "../ConvertToCloudButton";
+import { ConvertToCloudButton } from "renderer/screens/main/components/WorkspaceView/WorkspaceFooter/components/ConvertToCloudButton";
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import { ConvertToCloudButton } from "../ConvertToCloudButton";
import { ConvertToCloudButton } from "../../../WorkspaceFooter/components/ConvertToCloudButton";
🧰 Tools
🪛 GitHub Actions: CI

[error] 24-24: Cannot find module '../ConvertToCloudButton' or its corresponding type declarations.

🤖 Prompt for AI Agents
In
apps/desktop/src/renderer/screens/main/components/WorkspaceView/WorkspaceActionBar/components/WorkspaceActionBarRight/WorkspaceActionBarRight.tsx
around line 24, the import path "../ConvertToCloudButton" is incorrect and
causes module resolution failures; update the import to point to the actual
component location at
"../../../WorkspaceFooter/components/ConvertToCloudButton/ConvertToCloudButton"
(or the project alias equivalent, e.g.
"@/screens/main/.../WorkspaceFooter/components/ConvertToCloudButton") so it
resolves correctly, and ensure the filename matches export (default/named) and
update any surrounding import syntax accordingly.


interface FormattedPath {
prefix: string;
Expand Down Expand Up @@ -80,6 +81,10 @@ export function WorkspaceActionBarRight({

return (
<>
<ConvertToCloudButton />

<div className="w-2" />

{/* Path - clickable to open */}
<Tooltip>
<TooltipTrigger asChild>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { Tooltip, TooltipContent, TooltipTrigger } from "@superset/ui/tooltip";
import { LuCloud } from "react-icons/lu";

const BUTTON_HEIGHT = 24;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Extract the duplicated BUTTON_HEIGHT constant.

The BUTTON_HEIGHT = 24 constant is also defined in WorkspaceFooterRight.tsx at line 80. This duplication should be eliminated by extracting the constant to a shared location.

🔎 Recommended refactor

Create a shared constants file:

// apps/desktop/src/renderer/screens/main/components/WorkspaceView/WorkspaceFooter/constants.ts
export const BUTTON_HEIGHT = 24;

Then import it in both components:

+import { BUTTON_HEIGHT } from "../../constants";
 import { Tooltip, TooltipContent, TooltipTrigger } from "@superset/ui/tooltip";
 import { LuCloud } from "react-icons/lu";

-const BUTTON_HEIGHT = 24;

Apply the same change to WorkspaceFooterRight.tsx.

As per coding guidelines, co-locate shared constants at the appropriate level.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In
apps/desktop/src/renderer/screens/main/components/WorkspaceView/WorkspaceFooter/components/ConvertToCloudButton/ConvertToCloudButton.tsx
around line 4 the BUTTON_HEIGHT = 24 constant is duplicated (also declared in
WorkspaceFooterRight.tsx line 80); extract this constant to a shared constants
file (e.g.
apps/desktop/src/renderer/screens/main/components/WorkspaceView/WorkspaceFooter/constants.ts
exporting BUTTON_HEIGHT = 24) and replace the local declarations in both
ConvertToCloudButton.tsx and WorkspaceFooterRight.tsx with imports from that new
constants file.


export function ConvertToCloudButton() {
const handleConvertToCloud = () => {
// TODO: Implement convert to cloud functionality
};

return (
<Tooltip>
<TooltipTrigger asChild>
<button
type="button"
onClick={handleConvertToCloud}
style={{ height: `${BUTTON_HEIGHT}px` }}
className="flex items-center gap-1.5 px-2.5 rounded border border-foreground/20 bg-foreground/5 hover:bg-foreground/10 text-[11px] font-semibold text-foreground transition-colors"
>
<LuCloud className="size-3.5" />
<span>Convert to cloud</span>
</button>
</TooltipTrigger>
<TooltipContent side="top" sideOffset={8}>
Convert workspace to cloud
</TooltipContent>
</Tooltip>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { ConvertToCloudButton } from "./ConvertToCloudButton";
Loading