-
Notifications
You must be signed in to change notification settings - Fork 0
fix(meetings): prevent form data loss when navigating steps in edit mode #108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Separated step change effect from meeting data population effect - Form now populates only once using toObservable with take(1) operator - User edits are preserved when navigating between steps JIRA: LFXV2-600 Signed-off-by: Asitha de Silva <[email protected]>
WalkthroughRefactors meeting-manage component to populate the form via an observable stream gated for edit mode, adjusts attachment initialization to use a scoped destroy reference, adds explicit typing in find operations, and clarifies an effect dedicated to step-change validation with minor comment updates. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant Comp as MeetingManageComponent
participant Stream as toObservable(meeting)
participant Form as FormModel
rect rgba(230,240,255,0.6)
note over Comp: Initialization
User->>Comp: Open edit meeting
Comp->>Stream: Subscribe with filter(isEdit && meeting exists)
Stream-->>Comp: Meeting (once via take(1))
Comp->>Form: Populate fields
end
rect rgba(240,255,230,0.6)
note over Comp: Attachments init (lifecycle-scoped)
Comp->>Comp: initAttachments()
Comp->>Comp: subscribe(...).pipe(takeUntilDestroyed(destroyRef))
end
rect rgba(255,245,230,0.6)
note over Comp: Step change validation effect
User->>Comp: Change step
Comp->>Comp: Effect runs validation for step change
Comp-->>User: Proceed or block based on validation
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (3)**/*.{ts,tsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.{ts,tsx,js,jsx,mjs,cjs,html,css,scss}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
🧬 Code graph analysis (1)apps/lfx-one/src/app/modules/project/meetings/components/meeting-manage/meeting-manage.component.ts (2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (5)
🧪 Early access (Sonnet 4.5): enabledWe are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience. Note:
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a critical user experience issue where meeting form data was being lost when users navigated between steps in edit mode. The solution separates concerns by handling step validation and form population independently.
- Decoupled step navigation effects from meeting data population logic
- Added one-time form population using
toObservablewithtake(1)operator - Fixed form resetting to original values on every step change
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...x-one/src/app/modules/project/meetings/components/meeting-manage/meeting-manage.component.ts
Show resolved
Hide resolved
✅ E2E Tests PassedBrowser: chromium All E2E tests passed successfully. Test Configuration
|
Summary
Problem
When editing a meeting in the meeting manage component, user edits were lost every time they navigated between steps. The form would repopulate with the original meeting data, discarding any changes the user had made.
Root Cause
The
effect()hook in the meeting-manage component was watching bothcurrentStep()andmeeting()signals, and callingpopulateFormWithMeetingData()whenever either changed. This caused the form to reset to original values on every step navigation.Solution
Separated the concerns into:
toObservable(this.meeting)withtake(1)operator to populate the form only once when the meeting data initially loadsTest Plan
Files Modified
apps/lfx-one/src/app/modules/project/meetings/components/meeting-manage/meeting-manage.component.tsJIRA Ticket
LFXV2-600
🤖 Generated with Claude Code