Skip to content

feat(frontend): update import sample and fix image handling#39

Merged
DavidsonGomes merged 2 commits into
evolution-foundation:developfrom
lpcoutinho:feat/optimize-contact-import
May 5, 2026
Merged

feat(frontend): update import sample and fix image handling#39
DavidsonGomes merged 2 commits into
evolution-foundation:developfrom
lpcoutinho:feat/optimize-contact-import

Conversation

@lpcoutinho
Copy link
Copy Markdown
Contributor

@lpcoutinho lpcoutinho commented May 4, 2026

🎯 Objetivo

Atualizar o arquivo de exemplo para importação de contatos e corrigir o componente de imagem.

✅ Alterações Realizadas

1. Atualização do Arquivo de Exemplo

  • public/downloads/import-contacts-sample.csv atualizado com exemplos de CPF/CNPJ formatados
  • Demonstrado o novo formato sanitizado (apenas números)
  • Incluídos exemplos para todos os campos suportados

2. Correção no Componente de Imagem

  • src/components/chat/messages/MessageImage.tsx: melhorado tratamento de erros no carregamento de imagens
  • Ajustada a lógica de fallback para imagens inválidas

🧪 Testes

  • Verificação do download do CSV de exemplo
  • Teste de importação com o novo arquivo de exemplo
  • Validação da exibição de imagens no chat

🔗 Issues Relacionadas

Summary by Sourcery

Update contact import sample CSV and improve chat image handling.

New Features:

  • Provide an updated contact import sample CSV with formatted and sanitized CPF/CNPJ examples and all supported fields documented.

Bug Fixes:

  • Improve error handling and fallback logic for invalid or failed image loads in the chat message image component.

lpcoutinho added 2 commits May 4, 2026 08:27
- Add support for all 19 contact fields including person/company type
- Add social profiles (linkedin, facebook, instagram, twitter, github)
- Add location attributes (city, country, country_code)
- Add empresas_vinculadas field for linking persons to companies
- Add description field and custom attributes support
- Updated sample data with person and company examples
- Update import-contacts-sample.csv with sanitized CPF/CNPJ format
- Fix MessageImage component handling for contact imports
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 4, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates the contact import CSV sample to illustrate formatted and sanitized CPF/CNPJ values and enriches it with examples for all supported fields, and hardens the chat MessageImage component’s error handling and fallback logic for invalid or failed image loads.

File-Level Changes

Change Details Files
Update contact import CSV sample to document new CPF/CNPJ formatting and provide comprehensive field examples.
  • Replaced existing sample contact rows with ones that show both formatted CPF/CNPJ and their sanitized numeric-only representations.
  • Expanded the CSV to include example values for all currently supported contact fields.
  • Ensured the CSV column ordering and headers align with the backend’s expected import schema.
public/downloads/import-contacts-sample.csv
Improve robustness of chat image rendering by tightening error handling and fallback behavior.
  • Adjusted the MessageImage render logic to detect and handle image load errors explicitly (e.g., onError handlers or state-based tracking).
  • Updated fallback behavior so that broken or invalid image URLs display a consistent fallback state instead of partially rendered or broken UI.
  • Refined any conditional rendering or props handling to account for invalid image metadata coming from messages.
src/components/chat/messages/MessageImage.tsx

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@DavidsonGomes DavidsonGomes added needs-review Postponed for deeper review (out of current release scope) and removed needs-review Postponed for deeper review (out of current release scope) labels May 5, 2026
@DavidsonGomes DavidsonGomes merged commit 6b36cc9 into evolution-foundation:develop May 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants