Skip to content

feat(cases): add evidence disclosure foundation - #347

Open
luandro wants to merge 14 commits into
mainfrom
feat/issue-269-evidence-disclosure
Open

luandro wants to merge 14 commits into
mainfrom
feat/issue-269-evidence-disclosure

Conversation

@luandro

@luandro luandro commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • add provenance-only Case evidence links for observations, alerts, and tracks
  • add independent attachment selection and explicit changed/deleted/unavailable/unsynced states
  • add per-agency fail-closed disclosure controls and privacy-safe media derivative helpers
  • add Data/Alerts entry points, Evidence/Reports Case UI, real evidence counts, localization, and browser coverage

Privacy and safety

  • adding a source never auto-selects its media
  • Area only never derives/rounds hidden coordinates; geometry is emitted only from separately approved generalized geometry
  • disclosure derivatives strip supported metadata and bind original-to-derivative hashes; unsupported formats fail closed without returning raw bytes
  • Case activity remains metadata-only and this issue performs no Case/provider/AI upload calls

QA

Implementation-specific QA: docs/qa/269.md
Runnable QA script: scripts/qa/269-evidence-disclosure.sh

Local evidence before push on synchronized main:

  • focused feat(cases): Evidence selection + disclosure foundation #269 unit/component/i18n suite: 189/189 passing
  • formatting, ESLint, strict TypeScript, i18n extraction: passing
  • production build + security verifier: passing
  • static Storybook build: passing
  • Chromium desktop/mobile Case lifecycle + evidence/disclosure E2E: passing
  • Firefox desktop/mobile same flows: passing
  • local WebKit launch blocked only by missing host GTK/GStreamer libraries; exact-SHA CI is authoritative

Closes #269

@github-actions

github-actions Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

React Doctor found 7 new issues in 4 files · 7 warnings · score 89 / 100 (Great) · 3 fixed · vs main

7 warnings

src/components/shared/AddToCaseDialog.tsx

  • ⚠️ L160 React function has high control-flow complexity no-high-complexity-react-function
  • ⚠️ L206 await inside a loop async-await-in-loop

src/components/shared/CaseEvidenceWorkspace.tsx

  • ⚠️ L181 Large component is hard to read and change no-giant-component

src/screens/AlertsScreen.tsx

  • ⚠️ L132 React function has high control-flow complexity no-high-complexity-react-function
  • ⚠️ L132 Large component is hard to read and change no-giant-component

src/screens/DataScreen.tsx

  • ⚠️ L111 React function has high control-flow complexity no-high-complexity-react-function
  • ⚠️ L278 useMemo before an early return rerender-memo-before-early-return

Reviewed by React Doctor for commit c5fa7ba. See inline comments for fixes.

Comment thread src/components/shared/AddToCaseDialog.tsx
Comment thread src/components/shared/CaseEvidenceWorkspace.tsx
Comment thread src/screens/DataScreen.tsx
Comment thread src/components/shared/AddToCaseDialog.tsx
Comment thread src/components/shared/CaseEvidenceWorkspace.tsx
Comment thread src/screens/DataScreen.tsx
@github-actions

github-actions Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment ready: https://feat-issue-269-evidence-disc.comapeo-cloud-app.pages.dev

Commit: dc97097

…ce-disclosure

# Conflicts:
#	src/i18n/messages/es.json
#	src/i18n/messages/pt.json
onAdded?: (caseLocalId: string) => void;
}

export function AddToCaseDialog({

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

React Doctor · react-doctor/no-high-complexity-react-function (warning)

AddToCaseDialog has cyclomatic complexity 14, cognitive complexity 16, and maximum nesting depth 2, so its React logic is hard to understand and change. Extract independent branches into components or hooks.

Fix → Extract independent render branches and state logic into focused components or hooks until the control flow is easy to follow.

Docs

setSubmitError(false);
try {
for (const source of sources) {
await addEvidence.mutateAsync({

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

React Doctor · react-doctor/async-await-in-loop (warning)

This makes the for…of loop slow because each await runs one after another, so collect the independent calls & run them together with await Promise.all(items.map(...))

Fix → Collect the items, then use await Promise.all(items.map(...)) so independent work runs at the same time

Docs

caseLocalId: string;
}

export function CaseEvidenceWorkspace({

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

React Doctor · react-doctor/no-giant-component (warning)

Component "CaseEvidenceWorkspace" is over 300 lines long, which is hard to read & change. Split it into a few smaller components.

Fix → Pull each section into its own component so the parent is easier to read, test, and change.

Docs

return nextIds;
}

export function DataScreen() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

React Doctor · react-doctor/no-high-complexity-react-function (warning)

DataScreen has cyclomatic complexity 18, cognitive complexity 22, and maximum nesting depth 2, so its React logic is hard to understand and change. Extract independent branches into components or hooks.

Fix → Extract independent render branches and state logic into focused components or hooks until the control flow is easy to follow.

Docs

This branch was successfully deployed

1 active deployment
preview — c5fa7baf Deployed Sep 7, 2026 by github-actions[bot]
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.

feat(cases): Evidence selection + disclosure foundation

1 participant