Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ QuickLintAI/
> 📥 **Para instalação detalhada**: Consulte o [**Guia Completo de Instalação**](docs/INSTALLATION.md) com instruções específicas para Linux, Windows e macOS.

> ✅ **Story #000 Concluída**: O header com sistema de temas e layout base já estão implementados e funcionais!
> ✅ **Story #001 Concluída**: Editor de código com Monaco integrado e validação de caracteres.

### Pré-requisitos

Expand Down Expand Up @@ -143,7 +144,12 @@ dotnet run
- ⚡ **Base sólida** estabelecida para desenvolvimento das próximas features
- 🚀 **Aplicação rodando** em http://localhost:3000

**Próximo marco**: Story #001 - Monaco Editor Setup
### ✅ **Fevereiro 2025 - Story #001 Concluída**
- 📝 **CodeEditor** implementado com Monaco Editor
- 🔢 **Validação de 1024 caracteres** integrada
- 🌓 **Suporte a temas claro/escuro**

**Próximo marco**: Story #002 - Seletor de Perfil

### 🧠 Perfis de Análise

Expand Down Expand Up @@ -185,7 +191,7 @@ Acompanhe o desenvolvimento incremental do projeto através das stories:
| Story | Título | Tipo | Prioridade | Status | Descrição |
|-------|--------|------|------------|--------|-----------|
| [#000](docs/stories/000-setup-inicial-header.md) | Setup Inicial e Header | Infraestrutura | Alta | ✅ Concluída | Header com nome do app e seleção de tema |
| [#001](docs/stories/001-monaco-editor-setup.md) | Editor de Código Monaco | Funcionalidade | Alta | 📋 Planejada | Editor com syntax highlighting e validação |
| [#001](docs/stories/001-monaco-editor-setup.md) | Editor de Código Monaco | Funcionalidade | Alta | ✅ Concluída | Editor com syntax highlighting e validação |
| [#002](docs/stories/002-profile-selector.md) | Seletor de Perfil | Funcionalidade | Alta | 📋 Planejada | Escolha entre análise Rigorosa/Flexível |
| [#003](docs/stories/003-backend-api-feedback.md) | API Backend Feedback | Funcionalidade | Alta | 📋 Planejada | Endpoint de análise com integração IA |
| [#004](docs/stories/004-diff-viewer-component.md) | Visualizador de Diff | Funcionalidade | Alta | 📋 Planejada | Comparação lado a lado de código |
Expand All @@ -197,16 +203,16 @@ Acompanhe o desenvolvimento incremental do projeto através das stories:
| [#009](docs/stories/009-prompt-debugging-panel.md) | Painel de Debugging | Funcionalidade | Baixa | 📋 Planejada | Visualização de prompts enviados |

### 📊 Status das Stories
- 📋 **Planejada**: 9 stories
- 🔄 **Em Andamento**: 0 stories
- ✅ **Concluída**: 1 story
- 📋 **Planejada**: 8 stories
- 🔄 **Em Andamento**: 0 stories
- ✅ **Concluída**: 2 stories
- ❌ **Cancelada**: 0 stories

### 🎯 Próximas Prioridades
1. **Story #001** - Implementar editor Monaco com syntax highlighting
2. **Story #002** - Adicionar seleção de perfil de análise
3. **Story #003** - Desenvolver API backend com IA
4. **Story #004** - Visualizador de diff lado a lado
1. **Story #002** - Adicionar seleção de perfil de análise
2. **Story #003** - Desenvolver API backend com IA
3. **Story #004** - Visualizador de diff lado a lado
4. **Story #005** - Integração completa

> 💡 **Dica**: Cada story é independente e pode ser desenvolvida incrementalmente. Consulte os arquivos individuais para detalhes técnicos completos.

Expand Down
1 change: 1 addition & 0 deletions src/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"devDependencies": {
"@eslint/eslintrc": "^3",
"@tailwindcss/postcss": "^4",
"@types/monaco-editor": "^0.44.16",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default function HomePage() {
{/* Status Badge */}
<div className="flex items-center gap-2 text-sm text-muted-foreground">
<div className="h-2 w-2 bg-orange-500 rounded-full animate-pulse"></div>
<span>Em desenvolvimento - Story #000 concluída</span>
<span>Em desenvolvimento - Story #001 concluída</span>
</div>
</div>
</div>
Expand Down
73 changes: 73 additions & 0 deletions src/frontend/src/components/features/code-editor.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import { Editor } from '@monaco-editor/react'
import { useCallback } from 'react'
import { Badge } from '@/components/ui/badge'
import { Alert, AlertDescription } from '@/components/ui/alert'
import type { Language } from '@/types/editor'

interface CodeEditorProps {
language: Language
value: string
onChange: (value: string) => void
maxLength?: number
placeholder?: string
theme?: 'light' | 'dark'
}

export function CodeEditor({
language,
value,
onChange,
maxLength = 1024,
placeholder = 'Cole seu código aqui...',
Copy link

Copilot AI Jul 24, 2025

Choose a reason for hiding this comment

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

The placeholder text is in Portuguese while other parts of the codebase use English. This should be consistent with the project's internationalization approach as defined in the Style Guide.

Copilot generated this review using guidance from repository custom instructions.
theme = 'light',
}: CodeEditorProps) {
const handleEditorChange = useCallback(
(val: string | undefined) => {
const newValue = val || ''
onChange(newValue)
},
[onChange],
)

const isOverLimit = value.length > maxLength
const remainingChars = maxLength - value.length

return (
<div className="space-y-4">
<div className="relative">
<Editor
height="400px"
language={language}
value={value}
onChange={handleEditorChange}
options={{
minimap: { enabled: false },
fontSize: 14,
fontFamily: 'Fira Code, Monaco, monospace',
wordWrap: 'on',
scrollBeyondLastLine: false,
automaticLayout: true,
lineNumbers: 'on',
renderWhitespace: 'boundary',
}}
theme={theme === 'dark' ? 'vs-dark' : 'vs-light'}
placeholder={placeholder}
/>
</div>

<div className="flex justify-between items-center">
<Badge variant={isOverLimit ? 'destructive' : 'secondary'}>
{value.length}/{maxLength} caracteres
Copy link

Copilot AI Jul 24, 2025

Choose a reason for hiding this comment

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

The character count display uses Portuguese ('caracteres'). For consistency with the Style Guide's internationalization requirements, consider using English or implementing proper i18n support.

Copilot generated this review using guidance from repository custom instructions.
</Badge>

{isOverLimit && (
<Alert className="w-auto">
<AlertDescription>
Limite excedido em {Math.abs(remainingChars)} caracteres
Copy link

Copilot AI Jul 24, 2025

Choose a reason for hiding this comment

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

The error message is in Portuguese. According to the Style Guide's consistency requirements, this should use English or proper i18n implementation to match the project's internationalization approach.

Copilot generated this review using guidance from repository custom instructions.
</AlertDescription>
</Alert>
)}
</div>
</div>
)
}
64 changes: 64 additions & 0 deletions src/frontend/src/hooks/use-code-editor.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import { useState, useCallback, useMemo } from 'react'
import type { Language, CodeEditorState } from '@/types/editor'

interface UseCodeEditorProps {
initialValue?: string
initialLanguage?: Language
maxLength?: number
}

export function useCodeEditor({
initialValue = '',
initialLanguage = 'javascript',
maxLength = 1024,
}: UseCodeEditorProps = {}) {
const [state, setState] = useState<CodeEditorState>({
value: initialValue,
language: initialLanguage,
isValid: initialValue.length <= maxLength,
characterCount: initialValue.length,
})

const updateValue = useCallback(
(value: string) => {
setState(prev => ({
...prev,
value,
characterCount: value.length,
isValid: value.length <= maxLength,
}))
},
[maxLength],
)

const updateLanguage = useCallback((language: Language) => {
setState(prev => ({ ...prev, language }))
}, [])

const validation = useMemo(
() => ({
isValid: state.isValid,
isOverLimit: state.characterCount > maxLength,
remainingChars: maxLength - state.characterCount,
errorMessage:
state.characterCount > maxLength
? `Código excede o limite em ${state.characterCount - maxLength} caracteres`
Copy link

Copilot AI Jul 24, 2025

Choose a reason for hiding this comment

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

The error message is in Portuguese while the rest of the codebase appears to use English. According to the Style Guide requirements for consistent internationalization, consider using English or implementing proper i18n support.

Copilot generated this review using guidance from repository custom instructions.
: null,
}),
[state.isValid, state.characterCount, maxLength],
)

return {
...state,
validation,
updateValue,
updateLanguage,
reset: () =>
setState({
value: '',
language: initialLanguage,
isValid: true,
characterCount: 0,
}),
}
}
16 changes: 16 additions & 0 deletions src/frontend/src/types/common.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export type Language = 'javascript' | 'typescript' | 'csharp'
export type FeedbackProfile = 'flexible' | 'rigorous'

export interface EditorConfig {
Copy link

Copilot AI Jul 24, 2025

Choose a reason for hiding this comment

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

The EditorConfig and CodeEditorState interfaces are duplicated between common.ts and editor.ts. This violates the DRY principle and can lead to inconsistencies. Consider keeping these interfaces only in common.ts and importing them in editor.ts.

Copilot uses AI. Check for mistakes.
language: Language
theme: 'vs-light' | 'vs-dark'
fontSize: number
maxLength: number
}

export interface CodeEditorState {
value: string
language: Language
isValid: boolean
characterCount: number
}
15 changes: 15 additions & 0 deletions src/frontend/src/types/editor.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export type { Language, FeedbackProfile } from './common'

export interface EditorConfig {
language: Language
theme: 'vs-light' | 'vs-dark'
fontSize: number
maxLength: number
}

export interface CodeEditorState {
value: string
language: Language
isValid: boolean
characterCount: number
}