Tasks completed: 2/2 - PostCard regen button with inline form, topic override, badge - OutputReview summary counter with regenerated/edited tracking SUMMARY: .planning/phases/02-prompt-control-output-review/02-02-SUMMARY.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
5.1 KiB
5.1 KiB
phase, plan, subsystem, tags, dependency_graph, tech_stack, key_files, decisions, metrics
| phase | plan | subsystem | tags | dependency_graph | tech_stack | key_files | decisions | metrics | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 02-prompt-control-output-review | 02 | output-review |
|
|
|
|
|
|
Phase 02 Plan 02: Per-item Regeneration + Summary Counter Summary
PostCard con bottone Rigenera inline, form popover per topic/note override, badge rigenerato amber, e summary counter real-time in OutputReview con tracking rigenerati/modificati.
What Was Done
Task 1: PostCard — bottone Rigenera con popover inline, topic override, badge rigenerato
Modified frontend/src/components/PostCard.tsx:
- New prop
isRegenerated— When true, shows an amberRefreshCwicon badge next to the slot number, visually distinguishing regenerated posts from originals. handleRegenfunction — CallsPOST /api/generate/singlewith optional topic override (viaslot.topic) and notes override (viatonofield). On success, callsonRegeneratedcallback and resets the form.- Regen button in card header — Small
RefreshCwicon button positioned before the expand/collapse chevron. Usese.stopPropagation()to not interfere with expand toggle. - Inline popover form — Appears below the header (above SlideViewer) when Regen button is clicked. Contains:
- Optional "Topic alternativo" text input
- Optional "Note aggiuntive" text input
- "Rigenera" button (amber, with spinner during loading)
- "Annulla" button to close and reset form
- Error message display if generation fails
- Header refactored — Changed from a single
<button>to a<div>with separate click zones: the content area expands/collapses, the regen button opens the form, and the chevron also expands/collapses.
Task 2: OutputReview — summary counter con tracking rigenerati/modificati
Modified frontend/src/pages/OutputReview.tsx:
regeneratedSlotsstate —Set<number>tracking slot indices of regenerated posts. Updated inhandleRegenerated.regeneratedCount— Derived fromregeneratedSlots.size.manuallyEditedCount— Counts posts whosepostfield differs fromjobData.results(original server data) viaJSON.stringifycomparison, minus regenerated posts to avoid double-counting.- Summary counter in header — Shows:
N post | X generati | Y falliti | Z rigenerati | W modificati | job: ID. Regenerated and modified counts only appear when > 0. Uses amber color for regenerated (with RefreshCw icon) and blue for manually edited. isRegeneratedprop passed to PostCard — Each PostCard receivesregeneratedSlots.has(result.slot_index).- Updated info box — Now mentions the regen feature with an inline RefreshCw icon.
Deviations from Plan
None - plan executed exactly as written.
Verification
- PostCard success shows a Regen button (RefreshCw icon) in the header
- Click on Regen opens inline form with topic and notes fields (both optional)
- Regeneration calls POST /api/generate/single with topic/tono override and updates the card
- Regenerated posts show an amber RefreshCw badge next to the slot number
- Summary counter in OutputReview header shows counts for generati/falliti/rigenerati/modificati
- Summary counter updates in real-time after regeneration or edit
- CSV download contains latest versions (localResults updated by both regen and edit)
- TypeScript compiles without errors (npx tsc --noEmit)
Next Phase Readiness
Phase 02 is now COMPLETE. Both plans (02-01 Prompt CRUD + Prompt Editor, 02-02 Per-item Regeneration + Summary Counter) are done. The system is ready for:
vps-lab-deployto test end-to-end on VPS- Phase 03 (Canva-ready CSV polish + advanced export)