fix: improve analyst report markdown readability

This commit is contained in:
thibaud-lclr 2026-04-21 16:41:33 +02:00
parent ee9d00efa4
commit ae9b4c1474
3 changed files with 126 additions and 2 deletions

View file

@ -51,6 +51,41 @@ pub fn build_analyst_prompt(ticket: &ProcessedTicket, project: &Project) -> Stri
3. Evalue si une correction de code est necessaire
4. Produis un rapport structure en markdown
## Format de sortie obligatoire
- Ecris un rapport en markdown avec des titres, des sous-titres et des listes.
- Laisse une ligne vide entre chaque section.
- Mets les labels importants en gras (ex: **Impact**, **Cause racine**).
- Evite les gros paragraphes: maximum 4 lignes par paragraphe.
- Respecte cette structure:
# Analyse ticket #{artifact_id} - {title}
## Resume executif
- **Constat:**
- **Impact:**
- **Urgence:**
## Diagnostic technique
### Cause racine
...
### Indices observables
- ...
## Zone de code probable
- `chemin/fichier.ext` - justification
## Plan de correction
1. ...
2. ...
## Risques et validations
- **Risques:**
- **Tests a executer:**
## Conclusion
- **Decision:** FIX_NEEDED ou NO_FIX
- **Rationale courte:** ...
Termine ton rapport par un de ces verdicts sur une ligne separee:
[VERDICT: FIX_NEEDED] si une correction de code est necessaire
[VERDICT: NO_FIX] si aucune correction n'est necessaire"#,

View file

@ -492,13 +492,13 @@ export default function TicketDetail() {
)}
{tab === "analyst" && ticket.analyst_report && (
<div className="prose prose-sm max-w-none rounded-lg border border-gray-200 bg-white p-6">
<div className="markdown-report rounded-lg border border-gray-200 bg-white p-6">
<Markdown remarkPlugins={[remarkGfm]}>{ticket.analyst_report}</Markdown>
</div>
)}
{tab === "developer" && ticket.developer_report && (
<div className="prose prose-sm max-w-none rounded-lg border border-gray-200 bg-white p-6">
<div className="markdown-report rounded-lg border border-gray-200 bg-white p-6">
<Markdown remarkPlugins={[remarkGfm]}>{ticket.developer_report}</Markdown>
</div>
)}

View file

@ -24,3 +24,92 @@
cursor: not-allowed;
}
}
.markdown-report {
color: #111827;
line-height: 1.6;
font-size: 0.95rem;
}
.markdown-report > :first-child {
margin-top: 0;
}
.markdown-report > :last-child {
margin-bottom: 0;
}
.markdown-report h1,
.markdown-report h2,
.markdown-report h3,
.markdown-report h4 {
color: #0f172a;
font-weight: 700;
line-height: 1.3;
margin-top: 1.25rem;
margin-bottom: 0.65rem;
}
.markdown-report h1 {
font-size: 1.35rem;
}
.markdown-report h2 {
border-bottom: 1px solid #e5e7eb;
font-size: 1.15rem;
padding-bottom: 0.2rem;
}
.markdown-report h3 {
font-size: 1rem;
}
.markdown-report p {
margin: 0.6rem 0;
white-space: pre-wrap;
}
.markdown-report ul,
.markdown-report ol {
margin: 0.55rem 0 0.8rem;
padding-left: 1.3rem;
}
.markdown-report ul {
list-style: disc;
}
.markdown-report ol {
list-style: decimal;
}
.markdown-report li {
margin: 0.25rem 0;
}
.markdown-report strong {
color: #0f172a;
font-weight: 700;
}
.markdown-report code {
background: #f3f4f6;
border-radius: 0.3rem;
font-size: 0.85em;
padding: 0.1rem 0.3rem;
}
.markdown-report pre {
background: #111827;
border-radius: 0.5rem;
color: #f9fafb;
margin: 0.7rem 0;
overflow-x: auto;
padding: 0.75rem;
}
.markdown-report pre code {
background: transparent;
color: inherit;
padding: 0;
}