Skip to content

Commit f5152f3

Browse files
authored
fix: ai chat suggestions pills - change design and remove redundant (#1420)
## Description ai chat suggestions pills - change design (5 columns instead of 4) and remove redundant ## What type of PR is this? (check all applicable) - [ ] 💡 (feat) - A new feature (non-breaking change which adds functionality) - [ ] 🔄 (refactor) - Code Refactoring - A code change that neither fixes a bug nor adds a feature - [ ] 🐞 (fix) - Bug Fix (non-breaking change which fixes an issue) - [ ] 🏎 (perf) - Optimization - [ ] 📄 (docs) - Documentation - Documentation only changes - [ ] 📄 (test) - Tests - Adding missing tests or correcting existing tests - [ ] ⚙️ (ci) - Continuous Integrations - Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs) - [ ] ☑️ (chore) - Chores - Other changes that don't modify src or test files - [ ] ↩️ (revert) - Reverts - Reverts a previous commit(s). <!-- For a timely review/response, please avoid force-pushing additional commits if your PR already received reviews or comments. Before submitting a Pull Request, please ensure you've done the following: - 👷‍♀️ Create small PRs. In most cases this will be possible. - ✅ Provide tests for your changes. - 📝 Use descriptive commit messages (as described below). - 📗 Update any related documentation and include any relevant screenshots. Commit Message Structure (all lower-case): <type>(optional ticket number): <description> [optional body] -->
1 parent cbe5e0e commit f5152f3

File tree

5 files changed

+155
-192
lines changed

5 files changed

+155
-192
lines changed

src/components/pages/aiLandingPage.tsx

Lines changed: 148 additions & 147 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { AiTextArea, Button, Loader, Typography } from "@components/atoms";
1515
import { ImportProjectModal, NewProjectModal } from "@components/organisms";
1616
import { ChatbotIframe } from "@components/organisms/chatbotIframe/chatbotIframe";
1717

18-
const pillsPerPage = 4;
18+
const pillsPerPage = 5;
1919

2020
export const AiLandingPage = () => {
2121
const { t: tAi } = useTranslation("dashboard", { keyPrefix: "ai" });
@@ -126,169 +126,169 @@ export const AiLandingPage = () => {
126126
const showQuickstart = !projectsList.some((project) => project.name.toLowerCase() === "quickstart");
127127

128128
return (
129-
<div className="relative flex min-h-screen flex-col overflow-y-scroll bg-[#1B1C1A] text-white">
130-
<header className="relative z-10 border-b border-gray-900/50 p-4 md:px-6">
131-
<div className="mx-auto flex w-full flex-col items-start justify-between gap-4 sm:flex-row sm:items-center">
132-
<div className="flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center sm:gap-3 md:gap-4">
133-
{showQuickstart ? (
129+
<div className="my-1.5 flex size-full overflow-hidden rounded-none md:rounded-2xl">
130+
<div className="flex flex-1 flex-col bg-[#1B1C1A] text-white">
131+
<header className="relative z-10 border-b border-gray-900/50 p-4 md:px-6">
132+
<div className="mx-auto flex w-full flex-col items-start justify-between gap-4 sm:flex-row sm:items-center">
133+
<div className="flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center sm:gap-3 md:gap-4">
134+
{showQuickstart ? (
135+
<Button
136+
className="flex w-full items-center rounded-full border border-green-400/30 bg-transparent px-4 py-2 text-base text-[#bcf870] hover:border-green-400/50 hover:bg-green-400/10 sm:w-auto md:px-6 md:text-sm"
137+
onClick={() => handleStartTutorial(TourId.quickstart)}
138+
>
139+
{isStarting ? (
140+
<div className="flex h-6 w-[5.95rem] items-center justify-center">
141+
<Loader size="sm" />
142+
</div>
143+
) : (
144+
<Typography className="font-normal">Start Tutorial</Typography>
145+
)}
146+
</Button>
147+
) : null}
134148
<Button
135-
className="w-full rounded-full border border-green-400/30 bg-transparent px-4 py-2 text-base text-[#bcf870] hover:border-green-400/50 hover:bg-green-400/10 sm:w-auto md:px-6 md:text-sm"
136-
onClick={() => handleStartTutorial(TourId.quickstart)}
149+
className="w-full rounded-full border border-green-400/50 bg-transparent px-4 py-2 text-base text-[#bcf870] hover:border-green-400/70 hover:bg-green-400/10 sm:w-auto md:px-6 md:text-base"
150+
onClick={handleStartFromTemplate}
137151
>
138-
{isStarting ? (
139-
<Loader isCenter size="sm" />
140-
) : (
141-
<Typography className="font-normal">Start Tutorial</Typography>
142-
)}
152+
<Typography className="font-normal">Start from Template</Typography>
143153
</Button>
144-
) : null}
145-
<Button
146-
className="w-full rounded-full border border-green-400/50 bg-transparent px-4 py-2 text-base text-[#bcf870] hover:border-green-400/70 hover:bg-green-400/10 sm:w-auto md:px-6 md:text-base"
147-
onClick={handleStartFromTemplate}
148-
>
149-
<Typography className="font-normal">Start from Template</Typography>
150-
</Button>
154+
<Button
155+
ariaLabel="New Project From Scratch"
156+
className="w-full rounded-full border border-green-400/50 bg-transparent px-4 py-2 text-base text-[#bcf870] hover:border-green-400/70 hover:bg-green-400/10 sm:w-auto md:px-6 md:text-base"
157+
onClick={handleNewProject}
158+
title="New Project From Scratch"
159+
>
160+
<Typography className="font-normal">New Project</Typography>
161+
</Button>
162+
</div>
151163
<Button
152-
ariaLabel="New Project From Scratch"
153-
className="w-full rounded-full border border-green-400/50 bg-transparent px-4 py-2 text-base text-[#bcf870] hover:border-green-400/70 hover:bg-green-400/10 sm:w-auto md:px-6 md:text-base"
154-
onClick={handleNewProject}
155-
title="New Project From Scratch"
164+
className="ml-2 w-full rounded-full bg-transparent text-base text-[#bcf870] hover:underline sm:w-auto"
165+
onClick={handleLearnMore}
156166
>
157-
<Typography className="font-normal">New Project</Typography>
167+
{tAi("learnMore")}
158168
</Button>
159169
</div>
160-
<Button
161-
className="ml-2 w-full rounded-full bg-transparent text-base text-[#bcf870] hover:underline sm:w-auto"
162-
onClick={handleLearnMore}
163-
>
164-
{tAi("learnMore")}
165-
</Button>
166-
</div>
167-
</header>
170+
</header>
168171

169-
<main className="relative mt-[5%] flex flex-1 flex-col items-center p-4 md:px-6">
170-
<div className="relative z-10 flex w-full max-w-6xl flex-col items-center gap-8 md:gap-12">
171-
<div className="mt-8 text-center">
172-
<Typography
173-
className="mb-8 text-2xl font-black leading-tight sm:text-3xl md:mb-12 md:text-4xl lg:text-5xl"
174-
element="h1"
175-
>
176-
<span className="text-white">Build AI Agents & Automations in Minutes</span>
177-
</Typography>
178-
<Typography className="mb-8 text-xl text-[#fdfffa] sm:text-2xl md:text-3xl" element="h2">
179-
Create workflows and connect applications by chatting with AI
180-
</Typography>
181-
</div>
172+
<main className="relative mt-[5%] flex flex-1 flex-col items-center p-4 md:px-6">
173+
<div className="relative z-10 flex w-full max-w-6xl flex-col items-center gap-8 md:gap-12">
174+
<div className="mt-8 text-center">
175+
<Typography
176+
className="mb-8 text-2xl font-black leading-tight sm:text-3xl md:mb-12 md:text-4xl lg:text-5xl"
177+
element="h1"
178+
>
179+
<span className="text-white">Build AI Agents & Automations in Minutes</span>
180+
</Typography>
181+
<Typography className="mb-8 text-xl text-[#fdfffa] sm:text-2xl md:text-3xl" element="h2">
182+
Create workflows and connect applications by chatting with AI
183+
</Typography>
184+
</div>
182185

183-
<div className="w-11/12 md:w-3/5">
184-
<form className="mb-4 md:mb-6" onSubmit={handleSubmit(onSubmit)}>
185-
<AiTextArea
186-
className="text-white placeholder:pl-2 placeholder:text-white"
187-
errors={errors}
188-
prompt={prompt}
189-
{...register("message", {
190-
required: tAi("aiPage.requiredMessage"),
191-
onChange: (e) => {
192-
if (errors.message && e.target.value.trim()) {
193-
clearErrors("message");
194-
}
195-
},
196-
})}
197-
/>
198-
</form>
199-
</div>
200-
<div className="flex w-full flex-col items-center gap-4">
201-
<div className="flex w-full max-w-6xl flex-wrap items-center justify-center gap-2 md:gap-3">
202-
{visiblePills.map((suggestion, index) => (
203-
<button
204-
className={cn(
205-
"cursor-pointer rounded-full border border-gray-600/50 bg-gray-1200 px-3 py-1.5",
206-
"w-full text-sm text-gray-400 transition-all duration-300 sm:w-[calc(50%-0.375rem)] sm:px-4 sm:py-3 sm:text-sm md:w-[calc(25%-1.5rem)] md:text-sm",
207-
"hover:border-green-400/50 hover:bg-gray-1100 hover:text-gray-100",
208-
{
209-
"animate-[fadeIn_0.5s_ease-in-out]": index < pillsPerPage,
186+
<div className="w-11/12 md:w-3/5">
187+
<form className="mb-4 md:mb-6" onSubmit={handleSubmit(onSubmit)}>
188+
<AiTextArea
189+
className="text-white placeholder:pl-2 placeholder:text-white"
190+
errors={errors}
191+
prompt={prompt}
192+
{...register("message", {
193+
required: tAi("aiPage.requiredMessage"),
194+
onChange: (e) => {
195+
if (errors.message && e.target.value.trim()) {
196+
clearErrors("message");
197+
}
198+
},
199+
})}
200+
/>
201+
</form>
202+
</div>
203+
<div className="flex w-full flex-col items-center gap-4">
204+
<div className="flex w-full max-w-6xl flex-wrap items-center justify-center gap-2 md:gap-3">
205+
{visiblePills.map((suggestion, index) => (
206+
<button
207+
className={cn(
208+
"cursor-pointer rounded-full border border-gray-600/50 bg-gray-1200 p-1.5",
209+
"w-full text-sm text-gray-400 transition-all duration-300 sm:w-[calc(50%-0.375rem)] sm:text-sm md:w-[calc(18%-0.5rem)] md:text-sm",
210+
"hover:border-green-400/50 hover:bg-gray-1100 hover:text-gray-100"
211+
)}
212+
key={index}
213+
onClick={() => onSuggestionClick(suggestion.text)}
214+
style={
215+
index < pillsPerPage
216+
? {
217+
animationDelay: `${index * 50}ms`,
218+
}
219+
: undefined
210220
}
211-
)}
212-
key={index}
213-
onClick={() => onSuggestionClick(suggestion.text)}
214-
style={
215-
index < pillsPerPage
216-
? {
217-
animationDelay: `${index * 50}ms`,
218-
}
219-
: undefined
220-
}
221-
type="button"
221+
type="button"
222+
>
223+
<span className="line-clamp-1">{suggestion.title}</span>
224+
</button>
225+
))}
226+
</div>
227+
228+
{hasMorePills ? (
229+
<Button
230+
className="group mt-2 bg-transparent text-sm text-gray-400 transition-all duration-300 hover:text-green-400"
231+
onClick={handleLoadMore}
222232
>
223-
<span className="line-clamp-1">{suggestion.title}</span>
224-
</button>
225-
))}
233+
<Typography className="flex items-center gap-2 font-medium">
234+
More
235+
<svg
236+
className="size-4"
237+
fill="none"
238+
stroke="currentColor"
239+
viewBox="0 0 24 24"
240+
xmlns="http://www.w3.org/2000/svg"
241+
>
242+
<path
243+
d="M19 9l-7 7-7-7"
244+
strokeLinecap="round"
245+
strokeLinejoin="round"
246+
strokeWidth={2}
247+
/>
248+
</svg>
249+
</Typography>
250+
</Button>
251+
) : null}
226252
</div>
227-
228-
{hasMorePills ? (
253+
</div>
254+
</main>
255+
<NewProjectModal />
256+
<ImportProjectModal />
257+
{isModalOpen ? (
258+
<div className="fixed inset-0 z-[99] flex items-center justify-center bg-black/60 p-2 sm:p-4">
259+
<div className="relative h-[95vh] w-full bg-black sm:h-[90vh] sm:w-[90vw] md:h-[85vh] md:w-[85vw]">
229260
<Button
230-
className="group mt-2 bg-transparent px-6 py-2 text-sm text-gray-400 transition-all duration-300 hover:text-green-400"
231-
onClick={handleLoadMore}
261+
aria-label={tAi("modal.closeLabel")}
262+
className="absolute right-3 top-3 z-10 bg-transparent p-1.5 hover:bg-gray-200 sm:right-6 sm:top-6"
263+
onClick={handleCloseModal}
232264
>
233-
<Typography className="flex items-center gap-2 font-medium">
234-
See all
235-
<svg
236-
className="size-4 transition-transform duration-300 group-hover:translate-y-1"
237-
fill="none"
238-
stroke="currentColor"
239-
viewBox="0 0 24 24"
240-
xmlns="http://www.w3.org/2000/svg"
241-
>
242-
<path
243-
d="M19 9l-7 7-7-7"
244-
strokeLinecap="round"
245-
strokeLinejoin="round"
246-
strokeWidth={2}
247-
/>
248-
</svg>
249-
</Typography>
265+
<svg
266+
className="size-4 text-gray-600 sm:size-5"
267+
fill="none"
268+
stroke="currentColor"
269+
viewBox="0 0 24 24"
270+
xmlns="http://www.w3.org/2000/svg"
271+
>
272+
<path
273+
d="M6 18L18 6M6 6l12 12"
274+
strokeLinecap="round"
275+
strokeLinejoin="round"
276+
strokeWidth={2}
277+
/>
278+
</svg>
250279
</Button>
251-
) : null}
252-
</div>
253-
</div>
254-
</main>
255-
<NewProjectModal />
256-
<ImportProjectModal />
257-
{isModalOpen ? (
258-
<div className="fixed inset-0 z-[99] flex items-center justify-center bg-black/60 p-2 sm:p-4">
259-
<div className="relative h-[95vh] w-full bg-black sm:h-[90vh] sm:w-[90vw] md:h-[85vh] md:w-[85vw]">
260-
<Button
261-
aria-label={tAi("modal.closeLabel")}
262-
className="absolute right-3 top-3 z-10 bg-transparent p-1.5 hover:bg-gray-200 sm:right-6 sm:top-6"
263-
onClick={handleCloseModal}
264-
>
265-
<svg
266-
className="size-4 text-gray-600 sm:size-5"
267-
fill="none"
268-
stroke="currentColor"
269-
viewBox="0 0 24 24"
270-
xmlns="http://www.w3.org/2000/svg"
271-
>
272-
<path
273-
d="M6 18L18 6M6 6l12 12"
274-
strokeLinecap="round"
275-
strokeLinejoin="round"
276-
strokeWidth={2}
277-
/>
278-
</svg>
279-
</Button>
280-
<ChatbotIframe
281-
className="size-full"
282-
hideCloseButton
283-
onConnect={handleIframeConnect}
284-
padded
285-
title={tAi("modal.assistantTitle")}
286-
/>
280+
<ChatbotIframe
281+
className="size-full"
282+
hideCloseButton
283+
onConnect={handleIframeConnect}
284+
padded
285+
title={tAi("modal.assistantTitle")}
286+
/>
287+
</div>
287288
</div>
288-
</div>
289-
) : null}
289+
) : null}
290290

291-
<style>{`
291+
<style>{`
292292
@keyframes fadeIn {
293293
from {
294294
opacity: 0;
@@ -300,6 +300,7 @@ export const AiLandingPage = () => {
300300
}
301301
}
302302
`}</style>
303+
</div>
303304
</div>
304305
);
305306
};

src/components/pages/dashboard.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ export const Dashboard = () => {
2222
// eslint-disable-next-line react-hooks/exhaustive-deps
2323
}, []);
2424

25-
return !isLoadingProjectsList && !projectsList.length ? (
26-
<CreateNewProject />
27-
) : (
28-
<div className="flex size-full overflow-hidden rounded-none md:mt-1.5 md:rounded-2xl">
25+
if (!isLoadingProjectsList && projectsList.length === 0) {
26+
return <CreateNewProject />;
27+
}
28+
29+
return (
30+
<div className="my-1.5 flex size-full overflow-hidden rounded-none md:rounded-2xl">
2931
<div
3032
className="relative flex w-2/3 flex-col"
3133
style={{ width: `${isMobile || fullScreenDashboard ? 100 : leftSideWidth}%` }}

src/components/templates/systemLogLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const SystemLogLayout = ({
2828
sidebar?: React.ReactNode;
2929
topbar?: React.ReactNode;
3030
}) => {
31-
const layoutClasses = cn("flex h-screen w-full flex-1 overflow-hidden", className);
31+
const layoutClasses = cn("flex h-screen flex-1 overflow-hidden", className);
3232
const { pathname } = useLocation();
3333
const { projectId } = useParams();
3434
const { setSystemLogHeight, systemLogHeight } = useLoggerStore();

src/constants/aiLandingPagePrompts.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,6 @@ export const createAiLandingPagePrompts = (tAi: (key: string) => string): Sugges
1616
title: tAi("prompts.webhookToLinearTicket.title"),
1717
text: tAi("prompts.webhookToLinearTicket.text"),
1818
},
19-
{
20-
title: tAi("prompts.pullRequestAutomation.title"),
21-
text: tAi("prompts.pullRequestAutomation.text"),
22-
},
23-
{
24-
title: tAi("prompts.codeDeploymentApprovals.title"),
25-
text: tAi("prompts.codeDeploymentApprovals.text"),
26-
},
27-
{
28-
title: tAi("prompts.slackTeamsNotifications.title"),
29-
text: tAi("prompts.slackTeamsNotifications.text"),
30-
},
3119
{
3220
title: tAi("prompts.telegramTranslatorAgent.title"),
3321
text: tAi("prompts.telegramTranslatorAgent.text"),
@@ -44,10 +32,6 @@ export const createAiLandingPagePrompts = (tAi: (key: string) => string): Sugges
4432
title: tAi("prompts.githubToSlack.title"),
4533
text: tAi("prompts.githubToSlack.text"),
4634
},
47-
{
48-
title: tAi("prompts.leadCaptureToCRM.title"),
49-
text: tAi("prompts.leadCaptureToCRM.text"),
50-
},
5135
{
5236
title: tAi("prompts.youtubeChannelMonitor.title"),
5337
text: tAi("prompts.youtubeChannelMonitor.text"),
@@ -64,8 +48,4 @@ export const createAiLandingPagePrompts = (tAi: (key: string) => string): Sugges
6448
title: tAi("prompts.whatsappFoodTrackingBot.title"),
6549
text: tAi("prompts.whatsappFoodTrackingBot.text"),
6650
},
67-
{
68-
title: tAi("prompts.birthdayAnniversaryReminders.title"),
69-
text: tAi("prompts.birthdayAnniversaryReminders.text"),
70-
},
7151
];

0 commit comments

Comments
 (0)