feat(FM-IC-CFG-001): user-defined custom data fields for funders & opportunities - #198
Open
SpikeyCoder wants to merge 3 commits into
Open
feat(FM-IC-CFG-001): user-defined custom data fields for funders & opportunities#198SpikeyCoder wants to merge 3 commits into
SpikeyCoder wants to merge 3 commits into
Conversation
…nities
Adds a per-user custom-field schema so users can attach their own data
fields (e.g. Program Officer, Internal Priority, Board Champion) to saved
funders and tracked opportunities — closing the Instrumentl gap flagged in
the 2026-06-14 usability audit ('no custom-field schema; funders +
tracked_grants use fixed columns').
Backend:
- Migration 20260614130000_cfg001_custom_fields.sql:
- new custom_field_definitions table (user-scoped RLS, entity =
funder|grant, field_type text/number/date/select/checkbox/url)
- custom_fields jsonb column on saved_funders and tracked_grants
- tracked-grants edge function: persist custom_fields on POST/PUT
Frontend:
- types: CustomFieldDefinition / CustomFieldValue + customFields on
SavedFunderEntry and TrackedGrant
- AuthContext: read/write saved_funders.custom_fields
- lib/customFields.ts helpers
- CustomFieldsEditor: inline value inputs on SavedFunders pipeline cards
- CustomFieldsSettings: new 'Custom Fields' tab in Account Settings to
define fields for funders and opportunities
npm run build passes (tsc -b && vite build).
Deploying funder-finder with
|
| Latest commit: |
5fc32a0
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://299724c9.funder-finder.pages.dev |
| Branch Preview URL: | https://feature-fm-ic-cfg-001-custom-va92.funder-finder.pages.dev |
Bring in PR #192's unique contributions: - ProjectWorkspace.tsx: custom field state, handlers (persistCustomFields, handleAddCustomField, handleRemoveCustomField, handleCustomFieldValueChange), and 'Custom Fields' UI section in grant detail drawer - tracked-grants/index.ts: add sanitiseCustomFields() guard that validates, trims, and caps custom fields (max 50 fields, key max 80 chars, value max 2000 chars) — replaces the simpler typeof check from #198 Closes #192
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.
FM-IC-CFG-001 — Add custom data fields to funders/opportunities
Closes the Instrumentl competitive gap flagged FAIL in the 2026-06-14 daily usability audit:
Users can now define their own data fields and attach values to the funders and opportunities they track — beyond the fixed columns + free-text notes.
Backend
20260614130000_cfg001_custom_fields.sqlcustom_field_definitionstable (user-scoped RLS;entity=funder|grant;field_type= text/number/date/select/checkbox/url;optionsjsonb for dropdowns).custom_fields jsonbvalue column added to bothsaved_fundersandtracked_grants.tracked-grantsedge function — persistscustom_fieldson POST and PUT.Frontend
types.ts—CustomFieldDefinition/CustomFieldValue;customFieldsonSavedFunderEntryandcustom_fieldsonTrackedGrant.AuthContext— reads/writessaved_funders.custom_fields.lib/customFields.ts— fetch/slugify/coerce/format helpers.CustomFieldsEditor— inline value inputs rendered on SavedFunders pipeline cards.CustomFieldsSettings— new Custom Fields tab in Account Settings to define fields for Funders and Opportunities.Design decisions (autonomous run)
jsonbkeyed byfield_key(tiny cardinality, single-row reads, mirrors existingfunder_datasnapshot pattern) rather than a separate values table.saved_funders/tracked_grants.Verification
npm run build(tsc -b && vite build) passes with no type errors.Generated by the fundermatch-feature-builder scheduled task.