Skip to content

[Feature]: Propose a Suggestion (correction/addition) from a chat message #468

Description

@bjrump

Problem Statement

Suggestions (Source Correction / Entity Addition) can currently only be created by the AI's correctionTool (packages/ai/src/tools/correction.ts), which the model invokes at its own discretion when it infers a correction intent during chat. There is no user-facing entry point to explicitly propose a correction or addition. If the model doesn't pick up the intent, the user's input is lost.

Proposed Solution

Add user-initiated Suggestion creation from an assistant message:

  • Frontend: actions on the assistant message (same footer area as the other message actions in apps/frontend/components/chat/ProjectChat.tsx) — e.g. "This is wrong" → Source Correction, "Something is missing" → Entity Addition. The action opens a small form pre-filled with the relevant claim; the user refines the text and submits.
  • API: an endpoint to create a user-authored Suggestion of the given kind, scoped to the Project's graph, in apps/api.
  • The submitted Suggestion appears in the existing review flow (Settings → Suggestions), where it is Applied or Dismissed as today.

Most of the backend is already in place — the suggestions table, the Apply/Dismiss logic, and the review UI all exist. This issue is primarily the chat entry point plus a create endpoint.

Acceptance Criteria

  • From an assistant message, a user can open a form to propose a Source Correction or an Entity Addition.
  • The form is pre-filled with the relevant claim and lets the user edit before submitting.
  • Submitting creates a pending Suggestion visible in Settings → Suggestions for reviewers.
  • Respects existing rules: personal (user-owned) Projects have no Suggestion management — no review entry there.
  • de + en strings + aria-labels.

Scope / Notes

Frontend + backend. Ties in with the message-feedback control (#458) and the Suggestion review UX (#462). Labeled needs-triage — the exact UX and whether to ship it still needs to be discussed before implementation.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions