Skip to content

Commit 7b74e9e

Browse files
authored
feat: allow custom instructions when collection responses (#135)
improve translations and add error boundary feat: allow custom instructions when collection responses refactor: change instructions styles and display in response evaluation feat: add error boundary powered by Sentry and update Sentry config close #128 fix(en): fix translation keys and text feat(fr): translate to french close #73
1 parent 97dc386 commit 7b74e9e

File tree

14 files changed

+560
-81
lines changed

14 files changed

+560
-81
lines changed

cypress/fixtures/appSettings.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,26 @@ export const ALL_SETTINGS_OBJECT: AllSettingsType = {
3333
instructions: {
3434
title: {
3535
content: 'What are your big ideas today?',
36-
type: 'plain-text',
36+
format: 'plain-text',
3737
},
3838
details: {
3939
content:
4040
"Don't limitate yourself and express any idea that you may have.",
41-
type: 'plain-text',
41+
format: 'plain-text',
42+
},
43+
collection: {
44+
choose: {
45+
content: 'Choose an idea to build upon',
46+
format: 'plain-text',
47+
},
48+
input: {
49+
content: 'Submit your great idea',
50+
format: 'plain-text',
51+
},
52+
},
53+
evaluation: {
54+
content: 'Evaluate the responses.',
55+
format: 'plain-text',
4256
},
4357
},
4458
orchestrator: {

src/config/appSettingsType.ts

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,24 @@ import {
88
ResponseVisibilityMode,
99
} from '@/interfaces/interactionProcess';
1010

11+
import { t } from 'i18next';
1112
import { DEFAULT_SYSTEM_PROMPT } from './prompts';
1213

13-
type InstructionType = 'html' | 'markdown' | 'plain-text';
14+
type InstructionFormatType = 'html' | 'markdown' | 'plain-text';
15+
16+
type InstructionType = {
17+
content: string;
18+
format: InstructionFormatType;
19+
};
1420

1521
export type InstructionsSetting = {
16-
title: {
17-
content: string;
18-
type: InstructionType;
19-
};
20-
details?: {
21-
content: string;
22-
type: InstructionType;
22+
title: InstructionType;
23+
details?: InstructionType;
24+
collection: {
25+
choose: InstructionType;
26+
input: InstructionType;
2327
};
28+
evaluation: InstructionType;
2429
};
2530

2631
export type OrchestratorSetting = {
@@ -59,7 +64,21 @@ export const defaultSettingsValues: AllSettingsType = {
5964
instructions: {
6065
title: {
6166
content: '',
62-
type: 'plain-text',
67+
format: 'plain-text',
68+
},
69+
collection: {
70+
input: {
71+
content: t('RESPONSE_COLLECTION.CHOOSE_HELPER_INSTRUCTION'),
72+
format: 'plain-text',
73+
},
74+
choose: {
75+
content: t('RESPONSE_COLLECTION.CHOOSE_HELPER_INSTRUCTION'),
76+
format: 'plain-text',
77+
},
78+
},
79+
evaluation: {
80+
content: '',
81+
format: 'plain-text',
6382
},
6483
},
6584
orchestrator: {

src/config/sentry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const generateSentryConfig = (): SentryConfigType => {
1919
case 'production':
2020
SENTRY_ENVIRONMENT = 'production';
2121
SENTRY_TRACE_SAMPLE_RATE = 0.1;
22-
SENTRY_REPLAY_SAMPLE_RATE = 0.5;
22+
SENTRY_REPLAY_SAMPLE_RATE = 0.1;
2323
break;
2424
case 'test':
2525
SENTRY_TRACE_SAMPLE_RATE = 0.0;

src/langs/en.json

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
{
22
"translations": {
3-
"Welcome to the Graasp App Starter Kit": "Welcome to the Graasp App Starter Kit",
43
"VERSION": "version {{version}}",
54
"ACTIVITY_TAB": "Activity",
65
"RESPONSES_VIEW_TAB": "Responses view",
76
"SETTINGS_TAB": "Settings",
8-
"IDEA_SUBMITTED_SUCCESS": "Your idea was successfully submitted.",
7+
"RESPONSE_SUBMITTED_SUCCESS": "Your response was successfully submitted.",
98
"EDIT": "Edit",
109
"DELETE": "Delete",
1110
"CANCEL": "Cancel",
@@ -56,7 +55,11 @@
5655
"HELPER_TITLE": "Provide a main instruction to be shown in your activity.",
5756
"LABEL_TITLE": "Main",
5857
"HELPER_DETAILS": "Provide details to complete your main instructions.",
59-
"LABEL_DETAILS": "Details"
58+
"LABEL_DETAILS": "Details",
59+
"HELPER_INPUT": "Provide detailed instructions for submitting a response",
60+
"LABEL_INPUT": "Instructions for response submission",
61+
"HELPER_CHOOSE": "Provide detailed instructions for considering other's responses",
62+
"LABEL_CHOOSE": "Instructions for response selection"
6063
},
6164
"ORCHESTRATOR": {
6265
"TITLE": "Orchestrator",
@@ -113,6 +116,7 @@
113116
}
114117
},
115118
"RESPONSE_COLLECTION": {
119+
"CHOOSE_HELPER_INSTRUCTION": "Read these responses that have been proposed by other participants. Choose one to build upon or propose a new response.",
116120
"INPUT": {
117121
"SUBMIT": "Submit your response",
118122
"HELPER": "Write down only one proposition in this field.",
@@ -126,14 +130,12 @@
126130
}
127131
},
128132
"SAVE": "Save",
129-
"CHOOSE_RESPONSE_HEADER_TEXT": "Read these responses that have been proposed by other participants. Choose one to build upon or propose a new response.",
130133
"NO_IDEAS_TO_SHOW_TEXT": "The other participants have not submitted enough ideas yet. Once they have, these ideas will appear here.",
131134
"BOT_NAME": "GraaspBot",
132135
"SYNC_ALERT_SUCCESS": "All ideas are sync.",
133-
"CHECK_FOR_NEW_IDEAS": "Check for new responses",
134-
"PROPOSE_NEW_IDEA": "Propose a new response",
136+
"CHECK_FOR_NEW_RESPONSES": "Check for new responses",
137+
"PROPOSE_NEW_RESPONSE": "Propose a new response",
135138
"STATE_CONTROL_TITLE": "Controls",
136-
"PAUSE_MESSAGE": "The process has been paused by the admin. Please, wait for a moment.",
137139
"ROUND": "Round {{round}}",
138140
"PARTICIPANTS": "Participants",
139141
"ORCHESTRATION": "Orchestration",
@@ -175,6 +177,21 @@
175177
"HELPER": "With the following field, you can insert new ideas in the ideation process under the identity of the virtual agent."
176178
}
177179
},
180+
"ERROR_BOUNDARY": {
181+
"FALLBACK": {
182+
"MESSAGE_TITLE": "Sorry, something went wrong with this application",
183+
"MESSAGE_FEEDBACK": "Our team has been notified. If you would like to help, please, tell us what happened below.",
184+
"ERROR_DETAILS": "Details of the error",
185+
"NAME_LABEL": "Name",
186+
"NAME_HELPER": "Provide your name (optional)",
187+
"EMAIL_LABEL": "Email",
188+
"EMAIL_HELPER": "Provide your email (optional)",
189+
"COMMENT_LABEL": "Comment",
190+
"COMMENT_HELPER": "Tell us what happened (optional)",
191+
"THANKS_FOR_FEEDBACK": "Thank you for your feedback!",
192+
"SEND": "Send your feedback"
193+
}
194+
},
178195
"PROMPTS": {
179196
"SINGLE_RESPONSE": "We are given the following wicked problem:\n<problem>\n{{problemStatement}}\n</problem>\n\nGenerate a single solution to this challenge. Provide only the solution and limit it to {{maxChars}} characters.",
180197
"SINGLE_RESPONSE_AND_PROVIDE_RESPONSES": "We are given the following problem:\n<problem>\n{{problemStatement}}\n</problem>\n\nSo far, your teammates have proposed the following solutions to this problem:\n{{responses}}\nGenerate a single, disruptive and out-of-the-box solution for this challenge. Your solution should challenge conventional thinking and differ from the solutions proposed by the other participants. Try to match the tone and style of the given solutions.\nProvide only the solution, not enclosed in any format (no XML tags), and limit it to {{maxChars}} characters."

src/langs/fr.json

Lines changed: 193 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,199 @@
11
{
22
"translations": {
3-
"Welcome to the Graasp App Starter Kit": "Bienvenue dans le kit de démarrage de l'application Graasp",
4-
"IDEATION_TAB": "Idéation",
5-
"IDEAS_VIEW_TAB": "Vue des idées",
3+
"VERSION": "version {{version}}",
4+
"ACTIVITY_TAB": "Activité",
5+
"RESPONSES_VIEW_TAB": "Aperçu des réponses",
66
"SETTINGS_TAB": "Paramètres",
7-
"BUILD_ON_THIS_IDEA": "Élaborer cette idée",
8-
"IDEA_TOO_LONG_ALERT": "Votre idée est trop longue. Veuillez essayer d'être plus concis.",
9-
"IDEA_SUBMITTED_SUCCESS": "Votre idée a été enregistrée avec succés",
10-
"SUBMIT_NEW_IDEA_STEP_TITLE": "Soumettre une nouvelle idée",
11-
"READ_IDEAS_STEP_TITLE": "Trouver de l'inspiration",
12-
"ADMIN_PANE_TITLE": "Panneau d'aministration",
13-
"SETTINGS_TITLE": "Paramètres",
7+
"RESPONSE_SUBMITTED_SUCCESS": "Votre réponse a été envoyée avec succès.",
8+
"EDIT": "Éditer",
9+
"DELETE": "Effacer",
10+
"CANCEL": "Annuler",
11+
"COMING_SOON": "Prochainement !",
12+
"WAIT_TO_START_SCREEN": {
13+
"MAIN_INSTRUCTION": "L'activité va bientôt commencer. En attendant, merci de lire les instructions suivantes :",
14+
"STEP1": "Au départ, il vous sera présenté une instruction ou un défi.",
15+
"STEP2": "Proposez autant de réponses que possibles à cette instruction ou ce défi. Ne prenez pas trop de temps à rédiger chaque réponse.",
16+
"STEP3": "Après avoir soumis vos premières réponses, vous pourrez consulter celles des autres participants. Choisissez-en une sur laquelle construire ou proposez une réponses inédite.",
17+
"PAUSE_MESSAGE": "L'activité a été mise en pause par l'administrateur. Merci d'attendre un instant."
18+
},
19+
"ROUND_COMP": {
20+
"ROUND": "Round"
21+
},
22+
"ORCHESTRATION_BAR": {
23+
"PLAY": "Démarrer",
24+
"PAUSE": "Pause",
25+
"NEXT_STEP_BTN": {
26+
"NEXT_STEP": "Prochaine étape",
27+
"PREVIOUS_STEP": "Étape précédente",
28+
"REFRESH_DATA": "Rafraîchir les données",
29+
"LABEL_STEP_COLLECTION": "Collection des réponses, round {{ round }}",
30+
"LABEL_STEP_EVALUATION": "Évaluation des réponses",
31+
"NO_STEP": "L'activité courante n'est pas définie."
32+
},
33+
"WARNING_PREVIOUS_STEP_DIALOG": {
34+
"TITLE": "Êtes-vous sûr de vouloir aller à l'étape précédente ?",
35+
"WARNING_TEXT": "Si vous continuer, l'étape actuelle sera réinitialisée. Vos réponses et vos évaluations seront conservées. Néanmoins, la distribution des réponses entre les participants pourrait changer. Finalement, le temps sera remis à zéro.",
36+
"CANCEL": "Annuler",
37+
"GO_TO_PREVIOUS_STEP": "Aller à l'étape précédente"
38+
},
39+
"WARNING_NEXT_STEP_DIALOG": {
40+
"TITLE": "Êtes-vous sûr de vouloir aller à l'étape suivante ?",
41+
"WARNING_TEXT_WITH_TIME": "Il reste {{minutes}} minutes et {{seconds}} secondes pour cette étape.",
42+
"WARNING_TEXT": "Il reste du temps pour cette étape.",
43+
"GO_TO_NEXT_STEP": "Aller à l'étape suivante"
44+
},
45+
"ROUND_HELPER": "Round {{round}}"
46+
},
47+
"RESPONSE_CARD": {
48+
"BUILD_ON_THIS": "Développer ceci",
49+
"OWN": "Vous avez écrit ça"
50+
},
51+
"SETTINGS": {
52+
"TITLE": "Paramètres",
53+
"INSTRUCTIONS": {
54+
"TITLE": "Instructions",
55+
"HELPER_TITLE": "Donnez une instruction principale à votre activité.",
56+
"LABEL_TITLE": "Instruction principale",
57+
"HELPER_DETAILS": "Donnez des détails qui complètent votre instruction principale.",
58+
"LABEL_DETAILS": "Détails",
59+
"HELPER_INPUT": "Donnez des instructions spécifique sur comment répondre.",
60+
"LABEL_INPUT": "Instructions pour donner une réponse",
61+
"HELPER_CHOOSE": "Donnez des instructions spécifique sur comment utiliser les réponses des autres participants.",
62+
"LABEL_CHOOSE": "Instructions pour utiliser les autres réponses"
63+
},
64+
"ORCHESTRATOR": {
65+
"TITLE": "Orchestrateur",
66+
"LABEL": "Séléctionner l'orchestrateur de l'activité."
67+
},
68+
"PARTICIPANTS": {
69+
"TITLE": "Participants",
70+
"FIELD_LABEL": "Membres exclus"
71+
},
72+
"ACTIVITY": {
73+
"TITLE": "Activité",
74+
"MODE_LABEL": "Mode de visibilité",
75+
"EXCLUSIVE_RESPONSE_DISTRIBUTION_LABEL": "Distribuer chaque idée une seule fois ?",
76+
"ADVANCED_CONFIGURATION": "Configuration avancée",
77+
"REFORMULATE_RESPONSE_LABEL": "Reformuler les réponses avec l'IA avant envoi ?",
78+
"NUMBER_RESP_SET_LABEL": "Nombre de réponse à donner à chaque participant",
79+
"NUMBER_BOT_RESP_SET_LABEL": "Nombre de réponse générée par l'IA à donner à chaque participant",
80+
"STEPS": {
81+
"ERROR_PROMPT_NOT_IN_JSON_FORMAT": "Prompt has to be in JSON format.",
82+
"ADD_STEP": "Ajouter une étape"
83+
}
84+
},
85+
"EVALUATION_TYPE_SELECTION": {
86+
"TITLE": "Type d'évaluation",
87+
"NONE_BTN": "Ne pas évaluer les réponses.",
88+
"VOTE_BTN": "Évaluer les réponses par vote.",
89+
"NOV_REL_RATINGS_BTN": "Évaluer les réponses par pertinence et nouveauté.",
90+
"USE_NOV_RATINGS_BTN": "Évaluer les réponses par utilité et nouveauté."
91+
},
92+
"ASSISTANT": {
93+
"TITLE": "Assistants",
94+
"ADD": "Add an assistant",
95+
"EDIT_DIALOG": {
96+
"CHATBOT_NAME_LABEL": "Chatbot Name",
97+
"CHATBOT_NAME_HELPER": "This is the name that users will see when they interact with the chatbot",
98+
"CHATBOT_NAME_DEFAULT_MESSAGE": "by default",
99+
"CHATBOT_PROMPT_LABEL": "Chatbot Prompt",
100+
"CHATBOT_PROMPT_HELPER_LABEL": "In-depth technical description",
101+
"CHATBOT_PROMPT_HELPER": "This is the name that users will see when they interact with the chatbot",
102+
"CHATBOT_PROMPT_FORMAT_HELPER": "To describe the initial situation, create an object at the start of the array with 2 keys: 'role' and 'content'. For the initial description the role must be 'system'. Place your description of the initial situation in the 'content' key. Add interaction examples after that. Add one object per message with the role corresponding to either 'assistant' or 'user'.",
103+
"CHATBOT_PROMPT_FORMAT_EXAMPLE": "Here is an example",
104+
"CHATBOT_PROMPT_API_REFERENCE": "See the API reference",
105+
"CHATBOT_CUE_LABEL": "Cue",
106+
"CHATBOT_CUE_HELPER": "This defines the content of the first message of the chatbot. You can change it to better orient the conversation with the user.",
107+
"CHATBOT_CUE_EMPTY_MESSAGE": "The cue is empty.",
108+
"CHATBOT_CONFIGURATION_MISSING": "This chatbot has not been configured yet.",
109+
"CANCEL_LABEL": "Cancel",
110+
"EDIT_LABEL": "Edit",
111+
"CHATBOT_SETTING_TITLE": "Chatbot",
112+
"ERROR_PROMPT_NOT_IN_JSON_FORMAT": "Prompt has to be in JSON format.",
113+
"SAVE_LABEL": "Save",
114+
"SAVED_LABEL": "Saved"
115+
}
116+
}
117+
},
118+
"RESPONSE_COLLECTION": {
119+
"CHOOSE_HELPER_INSTRUCTION": "Lisez ces réponses proposées par les autres participants. Choisissez-en une à développer ou proposé une nouvelle réponse inédite.",
120+
"INPUT": {
121+
"SUBMIT": "Envoyer votre réponse",
122+
"HELPER": "Ne rédigez qu'une seule réponse.",
123+
"CUE_PARENT_RESPONSE_TITLE": "Réponse précédente",
124+
"RESPONSE_BEING_SUBMITTED_ALERT": "Votre réponse est en train d'être envoyée. Merci de patienter quelques instants.",
125+
"RESPONSE_TOO_LONG_ALERT": "Votre réponse est trop longue. Essayer d'être plus concis."
126+
},
127+
"STEPPER": {
128+
"INPUT_STEP_LABEL": "Proposer une réponse",
129+
"CHOOSE_STEP_LABEL": "Consulter les réponses des autres participants"
130+
}
131+
},
14132
"SAVE": "Sauvegarder",
15-
"SYNC_ALERT_SUCCESS": "Toutes les idées ont été synchronisées",
16-
"CUE_PARENT_IDEA_TITLE": "Idée précédente"
133+
"NO_IDEAS_TO_SHOW_TEXT": "Les autres participants n'ont pas soumis suffisamment de réponses pour le moment. Lorsque ce sera le cas, ces réponses apparaîtront ici.",
134+
"BOT_NAME": "GraaspBot",
135+
"CHECK_FOR_NEW_RESPONSES": "Vérifier si de nouvelles réponses sont disponibles.",
136+
"PROPOSE_NEW_RESPONSE": "Proposer une nouvelle réponse",
137+
"STATE_CONTROL_TITLE": "Contrôles",
138+
"ROUND": "Round {{round}}",
139+
"PARTICIPANTS": "Participants",
140+
"ORCHESTRATION": "Orchestration",
141+
"RESPONSE_EVALUATION": {
142+
"TITLE": "Évaluation des réponses"
143+
},
144+
"RATINGS": {
145+
"USEFULNESS_NOVELTY": {
146+
"COMMON": "Commun",
147+
"NOVEL": "Nouveau",
148+
"USELESS": "Inutile",
149+
"USEFUL": "Utile"
150+
}
151+
},
152+
"ADMIN_PANEL": {
153+
"TITLE": "Panneau d'aministration",
154+
"CONTROLS": {
155+
"TITLE": "Contrôles",
156+
"ROUND_HELPER": "Round {{round}}",
157+
"RESPONSE_COLLECTION_BUTTON": "Collection des réponse",
158+
"EVALUATION_BUTTON": "Évaluation",
159+
"RESULTS_BUTTON": "Résultats",
160+
"PREVIOUS_ROUND_TOOLTIP": "Revenir au round précédent",
161+
"NEXT_ROUND_TOOLTIP": "Démarrer le prochain round"
162+
},
163+
"ORCHESTRATION": {
164+
"NEXT_ROUND_BTN": "Prochain round",
165+
"RESET_SETS_BTN": "Réinitialiser l'activité",
166+
"REFRESH_DATA": "Rafraîchir les données",
167+
"RESET_SETS_DIALOG": {
168+
"TITLE": "Êtes-vous sûr de vouloir réinitialiser l'activité ?",
169+
"HELPER_TEXT": "Cette action est définitive and aura pour résultat la perte de tous les jeu de réponse crée durant l'activité.",
170+
"CANCEL": "Annuler",
171+
"CONFIRM": "Confirmer"
172+
}
173+
},
174+
"BOT": {
175+
"TITLE": "Agir en tant que bot",
176+
"HELPER": "With the following field, you can insert new ideas in the ideation process under the identity of the virtual agent."
177+
}
178+
},
179+
"ERROR_BOUNDARY": {
180+
"FALLBACK": {
181+
"MESSAGE_TITLE": "Nous sommes désolé. Un problème est survenu dans l'application.",
182+
"MESSAGE_FEEDBACK": "Notre équipe a été prévenue. Si vous souhaiter nous aider, merci de nous dire ce qui s'est passé dans le formulaire ci-dessous.",
183+
"ERROR_DETAILS": "Détails sur l'erreur",
184+
"NAME_LABEL": "Nom",
185+
"NAME_HELPER": "Votre nom (optionel)",
186+
"EMAIL_LABEL": "E-mail",
187+
"EMAIL_HELPER": "Votre e-mail (optionel)",
188+
"COMMENT_LABEL": "Commentaire",
189+
"COMMENT_HELPER": "Expliquez-nous ce qui c'est passé",
190+
"THANKS_FOR_FEEDBACK": "Merci pour votre commentaire !",
191+
"SEND": "Envoyer votre commentaire"
192+
}
193+
},
194+
"PROMPTS": {
195+
"SINGLE_RESPONSE": "We are given the following wicked problem:\n<problem>\n{{problemStatement}}\n</problem>\n\nGenerate a single solution to this challenge. Provide only the solution and limit it to {{maxChars}} characters.",
196+
"SINGLE_RESPONSE_AND_PROVIDE_RESPONSES": "We are given the following problem:\n<problem>\n{{problemStatement}}\n</problem>\n\nSo far, your teammates have proposed the following solutions to this problem:\n{{responses}}\nGenerate a single, disruptive and out-of-the-box solution for this challenge. Your solution should challenge conventional thinking and differ from the solutions proposed by the other participants. Try to match the tone and style of the given solutions.\nProvide only the solution, not enclosed in any format (no XML tags), and limit it to {{maxChars}} characters."
197+
}
17198
}
18199
}

src/main.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ import buildDatabase, { defaultMockContext, mockMembers } from './mocks/db';
1212
import Root from './modules/Root';
1313

1414
Sentry.init({
15-
integrations: [new Sentry.BrowserTracing(), new Sentry.Replay()],
15+
integrations: [
16+
Sentry.replayIntegration(),
17+
Sentry.browserTracingIntegration(),
18+
],
1619
...generateSentryConfig(),
1720
});
1821

0 commit comments

Comments
 (0)