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 @@ -9,6 +9,7 @@
background-color: var(--project-detail-bg);
position: relative;
overflow: hidden;
cursor: pointer;
}

.project-list-card-wrapper:hover {
Expand Down Expand Up @@ -170,10 +171,6 @@
}

/* ---------- body ---------- */
.project-list-card-clickable-content {
cursor: pointer;
}

.project-list-card-detail-section {
padding: 12px 14px;
}
Expand Down
15 changes: 7 additions & 8 deletions frontend/src/base/components/project-list/ProjectListCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ function ProjectListCard({
} ${isDeleting ? "project-list-card--deleting" : ""} ${
selectionMode || isSelected ? "project-list-card--selection-mode" : ""
}`}
role="button"
tabIndex={0}
onClick={handleCardClick}
onKeyDown={(e) => e.key === "Enter" && handleCardClick()}
>
{/* deleting overlay */}
{isDeleting && (
Expand Down Expand Up @@ -141,6 +145,7 @@ function ProjectListCard({
if (ShareProjectModal) setIsShareModalOpen(true);
}}
onKeyDown={(e) => {
e.stopPropagation();
if (e.key === "Enter" && ShareProjectModal)
setIsShareModalOpen(true);
}}
Expand All @@ -167,14 +172,8 @@ function ProjectListCard({
)}
</div>

{/* ---------- body (clickable) ---------- */}
<div
className="project-list-card-clickable-content"
role="button"
tabIndex={0}
onClick={handleCardClick}
onKeyDown={(e) => e.key === "Enter" && handleCardClick()}
>
{/* ---------- body ---------- */}
<div className="project-list-card-clickable-content">
{/* description */}
<div className="project-list-card-detail-section project-list-card-desc-section">
<Typography.Paragraph
Expand Down
25 changes: 25 additions & 0 deletions frontend/src/ide/chat-ai/ChatAI.css
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,31 @@
.chat-ai-info-chip-clickable {
cursor: pointer;
}
.chat-ai-info-chip:has(.chat-ai-schema-select) {
padding: 3px 4px 3px 10px;
}
/* Schema select inside info chip — !important needed to override Ant Design inline styles */
.chat-ai-info-chip .chat-ai-schema-select {
max-width: 180px;
}
.chat-ai-info-chip .chat-ai-schema-select.ant-select {
height: 16px !important;
}
.chat-ai-info-chip .chat-ai-schema-select .ant-select-selector {
padding: 0 !important;
height: 16px !important;
min-height: unset !important;
}
.chat-ai-info-chip .chat-ai-schema-select .ant-select-selection-item {
font-size: 10px;
line-height: 16px;
padding-inline-end: 14px;
}
.chat-ai-info-chip .chat-ai-schema-select .ant-select-arrow {
font-size: 8px;
right: 0;
inset-block-start: 50%;
}
.chat-ai-info-chip-error {
background-color: var(--ant-color-error-bg);
border-color: var(--ant-color-error-border);
Expand Down
54 changes: 49 additions & 5 deletions frontend/src/ide/chat-ai/PromptActions.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { memo, useEffect, useMemo } from "react";
import { memo, useCallback, useEffect, useMemo } from "react";
import { Space, Typography, Select, Switch, Segmented, Tooltip } from "antd";
import {
ConsoleSqlOutlined,
Expand All @@ -15,6 +15,8 @@ import InfoChip from "./InfoChip";
import { useTokenStore } from "../../store/token-store";
import { useSessionStore } from "../../store/session-store";
import { useProjectStore } from "../../store/project-store";
import { explorerService } from "../explorer/explorer-service";
import { useNotificationService } from "../../service/notification-service";

// Define hidden intents and a fixed order array
const HIDDEN_CHAT_INTENTS = ["AUTO", "NOTA", "INFO"];
Expand Down Expand Up @@ -53,6 +55,32 @@ const PromptActions = memo(function PromptActions({
const { tokenBalance, isLoading: isTokenLoading } = useTokenStore();
const isCloud = useSessionStore((state) => state.sessionDetails?.is_cloud);
const currentSchema = useProjectStore((state) => state.currentSchema);
const setCurrentSchema = useProjectStore((state) => state.setCurrentSchema);
const schemaList = useProjectStore((state) => state.schemaList);
const projectId = useProjectStore((state) => state.projectId);
const expService = explorerService();
const { notify } = useNotificationService();

const schemaOptions = useMemo(
() => schemaList.map((s) => ({ label: s, value: s })),
[schemaList]
);

const handleSchemaChange = useCallback(
(value) => {
expService
.setProjectSchema(projectId, value)
.then(() => {
setCurrentSchema(value);
notify({ type: "success", message: "Schema updated successfully" });
})
.catch((error) => {
console.error(error);
notify({ error });
});
},
[expService, projectId, setCurrentSchema, notify]
);

const llmOptions = useMemo(
() =>
Expand Down Expand Up @@ -169,12 +197,28 @@ const PromptActions = memo(function PromptActions({
</a>
)}

{/* Schema indicator */}
{currentSchema && (
{/* Schema selector */}
{schemaList.length > 0 ? (
<div className="chat-ai-info-chip chat-ai-info-chip-clickable">
<DatabaseOutlined className="chat-ai-info-chip-icon" />
<Select
size="small"
variant="borderless"
showSearch
placeholder="Schema"
value={currentSchema || undefined}
onChange={handleSchemaChange}
options={schemaOptions}
popupMatchSelectWidth={false}
className="chat-ai-schema-select"
/>
</div>
) : (
<InfoChip
icon={<DatabaseOutlined className="chat-ai-info-chip-icon" />}
text={currentSchema}
tooltipTitle="All new models generated will be created inside this schema. To modify it, click the settings icon from the left explorer."
text="No schema"
tooltipTitle="No schemas available. Please configure a database connection and select a schema from the explorer."
className="chat-ai-info-chip-error"
/>
)}
</Space>
Expand Down
Loading
Loading