Fix: Improve field editing and optimize job loading

- Prevent layout shift during field editing by using absolute positioning.
- Implement filtering of jobs based on the user's collapsed group preferences.
- Modify the `useJobs` hook to fetch jobs with filters based on the open/closed state of job categories.
- Update the `dataService` to use the filter parameter when fetching jobs.
This commit is contained in:
gpt-engineer-app[bot]
2025-07-07 17:02:34 +00:00
committed by PhatPhuckDave
parent c0193ce618
commit 897d15ce4d
8 changed files with 170 additions and 21 deletions

View File

@@ -20,7 +20,8 @@ const Index = () => {
updateJob,
deleteJob,
createMultipleTransactions,
createMultipleBillItems
createMultipleBillItems,
loadJobsForStatuses
} = useJobs();
const [showJobForm, setShowJobForm] = useState(false);
@@ -188,6 +189,12 @@ const Index = () => {
const newState = { ...collapsedGroups, [status]: !collapsedGroups[status] };
setCollapsedGroups(newState);
localStorage.setItem('jobGroupsCollapsed', JSON.stringify(newState));
// Load jobs for newly opened groups
if (collapsedGroups[status]) {
// Group is becoming visible, load jobs for this status
loadJobsForStatuses([status]);
}
};
const handleBatchTransactionsAssigned = async (assignments: { jobId: string, transactions: IndTransactionRecordNoId[] }[]) => {