fix: skip appointment-file merge for chatbot claims; add live screenshot capture to chatbot

- selenium-claim route no longer re-appends previously saved appointment
  attachments when the chatbot's autoSubmit flow already sent every intended
  file, preventing an unwanted extra upload (e.g. attach 2 -> Selenium sees 3).
- Add a "Take screenshot" button to the AI chatbot's attachment bar, reusing
  the same capture/crop flow as the appointment editor, so claims and
  preauths can be submitted from the chatbot with a live screenshot attached.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-24 22:31:34 -04:00
parent a42ef5f570
commit 6b9b3c41f2
3 changed files with 161 additions and 2 deletions

View File

@@ -348,7 +348,9 @@ router.post(
// Include attachments already saved on the appointment (e.g. via "Select Procedures")
// that weren't re-uploaded in this request — read straight from disk by filePath.
if (claimData.appointmentId) {
// Skipped for chatbot-driven submissions, which already send every intended file and
// shouldn't have unrelated older appointment attachments silently tacked on.
if (claimData.appointmentId && !claimData.skipAppointmentAttachmentMerge) {
const seenNames = new Set(filesForQueue.map((f) => f.originalname));
const apptFiles = await storage.getAppointmentFiles(Number(claimData.appointmentId));
for (const f of apptFiles) {