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

fix: create new component to load images from supabase bucket #251

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

douglastofoli
Copy link
Contributor

@douglastofoli douglastofoli commented Jan 18, 2025

Descrição

Criado novo componente para carregar imagens da Supabase

Stories relacionadas (Shortcut)

  • [sc-xxxx]

Pontos para atenção

  • Listar pontos para atenção no review
  • Listar pontos para atenção nos testes

Possui novas configurações?

  • Descrever as configurações alteradas ou novas

Possui migrations?

  • Se a feature adicionou alguma migration e como faz para rodar

Summary by CodeRabbit

  • Novos Recursos

    • Adicionado um componente personalizado supabase_image para renderização dinâmica de imagens do Supabase.
    • Implementada uma solução mais eficiente para carregar imagens com URLs assinadas.
  • Melhorias

    • Substituídas tags <img> tradicionais por componente <.supabase_image> em múltiplas páginas, incluindo seções de carrossel e galeria.
    • Simplificado o processo de exibição de imagens provenientes do armazenamento Supabase, utilizando caminhos reduzidos e formatos otimizados.

Copy link

coderabbitai bot commented Jan 18, 2025

Walkthrough

O pull request introduz uma nova função supabase_image/1 no módulo PescarteWeb.DesignSystem, que é responsável por renderizar imagens provenientes do Supabase. Essa função aceita atributos para a fonte da imagem (src), texto alternativo (alt) e classe CSS (class). A implementação permite a geração de URLs assinadas para as imagens, substituindo as tags <img> diretas por um componente personalizado <.supabase_image> em vários templates. Essa mudança padroniza a forma como as imagens são carregadas em diferentes partes do projeto, sem alterar a funcionalidade existente.

Changes

Arquivo Resumo das Alterações
lib/pescarte_web/design_system.ex Adicionada função supabase_image/1 com atributos src, alt e class
lib/pescarte_web/templates/aboutus_html/show.html.heex Substituídas 9 tags <img> por <.supabase_image> para imagens de "sobre"
lib/pescarte_web/templates/sedes_html/show.html.heex Substituída tag <img> por <.supabase_image> para imagem do mapa
lib/pescarte_web/templates/cooperativas_html/show.html.heex Substituídas 2 tags <img> por <.supabase_image> para imagens de cooperativas
lib/pescarte_web/templates/landing_html/show.html.heex Substituídas várias tags <img> por <.supabase_image> para imagens em carrossel e galeria

Poem

🖼️ Imagens dançam no Supabase
Componentes elegantes, sem disfarce
Design system brilha, código flui
Cada pixel agora se exclui
Na tela, uma nova arte surge! 🌈


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3367659 and 817914f.

📒 Files selected for processing (3)
  • lib/pescarte_web/design_system.ex (1 hunks)
  • lib/pescarte_web/templates/cooperativas_html/show.html.heex (1 hunks)
  • lib/pescarte_web/templates/landing_html/show.html.heex (17 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: test (27.1.2, 1.18.0)
  • GitHub Check: lint (27.1.2, 1.18.0)
🔇 Additional comments (5)
lib/pescarte_web/templates/landing_html/show.html.heex (2)

11-23: Adicione texto alternativo para as imagens do carrossel

Para manter a consistência com as boas práticas de acessibilidade web, é importante adicionar descrições adequadas para todas as imagens do carrossel usando o atributo alt.


84-84: ⚠️ Potential issue

Corrija o caminho da imagem do card NAIPA

O componente está utilizando a mesma imagem do card PGTR (reduced_images/landing/landing_card_pgtr.webp), o que parece ser um erro. Cada card deve ter sua própria imagem representativa.

-      <.supabase_image src="reduced_images/landing/landing_card_pgtr.webp" />
+      <.supabase_image src="reduced_images/landing/landing_card_naipa.webp" />

Likely invalid or redundant comment.

lib/pescarte_web/design_system.ex (2)

645-645: ⚠️ Potential issue

Remova o IO.inspect de debug

A função IO.inspect/1 não deve estar presente em código de produção pois pode expor informações sensíveis nos logs.

-    IO.inspect(assigns.src)

Likely invalid or redundant comment.


644-654: 🛠️ Refactor suggestion

Melhore o tratamento de erros e a configuração do componente

O componente atual pode ser aprimorado nos seguintes aspectos:

  1. Adicionar tratamento de erros para falhas na inicialização do cliente ou assinatura de URL
  2. Externalizar valores hardcoded como nome do bucket e tempo de expiração
  3. Implementar fallback para casos de erro
 def supabase_image(assigns) do
-    IO.inspect(assigns.src)
+    bucket_name = Application.get_env(:pescarte, :supabase_bucket, "static")
+    expiration_time = Application.get_env(:pescarte, :url_expiration, 3600)
+
     assigns =
       with {:ok, client} <- Pescarte.Supabase.get_client(),
-           {:ok, bucket} <- Supabase.Storage.BucketHandler.retrieve_info(client, "static"),
-           {:ok, url} <- Supabase.Storage.create_signed_url(client, bucket, assigns.src, 3600) do
+           {:ok, bucket} <- Supabase.Storage.BucketHandler.retrieve_info(client, bucket_name),
+           {:ok, url} <- Supabase.Storage.create_signed_url(client, bucket, assigns.src, expiration_time) do
         modified_url = String.replace(url, "/object/", "/storage/v1/object/")
         Map.put(assigns, :src, modified_url)
+       else
+         error ->
+           Logger.error("Falha ao gerar URL da imagem Supabase: #{inspect(error)}")
+           Map.put(assigns, :src, "/images/fallback.png")
       end

     ~H"""
-    <img src={@src} alt={@alt} class={@class} />
+    <img 
+      src={@src} 
+      alt={@alt} 
+      class={@class} 
+      loading="lazy"
+      onerror="this.onerror=null; this.src='/images/fallback.png';"
+    />
     """
   end

Likely invalid or redundant comment.

lib/pescarte_web/templates/cooperativas_html/show.html.heex (1)

34-38: Adicione texto alternativo para as imagens de cooperativas

Para manter a consistência com as boas práticas de acessibilidade web, é importante adicionar descrições adequadas para as imagens usando o atributo alt.

Finishing Touches

  • 📝 Generate Docstrings (Beta)

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🔭 Outside diff range comments (1)
lib/pescarte_web/templates/aboutus_html/show.html.heex (1)

Line range hint 44-47: Mantenha consistência no uso do componente de imagem

Há uma imagem SVG que ainda utiliza a tag <img> direta ao invés do componente <.supabase_image>. Para manter a consistência, considere migrar todas as imagens para usar o mesmo componente.

-<img
-  style="object-fit: contain"
-  src="https://rrosgcmviafnxjshljoq.supabase.co/storage/v1/object/sign/static/images/sobre/Logo_IBAMA.svg?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1cmwiOiJzdGF0aWMvaW1hZ2VzL3NvYnJlL0xvZ29fSUJBTUEuc3ZnIiwiaWF0IjoxNzI1MzgzMzg5LCJleHAiOjIwNDA3NDMzODl9.Dt7KGoEC9eu7p4JEV-I9BzvZgBQgC2K0OuSbK6_8pNk&t=2024-09-03T17%3A09%3A49.837Z"
-/>
+<.supabase_image
+  src="images/sobre/Logo_IBAMA.svg"
+  alt="Logo do IBAMA"
+  class="contain-image"
+/>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2a689d9 and 1c21775.

⛔ Files ignored due to path filters (1)
  • flake.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • lib/pescarte_web/design_system.ex (1 hunks)
  • lib/pescarte_web/templates/aboutus_html/show.html.heex (6 hunks)
  • lib/pescarte_web/templates/sedes_html/show.html.heex (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: lint (27.1.2, 1.18.0)

Comment on lines 637 to 658
@doc """
Renders image from Supabase
"""
attr :src, :string, required: true, doc: "the image source"
attr :alt, :string, required: false, default: "", doc: "the image alt"
attr :class, :string, default: "", doc: "the image class"

def supabase_image(assigns) do
assigns =
with {:ok, client} <- Pescarte.Supabase.get_client(),
{:ok, bucket} <- Supabase.Storage.BucketHandler.retrieve_info(client, "static"),
{:ok, url} <- Supabase.Storage.create_signed_url(client, bucket, assigns.src, 3600) do
modified_url = String.replace(url, "/object/", "/storage/v1/object/")

Map.put(assigns, :src, modified_url)
end

~H"""
<img src={@src} alt={@alt} class={@class} />
"""
end

Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Melhore o tratamento de erros e a configuração do componente de imagem

O componente atual pode ser aprimorado em alguns aspectos:

  1. Adicione tratamento de erros para falhas na inicialização do cliente ou assinatura de URL
  2. Evite valores hardcoded como nome do bucket e tempo de expiração
  3. Considere implementar cache para URLs assinadas para melhor performance

Sugestão de implementação:

 def supabase_image(assigns) do
+  bucket_name = Application.get_env(:pescarte, :supabase_bucket, "static")
+  expiration_time = Application.get_env(:pescarte, :url_expiration, 3600)
+
   assigns =
     with {:ok, client} <- Pescarte.Supabase.get_client(),
-         {:ok, bucket} <- Supabase.Storage.BucketHandler.retrieve_info(client, "static"),
-         {:ok, url} <- Supabase.Storage.create_signed_url(client, bucket, assigns.src, 3600) do
+         {:ok, bucket} <- Supabase.Storage.BucketHandler.retrieve_info(client, bucket_name),
+         {:ok, url} <- Supabase.Storage.create_signed_url(client, bucket, assigns.src, expiration_time) do
       modified_url = String.replace(url, "/object/", "/storage/v1/object/")
       Map.put(assigns, :src, modified_url)
+     else
+       error ->
+         Logger.error("Failed to generate Supabase image URL: #{inspect(error)}")
+         Map.put(assigns, :src, "/images/fallback.png")
     end

   ~H"""
-  <img src={@src} alt={@alt} class={@class} />
+  <img 
+    src={@src} 
+    alt={@alt} 
+    class={@class} 
+    loading="lazy"
+    onerror="this.onerror=null; this.src='/images/fallback.png';"
+  />
   """
 end

Committable suggestion skipped: line range outside the PR's diff.

@@ -1,7 +1,7 @@
<main class="sedes-wrapper">
<!-- MAPA -->
<div class="mapa">
<img src="https://rrosgcmviafnxjshljoq.supabase.co/storage/v1/object/sign/static/images/equipes/mapa.jpeg?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1cmwiOiJzdGF0aWMvaW1hZ2VzL2VxdWlwZXMvbWFwYS5qcGVnIiwiaWF0IjoxNzI0MTU2NjYwLCJleHAiOjE3NTU2OTI2NjB9.cpDBGFmH-HhwRjZ27FUpBLZ_tsulytz7MlcngJLlyyI&t=2024-08-20T12%3A24%3A20.597Z" />
<.supabase_image src="reduced_images/equipes/mapa.webp" alt="Mapa das sedes" />
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Adicione atributos de acessibilidade e otimização

A implementação atual pode ser melhorada com atributos adicionais para acessibilidade e otimização de carregamento.

-<.supabase_image src="reduced_images/equipes/mapa.webp" alt="Mapa das sedes" />
+<.supabase_image 
+  src="reduced_images/equipes/mapa.webp" 
+  alt="Mapa das sedes" 
+  class="map-image"
+  aria-label="Mapa interativo mostrando a localização das sedes do Pescarte"
+/>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<.supabase_image src="reduced_images/equipes/mapa.webp" alt="Mapa das sedes" />
<.supabase_image
src="reduced_images/equipes/mapa.webp"
alt="Mapa das sedes"
class="map-image"
aria-label="Mapa interativo mostrando a localização das sedes do Pescarte"
/>

@@ -91,7 +91,7 @@
</div>

<div class="phases-img">
<img src="https://rrosgcmviafnxjshljoq.supabase.co/storage/v1/object/sign/static/images/sobre/Linha%20do%20tempo%20-%20Fases%20do%20Pescarte_atual_versaosite.jpeg?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1cmwiOiJzdGF0aWMvaW1hZ2VzL3NvYnJlL0xpbmhhIGRvIHRlbXBvIC0gRmFzZXMgZG8gUGVzY2FydGVfYXR1YWxfdmVyc2Fvc2l0ZS5qcGVnIiwiaWF0IjoxNzI1NjI1MzU4LCJleHAiOjIwNDA5ODUzNTh9.-GeuXA3RR4LD15MmHeJHFR0Q1D7n15Ly0ll6lLfaZig&t=2024-09-06T12%3A22%3A39.490Z" />
<.supabase_image src="reduced_images/sobre/Linha%20do%20tempo%20-%20Fases%20do%20Pescarte_atual_versaosite.webp" />
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Evite caracteres codificados em URLs de imagens

A URL da imagem contém caracteres codificados (%20) que podem ser substituídos por hifens ou underscores para melhor legibilidade e manutenção.

-<.supabase_image src="reduced_images/sobre/Linha%20do%20tempo%20-%20Fases%20do%20Pescarte_atual_versaosite.webp" />
+<.supabase_image src="reduced_images/sobre/linha-do-tempo-fases-do-pescarte.webp" />

Committable suggestion skipped: line range outside the PR's diff.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

♻️ Duplicate comments (1)
lib/pescarte_web/design_system.ex (1)

644-654: ⚠️ Potential issue

Implemente tratamento de erros adequado

A função atual não trata adequadamente possíveis erros que podem ocorrer durante a geração da URL assinada. Isso pode resultar em falhas silenciosas.

Veja o comentário anterior sobre tratamento de erros e configuração do componente de imagem para uma implementação mais robusta.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1c21775 and 3367659.

📒 Files selected for processing (3)
  • lib/pescarte_web/design_system.ex (1 hunks)
  • lib/pescarte_web/templates/cooperativas_html/show.html.heex (1 hunks)
  • lib/pescarte_web/templates/landing_html/show.html.heex (17 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: test (27.1.2, 1.18.0)
🔇 Additional comments (2)
lib/pescarte_web/design_system.ex (2)

656-656: 🛠️ Refactor suggestion

Adicione estados de carregamento e fallback

A imagem atual não possui estados de carregamento ou fallback para casos de erro. Isso pode impactar negativamente a experiência do usuário.

-    <img src={@src} alt={@alt} class={@class} />
+    <img 
+      src={@src} 
+      alt={@alt} 
+      class={@class} 
+      loading="lazy"
+      onerror="this.onerror=null; this.src='/images/fallback.webp';"
+    />

Likely invalid or redundant comment.


648-649: 🛠️ Refactor suggestion

Evite valores hardcoded

O nome do bucket ("static") e o tempo de expiração (3600) estão hardcoded no código. Isso dificulta a manutenção e configuração em diferentes ambientes.

-           {:ok, bucket} <- Supabase.Storage.BucketHandler.retrieve_info(client, "static"),
-           {:ok, url} <- Supabase.Storage.create_signed_url(client, bucket, assigns.src, 3600) do
+           bucket_name = Application.get_env(:pescarte, :supabase_bucket, "static"),
+           expiration = Application.get_env(:pescarte, :url_expiration, 3600),
+           {:ok, bucket} <- Supabase.Storage.BucketHandler.retrieve_info(client, bucket_name),
+           {:ok, url} <- Supabase.Storage.create_signed_url(client, bucket, assigns.src, expiration) do

Likely invalid or redundant comment.

@@ -31,11 +31,11 @@
</a>
</.text>
</div>
<img src="https://rrosgcmviafnxjshljoq.supabase.co/storage/v1/object/sign/static/images/cooperativas/cooperativas_1.png?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1cmwiOiJzdGF0aWMvaW1hZ2VzL2Nvb3BlcmF0aXZhcy9jb29wZXJhdGl2YXNfMS5wbmciLCJpYXQiOjE3MjQzNDc5NTAsImV4cCI6MjAzOTcwNzk1MH0.aypgmecYR3yFQVDFbP6E9AEqbjZOiVtvpJWfc1z7aDM&t=2024-08-22T17%3A32%3A30.186Z" />
<.supabase_image src="reduced_images/cooperativas/cooperativas_1.webp" />
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Adicione texto alternativo para melhorar a acessibilidade

As alterações para usar o componente <.supabase_image> estão corretas e seguem o padrão estabelecido. No entanto, para melhorar a acessibilidade, sugiro adicionar o atributo alt com uma descrição apropriada das imagens.

-      <.supabase_image src="reduced_images/cooperativas/cooperativas_1.webp" />
+      <.supabase_image 
+        src="reduced_images/cooperativas/cooperativas_1.webp"
+        alt="Imagem ilustrativa sobre cooperativas"
+      />

-      <.supabase_image src="reduced_images/cooperativas/cooperativas_2.webp" />
+      <.supabase_image 
+        src="reduced_images/cooperativas/cooperativas_2.webp"
+        alt="Imagem sobre estudo de viabilidade técnica"
+      />

Also applies to: 38-38

Comment on lines +11 to +17
<.supabase_image src="reduced_images/landing/carrossel/landing_carrossel1.webp" />
</li>
<li class="glide__slide">
<img src="https://rrosgcmviafnxjshljoq.supabase.co/storage/v1/object/sign/static/images/landing/carrossel/landing_carrossel2.svg?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1cmwiOiJzdGF0aWMvaW1hZ2VzL2xhbmRpbmcvY2Fycm9zc2VsL2xhbmRpbmdfY2Fycm9zc2VsMi5zdmciLCJpYXQiOjE3MjQ0MzU3MzAsImV4cCI6MjAzOTc5NTczMH0.31C7vtc4Tht7IAXzzllUt50IDo0niKEUzEw82CejFYs&t=2024-08-23T17%3A55%3A30.678Z" />
<.supabase_image src="reduced_images/landing/carrossel/landing_carrossel2.webp" />
</li>
<li class="glide__slide">
<img src="https://rrosgcmviafnxjshljoq.supabase.co/storage/v1/object/sign/static/images/landing/carrossel/landing_carrossel3.svg?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1cmwiOiJzdGF0aWMvaW1hZ2VzL2xhbmRpbmcvY2Fycm9zc2VsL2xhbmRpbmdfY2Fycm9zc2VsMy5zdmciLCJpYXQiOjE3MjQ0MzU3NTEsImV4cCI6MjAzOTc5NTc1MX0.8cK8reFXk6ie0mf_eDYGT86zRzFygEiuuOAsofjNfKI&t=2024-08-23T17%3A55%3A51.737Z" />
<.supabase_image src="reduced_images/landing/carrossel/landing_carrossel3.webp" />
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Adicione texto alternativo para todas as imagens

Para melhorar a acessibilidade do site, é importante adicionar descrições adequadas para todas as imagens usando o atributo alt. Isso ajuda usuários que utilizam leitores de tela e melhora o SEO.

Exemplo para o carrossel:

-            <.supabase_image src="reduced_images/landing/carrossel/landing_carrossel1.webp" />
+            <.supabase_image 
+              src="reduced_images/landing/carrossel/landing_carrossel1.webp"
+              alt="Primeira imagem do carrossel da página inicial"
+            />

Aplique o mesmo padrão para todas as outras imagens, fornecendo descrições específicas e significativas para cada contexto.

Referência: Guia de Acessibilidade Web do W3C

Also applies to: 20-23, 39-39, 48-48, 57-57, 66-66, 75-75, 84-84, 93-93, 122-122, 155-155, 180-180, 206-206, 231-231, 258-258, 283-283, 308-308, 339-345

@@ -81,7 +81,7 @@
</DesignSystem.link>
</div>
<div class="links-item">
<img src="https://rrosgcmviafnxjshljoq.supabase.co/storage/v1/object/sign/static/images/landing/landing_card_pgtr.JPG?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1cmwiOiJzdGF0aWMvaW1hZ2VzL2xhbmRpbmcvbGFuZGluZ19jYXJkX3BndHIuSlBHIiwiaWF0IjoxNzI0Mzc0OTk5LCJleHAiOjIwMzk3MzQ5OTl9.c5oxVdvtd2slsO5qguXEscJizkJkw9c09fwuZ0TcGVY&t=2024-08-23T01%3A03%3A19.718Z" />
<.supabase_image src="reduced_images/landing/landing_card_pgtr.webp" />
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Corrigir caminho duplicado da imagem

O caminho da imagem reduced_images/landing/landing_card_pgtr.webp está sendo usado tanto para o card de PGTR quanto para o card de NAIPA, o que parece ser um erro.

-      <.supabase_image src="reduced_images/landing/landing_card_pgtr.webp" />
+      <.supabase_image src="reduced_images/landing/landing_card_naipa.webp" />
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<.supabase_image src="reduced_images/landing/landing_card_pgtr.webp" />
<.supabase_image src="reduced_images/landing/landing_card_naipa.webp" />

attr :class, :string, default: "", doc: "the image class"

def supabase_image(assigns) do
IO.inspect(assigns.src)
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remova a declaração de debug

A função IO.inspect/1 deve ser removida pois não é adequada para código em produção.

-    IO.inspect(assigns.src)

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