Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughCe PR effectue une refonte majeure du module budgétaire : renomme « Moyens » en « Budget », restructure les tables de notes et financeurs avec gestion des brouillons par contexte, introduit une stratégie d'ouverture forcée des sélecteurs (forceOpenSelect) et améliore la composition des formulaires avec des cellules de table spécialisées. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant NotesUI as Notes Table UI
participant NoteFormProvider as NoteFormProvider<br/>(Context)
participant Form as React Hook Form
participant API as API Backend
User->>NotesUI: Ouvre la table des notes
NotesUI->>NoteFormProvider: Render avec fiche prop
NoteFormProvider->>Form: Initialise form avec defaultValues<br/>(dateNote, description)
NotesUI->>User: Affiche table avec cellules
User->>NotesUI: Clique pour éditer année
NotesUI->>NoteFormProvider: Déclenche NoteYearCell edit
NoteFormProvider->>Form: Controller observe 'year'
Form->>User: Affiche Select des années
User->>Form: Sélectionne année
Form->>Form: Met à jour champ 'year'
Form->>NoteFormProvider: onChange trigger
NoteFormProvider->>NoteFormProvider: submitNote appelé
NoteFormProvider->>API: onUpsertNote({ dateNote, note })
API->>API: Valide et persiste
API-->>NoteFormProvider: Succès
NoteFormProvider->>User: Affiche résultat mis à jour
sequenceDiagram
participant User
participant FinanceursUI as Financeurs Table UI
participant Draft as useDraftFinanceurs
participant Storage as localStorage
participant FinanceurFormProvider as FinanceurFormProvider<br/>(Context)
participant API as API Backend
User->>FinanceursUI: Ouvre table des financeurs
Draft->>Storage: Récupère brouillons persistants
Storage-->>Draft: Retourne draftFinanceurs
FinanceursUI->>FinanceursUI: Combine financeurs + brouillons
User->>FinanceursUI: Clique "Ajouter un financeur"
FinanceursUI->>Draft: handleCreateDraftFinanceur()
Draft->>Storage: Sauvegarde nouveau draftId
Storage-->>Draft: Confirmé
FinanceursUI->>FinanceurFormProvider: Render nouvelle ligne avec draft
User->>FinanceursUI: Édite montant du brouillon
FinanceursUI->>FinanceurFormProvider: Déclenche Controller
FinanceurFormProvider->>FinanceurFormProvider: Déclenche syncDraft
FinanceurFormProvider->>Draft: updateDraftFinanceur()
Draft->>Storage: Persiste changement
User->>FinanceursUI: Clique Enregistrer
FinanceurFormProvider->>API: onUpsertFinanceur()
API->>API: Persiste financeur
API-->>FinanceurFormProvider: Succès
FinanceurFormProvider->>Draft: deleteDraftFinanceur(draftId)
Draft->>Storage: Supprime brouillon
FinanceursUI->>User: Table mise à jour
sequenceDiagram
participant User
participant Dropdown as Dropdown Component
participant OpenState as forceOpenSelect<br/>(isOpen: true)
participant Select as Select/Controller
User->>Dropdown: Survol/Focus
Dropdown->>OpenState: Consulte isOpen
OpenState-->>Dropdown: true (toujours)
Dropdown->>Dropdown: Affiche options
User->>Select: Clique option
Select->>Select: Valeur sélectionnée
Select->>OpenState: Tente setIsOpen(false)
OpenState->>OpenState: noop (pas d'effet)
Dropdown->>Dropdown: Reste ouvert jusqu'à sélection
User->>Select: Sélection finalisée
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/app/src/plans/fiches/show-fiche/content/navigation.tabs.tsx (1)
16-19:⚠️ Potential issue | 🟠 MajorPréserver la compatibilité des liens "moyens".
Les URLs existantes avec
content=moyenstomberont sur “details” via la garde actuelle. Ajoutez une normalisation pour rediriger versbudgetet éviter une rupture de navigation.💡 Proposition de корректif
- const rawActiveTab = useSelectedLayoutSegment(); - const activeTab = - rawActiveTab && isFicheSectionId(rawActiveTab) ? rawActiveTab : 'details'; + const rawActiveTab = useSelectedLayoutSegment(); + const normalizedTab = rawActiveTab === 'moyens' ? 'budget' : rawActiveTab; + const activeTab = + normalizedTab && isFicheSectionId(normalizedTab) ? normalizedTab : 'details';Also applies to: 59-60
🤖 Fix all issues with AI agents
In `@apps/app/src/plans/fiches/show-fiche/content/notes/editable-note-row.tsx`:
- Around line 113-125: The inner TableCell (rendering a <td>) is nested inside
another TableCell causing invalid HTML; replace the inner TableCell in the
VisibleWhen block with a positioned div (keeping the same classes: "absolute
top-0 right-0 text-right border-b border-gray-5" and the
invisible/group-hover:visible wrapper) so NoteDeletionModal stays placed and
visible without creating a nested <td>; update any import/usages if needed and
ensure components MetadataNoteView, VisibleWhen, isReadonly and
NoteDeletionModal remain unchanged.
In `@apps/app/src/plans/fiches/show-fiche/content/notes/notes.view.tsx`:
- Around line 9-23: The view never resets isEditing because NotesTable doesn't
report cancel/success events; add a prop like onEditingStateChange to NotesTable
and call it from NotesTable's cancel handler and after a successful upsert, and
in NotesView pass setIsEditing (or a wrapper) into NotesTable; additionally add
a useEffect in NotesView that watches notes.list and calls setIsEditing(false)
whenever notes.list changes (so ContentLayout.Content/byPassEmptyView toggles
back appropriately).
🧹 Nitpick comments (2)
apps/app/src/plans/fiches/show-fiche/content/notes/notes.table.tsx (1)
45-45: État initial potentiellement figé si les notes arrivent en asynchrone.
Sinotesest vide au premier render puis se remplit,isAddingNoterestetrueet ouvre la ligne “nouvelle note” de façon inattendue. À valider selon le flux de données.♻️ Proposition de resynchronisation simple
-import { useState } from 'react'; +import { useEffect, useState } from 'react'; @@ - const [isAddingNote, setIsAddingNote] = useState(notes.length === 0); + const [isAddingNote, setIsAddingNote] = useState(notes.length === 0); + useEffect(() => { + setIsAddingNote(notes.length === 0); + }, [notes.length]);apps/app/src/plans/fiches/show-fiche/content/notes/notes.picto.tsx (1)
3-35: Ajouter un défaut d’accessibilité pour un SVG décoratif.Si ce picto est purement décoratif, ajoutez
aria-hidden="true"etfocusable="false"pour éviter l’annonce par les lecteurs d’écran (les props pourront toujours surcharger).♻️ Proposition de patch
export const NoteDeSuiviPicto = (props: SVGProps<SVGSVGElement>) => ( <svg xmlns="http://www.w3.org/2000/svg" width={68} height={68} fill="none" + aria-hidden="true" + focusable="false" {...props} >
apps/app/src/plans/fiches/show-fiche/content/notes/editable-note-row.tsx
Outdated
Show resolved
Hide resolved
apps/app/src/plans/fiches/show-fiche/content/notes/notes.view.tsx
Outdated
Show resolved
Hide resolved
ee15d5f to
f709d64
Compare
e6aaa51 to
ecf8328
Compare
ecf8328 to
b04f489
Compare
Summary by CodeRabbit
Nouvelles Fonctionnalités
Améliorations de l'Interface
Refactorisation