Skip to content
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

feat(Assistant): Remove first hello message #2239

Merged
merged 1 commit into from
Nov 4, 2024
Merged
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
30 changes: 7 additions & 23 deletions src/assistant/Conversations/Conversation.jsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,11 @@
import React from 'react'

import { useQuery, isQueryLoading } from 'cozy-client'
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'

import { buildMyselfQuery } from '../queries'
import ChatAssistantItem from './ChatAssistantItem'
import ChatConversation from './ChatConversation'

const Conversation = ({ id, myself }) => {
const { t } = useI18n()
const givenName = myself.name?.givenName

return (
<div className="u-maw-7 u-mh-auto">
<ChatAssistantItem
label={
givenName
? t('assistant.hello_name', { name: givenName })
: t('assistant.hello')
}
/>
{id && <ChatConversation id={id} myself={myself} />}
</div>
)
}

const ConversationWithQuery = ({ id }) => {
const Conversation = ({ id }) => {
const myselfQuery = buildMyselfQuery()
const { data: myselves, ...queryMyselfResult } = useQuery(
myselfQuery.definition,
Expand All @@ -36,7 +16,11 @@ const ConversationWithQuery = ({ id }) => {

if (isLoading) return null

return <Conversation id={id} myself={myselves[0]} />
return (
<div className="u-maw-7 u-mh-auto">
<ChatConversation id={id} myself={myselves[0]} />
</div>
)
}

export default ConversationWithQuery
export default Conversation
2 changes: 0 additions & 2 deletions src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
"dialog": {
"close": "Schließen"
},
"hello_name":"Hallo %{name}, was kann ich für Sie tun?",
"hello":"Hallo, was kann ich für Sie tun?",
"name":"Cozy Assistent",
"sources":"%{smart_count} Quelle |||| %{smart_count} Quellen",
"suggestions": {
Expand Down
2 changes: 0 additions & 2 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
"dialog": {
"close": "Close"
},
"hello_name":"Hello %{name}, what can I do for you?",
"hello":"Hello, what can I do for you?",
"name":"Cozy Assistant",
"sources":"%{smart_count} source |||| %{smart_count} sources",
"suggestions": {
Expand Down
2 changes: 0 additions & 2 deletions src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
"dialog": {
"close": "Cerrar"
},
"hello_name":"Hola %{name}, ¿en qué puedo ayudarle?",
"hello":"Hola, ¿en qué puedo ayudarle?",
"name":"Asistente Cozy",
"sources":"%{smart_count} fuente |||| %{smart_count} fuentes",
"suggestions": {
Expand Down
2 changes: 0 additions & 2 deletions src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
"dialog": {
"close": "Fermer"
},
"hello_name":"Bonjour %{name}, que puis-je faire pour vous ?",
"hello":"Bonjour, que puis-je faire pour vous ?",
"name":"Assistant Cozy",
"sources":"%{smart_count} source |||| %{smart_count} sources",
"suggestions": {
Expand Down
2 changes: 0 additions & 2 deletions src/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
"dialog": {
"close": "Chiudere"
},
"hello_name":"Salve %{name}, cosa posso fare per lei?",
"hello":"Salve, cosa posso fare per lei?",
"name":"Assistente Cozy",
"sources":"%{smart_count} fonte |||| %{smart_count} fonti",
"suggestions": {
Expand Down
2 changes: 0 additions & 2 deletions src/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
"dialog": {
"close": "閉じる"
},
"hello_name":"${name}さん、こんにちは。",
"hello":"こんにちは、何かご用ですか?",
"name":"アシスタント Cozy",
"sources":"%{smart_count} ソース |||| %{smart_count} ソース",
"suggestions": {
Expand Down
2 changes: 0 additions & 2 deletions src/locales/nl_NL.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
"dialog": {
"close": "Sluit"
},
"hello_name":"Hallo %{name}, wat kan ik voor je doen?",
"hello":"Hallo, wat kan ik voor u doen?",
"name":"Cozy Assistent",
"sources":"%{smart_count} bron |||| %{smart_count} bronnen",
"suggestions": {
Expand Down
Loading