Funding Queue Remove From Queue Implementation Plan
For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (- [ ]) syntax for tracking.
Goal: Change the funding queue table’s single-item delete action so it closes the linked processing submission and removes the contact from the queue without deleting any fundingPlans rows.
Architecture: Keep the existing queue data model and reuse the existing processing-submission status workflow. The page and hook will expose a queue-specific remove action keyed by processingSubmissionId, and FundingQueueTable will update its action menu, confirmation dialog, and toasts to describe removing from queue rather than deleting plans.
Tech Stack: Next.js App Router, React, TypeScript, Convex mutations/queries, Bun tests, ESLint
File Map
Modifyapp/admin/internal/funding-queue/page.tsx- Pass the renamed queue action prop into
FundingQueueTable.
- Pass the renamed queue action prop into
lib/hooks/useAdminFundingQueue.ts- Replace the single-item plan deletion helper with a submission-closing helper that calls the existing
setSubmissionStatusMutation.
- Replace the single-item plan deletion helper with a submission-closing helper that calls the existing
components/funding-queue/FundingQueueTable.tsx- Show the single-item action only when a queue item has
processingSubmission, store the submission id in dialog state, and update the copy/toasts from delete wording to remove-from-queue wording.
- Show the single-item action only when a queue item has
tests/fundingQueueBulkActions.test.ts- Update source assertions so the queue table checks for the new remove-from-queue action instead of plan deletion copy.
tests/fundingQueueRemoveFromQueue.test.ts- Add source assertions for the hook/page wiring that prove the queue now uses
setSubmissionStatusand passes the renamed prop.
- Add source assertions for the hook/page wiring that prove the queue now uses
Task 1: Lock in the behavior with focused source tests
Files:-
Modify:
tests/fundingQueueBulkActions.test.ts -
Create:
tests/fundingQueueRemoveFromQueue.test.ts - Step 1: Update the existing table-copy test to fail on the old delete wording
- Step 2: Add a new wiring test for the page and hook
- Step 3: Run the targeted tests and confirm they fail before implementation
bun test tests/fundingQueueBulkActions.test.ts tests/fundingQueueRemoveFromQueue.test.ts
Expected: FAIL because FundingQueueTable.tsx, page.tsx, and useAdminFundingQueue.ts still use onDeletePlan/deletePlan and old delete wording.
Task 2: Rewire the funding queue single-item action to close submissions
Files:-
Modify:
lib/hooks/useAdminFundingQueue.ts -
Modify:
app/admin/internal/funding-queue/page.tsx -
Step 1: Replace the queue helper in
useAdminFundingQueue
- Step 2: Export the renamed helper from the hook return object
- Step 3: Pass the renamed prop through the funding queue page
- Step 4: Run the new wiring test and confirm the hook/page changes pass
bun test tests/fundingQueueRemoveFromQueue.test.ts
Expected: PASS for the page/hook assertions, while the table-copy assertion can still fail until Task 3 is complete.
Task 3: Update the funding queue table UI and copy
Files:-
Modify:
components/funding-queue/FundingQueueTable.tsx -
Test:
tests/fundingQueueBulkActions.test.ts - Step 1: Rename the prop and dialog state to track a submission instead of a plan
- Step 2: Update the handler to call the queue-removal action
- Step 3: Show the action only when the queue item has a submission and update the menu copy
- Step 4: Update the confirmation dialog wording
- Step 5: Run the table-focused test and make sure the updated copy is covered
bun test tests/fundingQueueBulkActions.test.ts
Expected: PASS with Remove from Queue and Delete All Plans both present in the source.
Task 4: Full verification
Files:-
Modify:
components/funding-queue/FundingQueueTable.tsx -
Modify:
lib/hooks/useAdminFundingQueue.ts -
Modify:
app/admin/internal/funding-queue/page.tsx -
Modify:
tests/fundingQueueBulkActions.test.ts -
Create:
tests/fundingQueueRemoveFromQueue.test.ts - Step 1: Run the focused queue tests
bun test tests/fundingQueueBulkActions.test.ts tests/fundingQueueRemoveFromQueue.test.ts
Expected: PASS
- Step 2: Run the required type check
bunx tsc --noEmit
Expected: PASS with no TypeScript errors
- Step 3: Run the required lint check
bun run lint
Expected: PASS with no lint errors
