Summary
Add the ability to attach notes to hashes when adding content to a bank. Notes provide context about why content was
added (e.g., "Reported by user X on 2024-01-15" or "Part of campaign ABC").
Proposed Changes
Database
- Add a
note TEXT field to the BankContent model
API
- Accept optional
note parameter when adding content via:
POST /bank/<name>/content (file/URL upload)
POST /bank/<name>/signal (direct hash)
- Return
note in GET /bank/<name>/content/<id> response
- Allow updating
note via PUT /bank/<name>/content/<id>
UI
- Add note textarea to the "Add to Bank" modal (all three tabs: File, URL, Hash)
- Display notes when viewing content details
- Allow editing notes on existing content
Tasks
- DB Schema - Add
note column to bank_content table + migration
- Storage Layer - Update
BankContentConfig, bank_add_content(), bank_content_get(), bank_content_update()
- API Schemas - Add
note field to BankedContentMetadata and BankContentResponse
- API Endpoints - Update curation.py to handle notes
- Frontend Form - Add textarea to
add_to_bank_form.html.j2
- Frontend JS - Update
bank-management.js to send/display notes
- View/Edit UI - Add UI to view and edit notes on existing content
- Tests - Add test coverage for notes CRUD
Design Decision
Starting with a single note TEXT field on BankContent. This is simplest approach. All notes will be overwritten with latest note.
Questions for Maintainers
- Should notes have a character limit?
- Should notes be included when exporting/syncing via exchanges?
- Any preference on PR structure (stacked small PRs vs single feature PR)?
Summary
Add the ability to attach notes to hashes when adding content to a bank. Notes provide context about why content was
added (e.g., "Reported by user X on 2024-01-15" or "Part of campaign ABC").
Proposed Changes
Database
noteTEXT field to theBankContentmodelAPI
noteparameter when adding content via:POST /bank/<name>/content(file/URL upload)POST /bank/<name>/signal(direct hash)noteinGET /bank/<name>/content/<id>responsenoteviaPUT /bank/<name>/content/<id>UI
Tasks
notecolumn tobank_contenttable + migrationBankContentConfig,bank_add_content(),bank_content_get(),bank_content_update()notefield toBankedContentMetadataandBankContentResponseadd_to_bank_form.html.j2bank-management.jsto send/display notesDesign Decision
Starting with a single
noteTEXT field onBankContent. This is simplest approach. All notes will be overwritten with latest note.Questions for Maintainers