Skip to content

feat: grant bookmarking (#152), submission history (#150), draft auto-save (#149) - #171

Open
ZacLou wants to merge 2 commits into
Core-Foundry:mainfrom
ZacLou:feat/bookmark-history-autosave
Open

feat: grant bookmarking (#152), submission history (#150), draft auto-save (#149)#171
ZacLou wants to merge 2 commits into
Core-Foundry:mainfrom
ZacLou:feat/bookmark-history-autosave

Conversation

@ZacLou

@ZacLou ZacLou commented Aug 28, 2026

Copy link
Copy Markdown

Summary

This PR implements three GrantFox Third Campaign issues:

Issue #152: Implement Grant Bookmarking

  • Created bookmark-store.ts with in-memory Map store (matches existing pattern)
  • Operations: addBookmark, removeBookmark, removeBookmarkByTask, listBookmarks, isBookmarked, toggleBookmark
  • Prevents duplicate bookmarks with userId+taskId index
  • Bookmarks persist across sessions (server process lifetime)

Issue #150: Implement Grant Application Submission History

  • Created submission-history.ts as a query/index layer over existing submissions
  • recordSubmission() called by submitTaskWork() — auto-indexes every new submission
  • updateSubmissionStatus() called by approveSubmission()/rejectSubmission()
  • getSubmissionHistory() with status filter, sort (newest/oldest/status), pagination
  • getSubmissionStatusBreakdown() for dashboard summary

Issue #149: Add Draft Auto-Save for Grant Applications

  • Created draft-autosave.ts with upsert-based save (same userId+taskId = update not duplicate)
  • saveDraft() is idempotent, preserves createdAt on update, updates lastSavedAt
  • getDraft(), getLastSavedAt(), listDrafts(), deleteDraftByTask()
  • Constants: DEFAULT_AUTOSAVE_INTERVAL_MS (30s), MAX_FORM_DATA_SIZE (1MB)

Integration

  • task-workflow.ts modified: submitTaskWork() now calls recordSubmission(), approveSubmission()/rejectSubmission() now call updateSubmissionStatus()
  • resetTaskWorkflowStore() now also resets bookmark, submission-history, and draft stores

API Routes

  • GET/POST/DELETE /api/bookmarks — list, add, remove bookmarks
  • GET /api/submission-history — paginated history with filters
  • GET/POST/DELETE /api/drafts — get, save, delete drafts

Tests

  • 7 tests for bookmark store (add, remove, list, toggle, edge cases)
  • 10 tests for submission history (record, update, query, paginate, breakdown)
  • 10 tests for draft auto-save (save, upsert, get, list, delete, size limits)

Closes #152
Closes #150
Closes #149

鲁班七号 added 2 commits August 29, 2026 00:58
Core-Foundry#157), moderation queue (Core-Foundry#159)

- Core-Foundry#154: Levenshtein-based title similarity + org/description overlap detection
  Flags potential duplicates for admin review without blocking creation
- Core-Foundry#157: Structured eligibility fields (location, applicant type, project stage,
  team size, custom requirements) with validation and display formatting
- Core-Foundry#159: Admin moderation queue with enqueue/list/approve/reject/dismiss
  Auto-enqueues new tasks and duplicate flags for review
- Integrated into createTask: duplicate detection + auto-moderation on creation
- Added API routes: GET /api/moderation, GET/POST /api/moderation/:itemId
- 30+ unit tests covering all three features
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Grant Bookmarking Add Draft Auto-Save for Grant Applications Implement Grant Application Submission History

1 participant