From b8a2e67f3a89253d90b83792140ca56ed46a5274 Mon Sep 17 00:00:00 2001 From: killer-cf Date: Sat, 22 Nov 2025 10:25:43 -0300 Subject: [PATCH] refactor: Update email configuration page to load data once and improve error handling, and add Svelte agent rules documentation. --- .agent/rules/svelte-rules.md | 28 + .../ti/configuracoes-email/+page.svelte | 1034 ++++++++--------- 2 files changed, 530 insertions(+), 532 deletions(-) create mode 100644 .agent/rules/svelte-rules.md diff --git a/.agent/rules/svelte-rules.md b/.agent/rules/svelte-rules.md new file mode 100644 index 0000000..30b100a --- /dev/null +++ b/.agent/rules/svelte-rules.md @@ -0,0 +1,28 @@ +--- +trigger: glob +globs: **/*.svelte.ts,**/*.svelte +--- + +You are able to use the Svelte MCP server, where you have access to comprehensive Svelte 5 and SvelteKit documentation. Here's how to use the available tools effectively: + +## Available MCP Tools: + +### 1. list-sections + +Use this FIRST to discover all available documentation sections. Returns a structured list with titles, use_cases, and paths. +When asked about Svelte or SvelteKit topics, ALWAYS use this tool at the start of the chat to find relevant sections. + +### 2. get-documentation + +Retrieves full documentation content for specific sections. Accepts single or multiple sections. +After calling the list-sections tool, you MUST analyze the returned documentation sections (especially the use_cases field) and then use the get-documentation tool to fetch ALL documentation sections that are relevant for the user's task. + +### 3. svelte-autofixer + +Analyzes Svelte code and returns issues and suggestions. +You MUST use this tool whenever writing Svelte code before sending it to the user. Keep calling it until no issues or suggestions are returned. + +### 4. playground-link + +Generates a Svelte Playground link with the provided code. +After completing the code, ask the user if they want a playground link. Only call this tool after user confirmation and NEVER if code was written to files in their project. diff --git a/apps/web/src/routes/(dashboard)/ti/configuracoes-email/+page.svelte b/apps/web/src/routes/(dashboard)/ti/configuracoes-email/+page.svelte index 15a7f1a..3e316e6 100644 --- a/apps/web/src/routes/(dashboard)/ti/configuracoes-email/+page.svelte +++ b/apps/web/src/routes/(dashboard)/ti/configuracoes-email/+page.svelte @@ -1,574 +1,544 @@ -
- -
-
-
- - - -
-
-

- Configurações de Email (SMTP) -

-

- Configurar servidor de email para envio de notificações -

-
-
-
+
+ +
+
+
+ + + +
+
+

Configurações de Email (SMTP)

+

+ Configurar servidor de email para envio de notificações +

+
+
+
- - {#if mensagem} -
- - {#if mensagem.tipo === "success"} - - {:else} - - {/if} - - {mensagem.texto} -
- {/if} + + {#if mensagem} +
+ + {#if mensagem.tipo === 'success'} + + {:else} + + {/if} + + {mensagem.texto} +
+ {/if} - - {#if isLoading} -
- - Carregando configurações... -
- {/if} + + {#if isLoading} +
+ + Carregando configurações... +
+ {/if} - - {#if !isLoading} -
- - {#if configAtual?.data?.ativo} - - {:else} - - {/if} - - - Status: - {statusConfig} - {#if configAtual?.data?.testadoEm} - - Última conexão testada em {new Date( - configAtual.data.testadoEm, - ).toLocaleString("pt-BR")} - {/if} - -
- {/if} + + {#if !isLoading} +
+ + {#if configAtual?.data?.ativo} + + {:else} + + {/if} + + + Status: + {statusConfig} + {#if configAtual?.data?.testadoEm} + - Última conexão testada em {new Date(configAtual.data.testadoEm).toLocaleString('pt-BR')} + {/if} + +
+ {/if} - - {#if !isLoading} -
-
-

Dados do Servidor SMTP

+ + {#if !isLoading} +
+
+

Dados do Servidor SMTP

-
- -
- - -
- Ex: smtp.gmail.com, smtp.office365.com -
-
+
+ +
+ + +
+ Ex: smtp.gmail.com, smtp.office365.com +
+
- -
- - -
- Comum: 587 (TLS), 465 (SSL), 25 -
-
+ +
+ + +
+ Comum: 587 (TLS), 465 (SSL), 25 +
+
- -
- - -
+ +
+ + +
- -
- - -
- - {#if configAtual?.data?.ativo} - Deixe em branco para manter a senha atual - {:else} - Digite a senha da conta de email - {/if} - -
-
+ +
+ + +
+ + {#if configAtual?.data?.ativo} + Deixe em branco para manter a senha atual + {:else} + Digite a senha da conta de email + {/if} + +
+
- -
- - -
+ +
+ + +
- -
- - -
-
+ +
+ + +
+
- -
-

Configurações de Segurança

+ +
+

Configurações de Segurança

-
-
- -
+
+
+ +
-
- -
-
+
+ +
+
- -
- + +
+ - -
-
-
- {/if} + +
+
+
+ {/if} - -
-
-

Exemplos de Configuração

+ +
+
+

Exemplos de Configuração

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ProvedorServidorPortaSegurança
Gmailsmtp.gmail.com587TLS
Outlook/Office365smtp.office365.com587TLS
Yahoosmtp.mail.yahoo.com465SSL
SendGridsmtp.sendgrid.net587TLS
-
-
-
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ProvedorServidorPortaSegurança
Gmailsmtp.gmail.com587TLS
Outlook/Office365smtp.office365.com587TLS
Yahoosmtp.mail.yahoo.com465SSL
SendGridsmtp.sendgrid.net587TLS
+
+
+
- -
- - - -
-

- Dica de Segurança: Para Gmail e outros provedores, você - pode precisar gerar uma "senha de app" específica em vez de usar sua senha - principal. -

-

- Gmail: Conta Google → Segurança → Verificação em duas etapas → Senhas de - app -

-
-
+ +
+ + + +
+

+ Dica de Segurança: Para Gmail e outros provedores, você pode precisar gerar + uma "senha de app" específica em vez de usar sua senha principal. +

+

+ Gmail: Conta Google → Segurança → Verificação em duas etapas → Senhas de app +

+
+