Skip to content

[hma] Add notes to hashbank content #1925

@sreeprasad

Description

@sreeprasad

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

  1. DB Schema - Add note column to bank_content table + migration
  2. Storage Layer - Update BankContentConfig, bank_add_content(), bank_content_get(), bank_content_update()
  3. API Schemas - Add note field to BankedContentMetadata and BankContentResponse
  4. API Endpoints - Update curation.py to handle notes
  5. Frontend Form - Add textarea to add_to_bank_form.html.j2
  6. Frontend JS - Update bank-management.js to send/display notes
  7. View/Edit UI - Add UI to view and edit notes on existing content
  8. 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)?

Metadata

Metadata

Assignees

Labels

hmaItems related to the hasher-matcher-actioner system
No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions