Skip to content

Commit 9715341

Browse files
committed
chore: design feedback
1 parent bc75f2d commit 9715341

File tree

4 files changed

+39
-30
lines changed

4 files changed

+39
-30
lines changed

packages/frontend/src/components/AiBuilder/components/ChatInterface/PromptInput.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,12 @@ export default function PromptInput({
6767
bg="white"
6868
border="1px"
6969
borderColor="gray.200"
70-
borderRadius="3xl"
71-
boxShadow="lg"
72-
_hover={{ boxShadow: 'xl' }}
73-
transition="box-shadow 0.2s"
70+
borderRadius="16px"
71+
boxShadow="sm"
7472
p={2}
7573
w="full"
76-
minH="50px"
77-
style={{ height: 'auto' }}
74+
minH={showIdeas ? '120px' : '50px'}
75+
height="auto"
7876
mb={3}
7977
>
8078
<Textarea
@@ -95,7 +93,6 @@ export default function PromptInput({
9593
_disabled={{ opacity: 1, bg: 'transparent', color: 'gray.900' }}
9694
fontSize="base"
9795
lineHeight="6"
98-
minH="50px"
9996
maxH="calc(40vh - 100px)"
10097
rows={1}
10198
overflowY="auto"

packages/frontend/src/components/AiBuilder/components/ChatInterface/index.tsx

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { useEffect, useRef, useState } from 'react'
2-
import { BiSolidMagicWand } from 'react-icons/bi'
32
import { IoChevronDown } from 'react-icons/io5'
4-
import { Box, Flex, Icon, IconButton, Text } from '@chakra-ui/react'
5-
import { Tag } from '@opengovsg/design-system-react'
3+
import { Box, Flex, IconButton, Text } from '@chakra-ui/react'
64

75
import { useChatStream } from '@/hooks/useChatStream'
86

@@ -74,19 +72,7 @@ export default function ChatInterface() {
7472
px={4}
7573
>
7674
{messages.length === 0 && (
77-
<>
78-
<Tag
79-
colorScheme="secondary"
80-
_hover={{}}
81-
_active={{}}
82-
gap={2}
83-
size="lg"
84-
>
85-
<Icon as={BiSolidMagicWand} />
86-
Build with AI
87-
</Tag>
88-
<Text textStyle="h3">What happens in your workflow?</Text>
89-
</>
75+
<Text textStyle="h3">What happens in your workflow?</Text>
9076
)}
9177
<Box w="full" maxW="2xl" overflowY="auto" maxH="100vh">
9278
<PromptInput

packages/frontend/src/components/AiBuilder/components/IdeaButtons.tsx

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { Flex, Text } from '@chakra-ui/react'
2-
import { Button, FormLabel } from '@opengovsg/design-system-react'
2+
import { Button, FormLabel, useIsMobile } from '@opengovsg/design-system-react'
3+
4+
import { TemplateIcon } from '@/helpers/flow-templates'
35

46
import { AiChatIdea, AiFormIdea } from '../constants'
57

@@ -9,26 +11,40 @@ interface IdeaButtonsProps {
911
}
1012

1113
export default function IdeaButtons({ ideas, onClick }: IdeaButtonsProps) {
14+
const isMobile = useIsMobile()
15+
1216
return (
1317
<Flex flexDir="column">
1418
<FormLabel isRequired>
1519
{/* arbitrary isRequired to hide optional text */}
1620
Need inspiration? Try one of these:
1721
</FormLabel>
18-
<Flex flexDir="row" gap={2} justifyContent="space-between">
22+
<Flex
23+
flexDir="row"
24+
gap={2}
25+
justifyContent="space-between"
26+
flexWrap="wrap"
27+
>
1928
{ideas.map((idea) => (
2029
<Button
2130
key={idea.label}
22-
size="xs"
23-
bgColor="interaction.muted.main.active"
24-
color="primary.500"
31+
size="sm"
32+
bgColor="interaction.sub-subtle.default"
33+
color="#5D6785"
2534
variant="clear"
2635
_hover={{
27-
bgColor: 'primary.200',
36+
bgColor: 'interaction.sub-subtle.hover',
2837
}}
2938
onClick={() => onClick(idea)}
39+
px={3}
40+
minH={4}
41+
w={isMobile ? 'calc(50% - 4px)' : 'auto'}
42+
flexShrink={0}
3043
>
31-
<Text textStyle="caption-1">{idea.label}</Text>
44+
<TemplateIcon iconName={idea.icon} fontSize="1rem" />
45+
<Text textStyle="caption-1" ml="0.25rem">
46+
{idea.label}
47+
</Text>
3248
</Button>
3349
))}
3450
</Flex>

packages/frontend/src/components/AiBuilder/constants.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,59 +18,69 @@ export const AI_FORM_FIELDS = [
1818
export const AI_FORM_IDEAS = [
1919
{
2020
label: 'Route support enquiries',
21+
icon: 'BiDirections',
2122
trigger: 'When a new support enquiry is submitted',
2223
actions:
2324
'If the query is related to IT, route to the IT department.\nIf the query is related to HR, route to the HR department.\nIf the query is related to Finance, route to the Finance department.',
2425
},
2526
{
2627
label: 'Schedule reminders',
28+
icon: 'BiCalendar',
2729
trigger: 'Every day at 09:00 AM',
2830
actions:
2931
'Find rows in Tiles where the RSVPed column is Yes and the Reminder sent column is empty.\nFor each row, send a reminder email to the attendee.\nMark the row as Reminder sent.',
3032
},
3133
{
3234
label: 'Attendance taking',
35+
icon: 'BiCheckDouble',
3336
trigger: 'When a new event attendance is received',
3437
actions:
3538
"Find the attendee in Tiles\nIf the attendee is found, update the Attended? column to Yes\nIf the attendee is not found, create a new row in Tiles with the attendee's details.",
3639
},
3740
{
3841
label: 'Send follow ups',
42+
icon: 'BiEnvelope',
3943
trigger: 'When a new form submission is received',
4044
actions: 'Send a follow up email to the customer.',
4145
},
4246
]
4347

4448
export type AiFormIdea = {
4549
label: string
50+
icon: string
4651
trigger: string
4752
actions: string
4853
}
4954

5055
export const AI_CHAT_IDEAS = [
5156
{
5257
label: 'Route support enquiries',
58+
icon: 'BiDirections',
5359
input:
5460
'When a new support enquiry is submitted, if the query is related to IT, route to the IT department. If the query is related to HR, route to the HR department. If the query is related to Finance, route to the Finance department.',
5561
},
5662
{
5763
label: 'Schedule reminders',
64+
icon: 'BiCalendar',
5865
input:
5966
'Every day at 09:00 AM, find rows in Tiles where the RSVPed column is Yes and the Reminder sent column is empty. For each row, send a reminder email to the attendee. Mark the row as Reminder sent.',
6067
},
6168
{
6269
label: 'Attendance taking',
70+
icon: 'BiCheckDouble',
6371
input:
6472
"When a new event attendance is received, find the attendee in Tiles. If the attendee is found, update the Attended? column to Yes. If the attendee is not found, create a new row in Tiles with the attendee's details.",
6573
},
6674
{
6775
label: 'Send follow ups',
76+
icon: 'BiEnvelope',
6877
input:
6978
'When a new form submission is received, send a follow up email to the customer.',
7079
},
7180
]
7281

7382
export type AiChatIdea = {
7483
label: string
84+
icon: string
7585
input: string
7686
}

0 commit comments

Comments
 (0)