-
Notifications
You must be signed in to change notification settings - Fork 3
Feature/claude #613
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
base: homol
Are you sure you want to change the base?
Feature/claude #613
Changes from all commits
fc45073
4feb01c
8aee2cc
da10246
5e19c1f
7cb13cf
a8bb01d
060008a
e383b6c
4a3359c
41870d2
2c0fa9e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,4 +9,4 @@ openapitools.json | |
| .DS_Store | ||
|
|
||
| .vscode/settings.json | ||
| .claude/ | ||
| /.claude/ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Deveria ser uma SKILL |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
| ## Formulários | ||
|
|
||
| ### Schema Yup | ||
|
|
||
| - Schemas ficam em `src/consts/formSchemas/<entidade>.ts` | ||
| - Importar primitivos de `./initSchema` (não direto do `yup`): | ||
| ```ts | ||
| import { | ||
| object, | ||
| string, | ||
| number, | ||
| array, | ||
| boolean, | ||
| date, | ||
| mixed, | ||
| } from "./initSchema"; | ||
| ``` | ||
| - Sempre usar `.label('Nome do Campo')` em cada campo — o `SmaeLabel` extrai isso automaticamente | ||
| - Campos opcionais: `.nullable()` ou `.nullableOuVazio()` | ||
| - Campos condicionais: `.when('outro_campo', { is: ..., then: ..., otherwise: ... })` | ||
| - Exportar como named export: `export const minhaEntidadeSchema = object().shape({ ... })` | ||
| - Schemas em `formSchemas/` separados **não** precisam ser registrados em `formSchemas.js` — são importados diretamente na view | ||
|
Comment on lines
+5
to
+22
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Check if schemas are centralized in formSchemas.js or distributed in separate files
echo "=== Schemas exported from formSchemas.js ==="
rg -n "^export const \w+ = " frontend/src/consts/formSchemas.js | head -20
echo ""
echo "=== Separate schema files in formSchemas/ directory ==="
fd -e ts -e js . frontend/src/consts/formSchemas/
echo ""
echo "=== How views import schemas ==="
rg -n "from ['\"]@/consts/formSchemas" frontend/src/views/ -A 0 | head -20Repository: AppCivico/smae Length of output: 4494 🏁 Script executed: #!/bin/bash
# Check if separate schema files are imported anywhere in the codebase
echo "=== Searching for imports of separate schema files ==="
rg "from ['\"].*formSchemas/(buscaLivre|demanda|metasLista|tarefa|InformarPreviaIndicador)" --type ts --type tsx --type js --type vue -A 0
echo ""
echo "=== Check if formSchemas.js imports from separate schema files ==="
rg "from ['\"].*formSchemas/(buscaLivre|demanda|metasLista|tarefa)" frontend/src/consts/formSchemas.js
echo ""
echo "=== Content of one separate schema file for context ==="
head -30 frontend/src/consts/formSchemas/demanda.tsRepository: AppCivico/smae Length of output: 1188 🏁 Script executed: #!/bin/bash
# Check full formSchemas.js for any imports or references to separate files
echo "=== Check full formSchemas.js imports section ==="
head -100 frontend/src/consts/formSchemas.js | grep -E "^import|^export"
echo ""
echo "=== Line count of formSchemas.js ==="
wc -l frontend/src/consts/formSchemas.js
echo ""
echo "=== Check if formSchemas/ files are mentioned anywhere in formSchemas.js ==="
rg "formSchemas/(buscaLivre|demanda|metasLista|tarefa|InformarPreviaIndicador)" frontend/src/consts/formSchemas.jsRepository: AppCivico/smae Length of output: 1838 🏁 Script executed: #!/bin/bash
# Check if separate schema files have recent changes or are intentionally separated
echo "=== Check git status of separate schema files ==="
git log -1 --oneline frontend/src/consts/formSchemas/demanda.ts frontend/src/consts/formSchemas/tarefa.ts frontend/src/consts/formSchemas/metasLista.ts 2>/dev/null | head -10
echo ""
echo "=== Check if there are any TODOs or comments in demanda.ts about usage ==="
head -5 frontend/src/consts/formSchemas/demanda.tsRepository: AppCivico/smae Length of output: 424 Documentation contradicts actual schema registration practice—remove misleading guidance. The documentation at line 21–22 states that schemas in separate
Remove the incorrect claim on line 21–22. The actual pattern requires all schemas to be defined in and exported from 🧰 Tools🪛 LanguageTool[uncategorized] ~21-~21: Se é uma abreviatura, falta um ponto. Se for uma expressão, coloque entre aspas. (ABREVIATIONS_PUNCTUATION) 🤖 Prompt for AI Agents
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Veja essa, @GustavoFSoares .
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these files are been using. |
||
|
|
||
| ### Componente CriarEditar.vue | ||
|
|
||
| Local: `src/views/<modulo>/<Entidade>CriarEditar.vue` | ||
|
|
||
| **Padrão com `useForm`** — formulários complexos (arrays dinâmicos, watches, valores computados): | ||
|
|
||
| ```vue | ||
| <script lang="ts" setup> | ||
| import { storeToRefs } from "pinia"; | ||
| import { | ||
| ErrorMessage, | ||
| Field, | ||
| FieldArray, | ||
| useForm, | ||
| useIsFormDirty, | ||
| } from "vee-validate"; | ||
| import { onMounted, watch } from "vue"; | ||
| import { useRouter } from "vue-router"; | ||
|
|
||
| import { minhaEntidadeSchema as schema } from "@/consts/formSchemas/minhaEntidade"; | ||
| import escaparDaRota from "@/helpers/escaparDaRota"; | ||
| import { useMinhaEntidadeStore } from "@/stores/minhaEntidade.store"; | ||
|
|
||
| const router = useRouter(); | ||
|
|
||
| const props = defineProps<{ minhaEntidadeId?: number | null }>(); | ||
| const minhaEntidadeStore = useMinhaEntidadeStore(); | ||
| const { emFoco } = storeToRefs(minhaEntidadeStore); | ||
|
|
||
| const { errors, handleSubmit, isSubmitting, resetForm } = useForm({ | ||
| initialValues: emFoco, | ||
| validationSchema: schema, | ||
| }); | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| const formularioSujo = useIsFormDirty(); | ||
|
|
||
| const onSubmit = handleSubmit.withControlled(async (carga) => { | ||
| await minhaEntidadeStore.salvarItem(carga, props.minhaEntidadeId); | ||
|
|
||
| minhaEntidadeStore.$reset(); | ||
| escaparDaRota(router); | ||
| }); | ||
|
|
||
| onMounted(() => { | ||
| if (props.minhaEntidadeId) | ||
| minhaEntidadeStore.buscarItem(props.minhaEntidadeId); | ||
| }); | ||
|
|
||
| watch(emFoco, (novosValores) => { | ||
| resetForm({ values: novosValores }); | ||
| }); | ||
| </script> | ||
|
|
||
| <template> | ||
| <CabecalhoDePagina :formulario-sujo="formularioSujo" /> | ||
|
|
||
| <form class="flex column g2" @submit="onSubmit"> | ||
| <!-- campos aqui --> | ||
|
|
||
| <SmaeFieldsetSubmit :disabled="isSubmitting" :erros="errors" /> | ||
| </form> | ||
| </template> | ||
| ``` | ||
|
|
||
| > **Atenção:** O padrão com `<Form>` wrapper do vee-validate **não deve ser usado** neste projeto. Sempre use o padrão com `useForm` acima, independentemente da complexidade do formulário. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Search for any existing usage of vee-validate <Form> wrapper in the codebase
echo "=== Searching for <Form> component from vee-validate ==="
rg -n '<Form' frontend/src/views/ -A 2 -B 1
echo ""
echo "=== Searching for Form imports from vee-validate ==="
rg -n "import.*Form.*from ['\"]vee-validate['\"]" frontend/src/Repository: AppCivico/smae Length of output: 50370 Update documentation: The documentation states that the Update the documentation to reflect when each pattern ( 🤖 Prompt for AI Agents
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bom ponto. Você pode deixar claro que o uso de
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
✏️ Learnings added
🧠 Learnings used
|
||
|
|
||
| ### Componentes de campo (globais) | ||
|
|
||
| | Componente | Uso | | ||
| | ----------------------------------------------------------------- | ------------------------------------------ | | ||
| | `<SmaeLabel name="campo" :schema="schema" />` | Label com asterisco automático se required | | ||
| | `<Field name="campo" type="text" class="inputtext light" />` | Input de texto padrão | | ||
| | `<Field name="campo" as="select" class="inputtext light">` | Select | | ||
| | `<ErrorMessage name="campo" class="error-msg" />` | Mensagem de erro inline | | ||
| | `<SmaeText name="campo" :schema="schema" />` | Textarea/input com contador de caracteres | | ||
| | `<SmaeDateInput name="campo" />` | Datepicker | | ||
| | `<SmaeNumberInput name="campo" />` | Input numérico | | ||
| | `<AutocompleteField2 name="campo" :grupo="lista" label="nome" />` | Autocomplete multi-select | | ||
| | `<FieldArray name="array" v-slot="{ fields, push, remove }">` | Array dinâmico de campos | | ||
| | `<FormErrorsList :errors="errors" />` | Lista todos os erros do formulário | | ||
| | `<SmaeFieldsetSubmit :disabled="isSubmitting" />` | Botão salvar padronizado | | ||
| | `<CabecalhoDePagina :formulario-sujo="formularioSujo" />` | Cabeçalho com botão de fechar | | ||
|
|
||
| ### Classes CSS utilitárias | ||
|
|
||
| - `flex g2` — flex com gap | ||
| - `f1` — flex: 1 (ocupa espaço disponível) | ||
| - `inputtext light` — estilo padrão de input | ||
| - `error-msg` — estilo de mensagem de erro | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Não é melhor excluir só o
MEMORY.md?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
acho que está certo. Esse é o claude do projeto todo, o do nosso projeto ele ignora
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Então... Ele não deveria ignorar. Deveria?!