Open
Conversation
Implements timeline regeneration preview modal per Roadmap_and_DoD.md P1-1. ## Features **RegenerateModal Component** (src/components/project-v2/modals/RegenerateModal.tsx): - Shows diff before regenerating timeline (prevents data loss) - Phase count changes (added/removed) - Duration change with color coding - Cost change visualization - Manual edits warning with affected phases list - Accessible (Escape key, focus trap) - Professional gradient header **Project Store Integration**: - Add showRegenerateModal, regenerateCallback state - Replace window.confirm with modal UI - confirmRegenerate() / cancelRegenerate() methods - _performRegeneration() extracted for reuse - Auto-skip modal when no manual edits or force=true **Analytics Tracking**: - regenerate_preview_shown (tracks manual edit count) - regenerate_confirmed (tracks confirmation) - regenerate_cancelled (tracks cancellation) **PlanMode Integration**: - calculateRegenerateDiff() helper for preview - Modal rendered at component root - Triggered by regenerateTimeline() call ## Definition of Done (P1-1) ✅ Modal appears before regeneration ✅ Shows count of manual edits at risk ✅ Shows diff (phases, duration, cost) ✅ Cancel returns to current state ✅ Confirm proceeds with regeneration ✅ Modal dismisses on completion ✅ Accessible (Escape key closes) ✅ Analytics events tracked ## Files Changed - src/components/project-v2/modals/RegenerateModal.tsx (new, 264 lines) - src/stores/project-store.ts (modal state + analytics) - src/lib/analytics.ts (new event types) - src/components/project-v2/modes/PlanMode.tsx (modal integration) ## Build Status ✅ TypeScript: Passing (only pre-existing test errors) ✅ Production build: Passing (60s) ✅ Bundle size: +0.1 kB for /project route 🤖 Generated with [Claude Code](https://claude.com/claude-code)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements P1-1: Regenerate Preview Modal - Shows diff before regenerating timeline to prevent data loss (affects 90% of users per roadmap).
Features
📋 RegenerateModal Component
File:
src/components/project-v2/modals/RegenerateModal.tsx(264 lines)🔧 Project Store Integration
File:
src/stores/project-store.tsshowRegenerateModal,regenerateCallbackwindow.confirmwith modal UIforce=trueconfirmRegenerate()- Executes timeline regenerationcancelRegenerate()- Dismisses modal without changes_performRegeneration()- Extracted core logic📊 Analytics Tracking
File:
src/lib/analytics.tsNew events:
regenerate_preview_shown(tracks manual edit count)regenerate_confirmed(tracks user confirmation)regenerate_cancelled(tracks user cancellation)🎨 PlanMode Integration
File:
src/components/project-v2/modes/PlanMode.tsxRegenerateModalandcalculateRegenerateDiffuseMemoUser Flow
Definition of Done (Roadmap P1-1)
Technical Details
Diff Calculation
Returns:
phasesAdded,phasesRemoveddurationChange(working days)costChange(currency)manualEditCountaffectedPhases(names)State Management
Modal state lives in
project-store(not component state) for global access and persistence control.Performance
useMemoBuild & Testing
Build Status
✅ TypeScript: Passing (5 pre-existing test errors unrelated)
✅ Production build: Passing (60s)
✅ Bundle size: /project route +0.1 kB (41.1 kB → negligible)
✅ ESLint: Only warnings (pre-existing)
Manual Testing
/project?mode=planEdge Cases Handled
Future Enhancements (P2+)
Screenshots
Modal with manual edits warning, phase/duration/cost diff visualization
Related
docs/Roadmap_and_DoD.md(P1-1)🤖 Generated with Claude Code