All files / apps/chatbot/src/utils suggestions.ts

100% Statements 3/3
100% Branches 2/2
100% Functions 1/1
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16          1x               1x 3x  
/**
 * Chip labels are short enough to be ambiguous on their own ("add", "remove"),
 * so tapping one sends the full sentence the agent can act on rather than the
 * label itself. Anything unmapped is already a sentence and passes through.
 */
const MEANINGFUL_MESSAGES: Record<string, string> = {
  "user list": "I would like to see the on-behalf user list",
  "manager list": "I would like to see the on-behalf manager list",
  add: "Could you help me add people to the list?",
  edit: "Could you help me edit people in the list?",
  remove: "Could you help me remove people from the list?",
};
 
export const getMeaningfulMessage = (suggestion: string): string =>
  MEANINGFUL_MESSAGES[suggestion.toLowerCase().trim()] || suggestion;