feat(meetings): flag same-meeting assignment conflicts in red - #5379
feat(meetings): flag same-meeting assignment conflicts in red#5379FranklinD10 wants to merge 6 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review. WalkthroughChangesMeeting conflict indicators
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This change adds same-meeting assignment conflict warnings for brother and student selectors, with red conflict messaging taking precedence over existing notices. No concrete current-head merge risk is identified. Sequence Diagram(s)sequenceDiagram
participant Selector
participant SelectorHook
participant SchedulesService
participant Autocomplete
Selector->>SelectorHook: select a person
SelectorHook->>SchedulesService: check meeting assignment conflict
SchedulesService-->>SelectorHook: return isMeetingConflict
SelectorHook-->>Selector: return conflict state and helper text
Selector->>Autocomplete: pass decorator and helper colors
Autocomplete-->>Selector: render conflict styling
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
ce6896b to
877d37f
Compare
Add a red warning when the same person is given two roles in the same meeting, e.g. hall overseer and Watchtower reader in one midweek meeting. The existing orange week-level warning is untouched; red simply takes precedence when both would apply. Meeting identity comes from the MM_/WM_ prefix already present on every ASSIGNMENT_PATH key, so no new state or data plumbing is needed. New helper schedulesPersonHasMeetingConflict reads the existing assignmentsHistoryState and is shared by the brother and student selectors. Scoped to the current dataView so a collision the user cannot see is never flagged. Prayers, circuit overseer fields and WM_Speaker_Outgoing are exempt: prayers are commonly doubled with another part (the app ships a linked prayer setting for exactly that), the CO legitimately holds both his own field and a talk during a visit, and an outgoing talk belongs to another congregation's meeting. Part of sws2apps#3147 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TRZ5tRSmSDbCpEHAbnVij9
877d37f to
41cd9af
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
Tick the box to add this pull request to the merge queue (same as
|
The helper color and decorator turn red on same-meeting conflict alone, but the text kept the absence notice, hiding the conflict. Check conflict first in both selectors so text matches color. Addresses Devin review on sws2apps#5379.
|



Description
Part 1 of 2 for #3147.
That issue asks for two things. This PR does the additive half only: a red warning when the same person is given two roles in the same meeting, for example hall overseer and Watchtower reader in one midweek meeting. The existing orange week-level warning is left exactly as it is.
The second half (narrowing the orange so it only fires on the same assignment in consecutive weeks) is a behaviour change to something users see every week, so I have kept it in a separate PR that stacks on this one.
How it works
Meeting identity comes from the
MM_/WM_prefix that is already on everyASSIGNMENT_PATHkey, so there is no new state and no new data plumbing. A new helperschedulesPersonHasMeetingConflictreads the existingassignmentsHistoryStateand is shared by the brother and student selectors.It is scoped to the current
dataView, so a collision the user cannot see on screen is never flagged.Red takes precedence over orange when both would apply, since it is the more specific message. Nothing is removed and nothing existing is reworded.
Deliberate exemptions
Three cases never trigger red, to avoid false positives:
WM_ClosingPrayerauto-displays theWM_Speaker_Part1person, so a prayer doubled with another part is normal practice.WM_Speaker_Outgoing. That record belongs to another congregation's meeting, not ours.One edge worth flagging
isMeetingConflictkeys off the selector's displayed value, and a few fields display a default that is not persisted (MM_Chairman_Baux counselor,WM_WTStudy_Conductor). If that defaulted person holds another role in the same meeting, red will show on a field the user has not filled in yet. I think that is correct information to surface, but it is a small difference from the orange warning, which cannot trip without a saved record. Happy to suppress it if you would rather.Type of change
Checklist: