TT-7350 AssignmentTable and AssignSection to utilize new section resolution functions and useShowAssignment hook.#334
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR centralizes the “should assignment UI be shown?” decision into a new useShowAssignment hook and applies it across sheet/plan UI, while also improving how selected assignment rows are resolved to sections (including passage rows) to support assignment/removal workflows in personal/offline contexts.
Changes:
- Added
useShowAssignmenthook (+ unit tests) and replaced repeated inline logic across multiple sheet components. - Updated filtering UX/logic to hide or clear
assignedToMewhen assignment isn’t applicable (e.g., personal orgs / offline-only). - Added section-resolution helpers (
resolveSectionForRecId/resolveSelectedSections) and refactoredAssignmentTableselection handling to use them.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/renderer/src/crud/useShowAssignment.ts | New hook to determine whether assignment UI should be shown (personal org + offline-only aware). |
| src/renderer/src/crud/useShowAssignment.test.ts | Unit tests covering key useShowAssignment scenarios. |
| src/renderer/src/crud/index.ts | Re-export useShowAssignment from the CRUD barrel. |
| src/renderer/src/components/Sheet/usePlanSheetFill.tsx | Replace inline personal/offline assignment visibility logic with useShowAssignment. |
| src/renderer/src/components/Sheet/ScriptureTable.tsx | Uses useShowAssignment to clear assignedToMe when unavailable; refactors assign close handling to refresh sheet. |
| src/renderer/src/components/Sheet/PlanTabSelect.tsx | Replace inline assignment visibility logic with useShowAssignment. |
| src/renderer/src/components/Sheet/PlanSheet.tsx | Replace inline assignment visibility logic with useShowAssignment. |
| src/renderer/src/components/Sheet/PlanBar.cy.tsx | Cypress updates to support org-driven assignment filter visibility tests with mocked Orbit memory. |
| src/renderer/src/components/Sheet/filterMenu.tsx | Hide assignment-related filter UI and force-clear assignedToMe when assignment filters should not be shown. |
| src/renderer/src/components/resolveSectionForRecId.ts | New helpers to map selected rows (section or passage) to sections. |
| src/renderer/src/components/resolveSectionForRecId.test.ts | Unit tests for the new section-resolution helpers. |
| src/renderer/src/components/PlanTabs.tsx | Replace inline assignment visibility logic with useShowAssignment. |
| src/renderer/src/components/AssignSection.tsx | Improves assign flow with success/failure return and snackbar error reporting. |
| src/renderer/src/components/AssignmentTable.tsx | Refactors selected-section derivation to use new resolver helpers; fixes relationship type when clearing organizationScheme. |
added 4 commits
May 27, 2026 17:10
…ection resolution functions. Introduce useShowAssignment hook for conditional rendering of assignment filters. Add tests for section resolution logic and show assignment functionality. Fixes: - TT-7350 assign to user - TT-6482 assigned column & Assignment tab in personal projects - TT-6474 Hide assigned rows in personal projects - TT6372 Select All on Assignment Tab
…ng unused function and utilizing filter method. Clean up ScriptureTable by removing unnecessary refresh prop from Uploader component.
…Update mountPlanTabSelect calls to include teamGlobal and teamOrgs for improved test coverage of non-personal team scenarios.
…ic and clarity. Move needsLink check in AssignSection to ensure proper assignment flow. Update filter handling in ScriptureTable to create a new filter object from the source, enhancing state management.
sarahentzel
approved these changes
May 29, 2026
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.
Fixes: