Skip to content

feat: image-based task extraction + priority board#1220

Open
KatlaSathwik wants to merge 1 commit into
Charushi06:mainfrom
KatlaSathwik:feature/image-task-extraction-and-priority-board
Open

feat: image-based task extraction + priority board#1220
KatlaSathwik wants to merge 1 commit into
Charushi06:mainfrom
KatlaSathwik:feature/image-task-extraction-and-priority-board

Conversation

@KatlaSathwik

Copy link
Copy Markdown

Related Issue

Closes #229

Summary

Implements the image-to-task extraction feature from #229: upload a photo or screenshot (WhatsApp message, LMS page, handwritten note, timetable) and get structured, editable tasks extracted automatically — the same way pasted text already works. Primary path is Gemini 2.5 Flash multimodal vision (reads the image directly); falls back to Tesseract.js OCR + the existing heuristic parser if Gemini fails 5 times or no API key is configured, always reporting why it fell back.

Also adds a Task Priority Board (navbar "Tasks") that groups all tasks into High/Medium/Low columns with consistent colors, reused on the calendar's deadline dots so newly extracted tasks are highlighted by urgency immediately.

Full technical breakdown, file-by-file, in CHANGES.md.

Changes Made

  • New POST /api/extract/image endpoint (Gemini vision, 5 retries, OCR fallback)
  • New image upload UI in the Smart Paste panel, reusing the existing extraction preview/edit/add-to-planner flow
  • New Task Priority Board (High/Medium/Low), wired into the navbar "Tasks" link
  • Calendar deadline dots recolored by priority instead of subject; legend updated to match
  • "View in Task Board" button added when a calendar date is selected
  • Fixed: toast notifications had no CSS anywhere in the project (rendered unstyled, never removed from DOM)
  • Fixed: Smart Paste panel had no scroll, making content below the fold unreachable
  • Moved the existing NLP heuristic fallback out of server.js into backend/utils/nlpTextExtractor.js (behavior-preserving) so the new image route can reuse it

Testing

  • Verified Gemini vision extraction end-to-end with real images, including hashtag preservation
  • Verified the no-API-key and 5-failed-attempts fallback paths, both with correct reasons surfaced to the UI
  • Regression-tested the existing text-paste extraction route (unchanged output)
  • Seeded high/medium/low priority tasks and verified board columns + calendar dot colors match
  • Regression-tested Calendar, All Tasks, Focus Mode, and Profile views for correct show/hide behavior and no console errors

Screenshots

I'll attach screenshots/GIF of the upload flow and priority board here before submitting.

Checklist

  • Code follows project style
  • Tested locally
  • No unrelated changes included
  • Documentation updated (CHANGES.md)
Image extraction section - UI priority board- UI tasks generated

- Add POST /api/extract/image: Gemini vision extraction (5 retries)
  with automatic Tesseract.js OCR + heuristic fallback, reporting the
  fallback reason back to the UI.
- Add matching Smart Paste UI for uploading a photo/screenshot,
  reusing the existing extraction preview/edit/add-to-planner flow.
- Add Task Priority Board: navbar "Tasks" now opens a High/Medium/Low
  grouped view with consistent priority colors, reused on calendar
  deadline dots so newly extracted tasks are highlighted immediately.
- Add "View in Task Board" from a selected calendar date, filtered to
  that day, alongside the existing in-place day filtering.
- Fix: toast notifications and the confirm dialog had no CSS anywhere
  in the project (rendered unstyled inline, and never got removed
  from the DOM since .toast-hiding had no animation to fire
  animationend). Added the missing styles.
- Fix: the Smart Paste panel had overflow:hidden with no scroll,
  making content below the fold (e.g. "Add to planner") unreachable
  once it grew taller than the fixed app height.
- Move the ~200-line NLP heuristic fallback out of server.js into
  backend/utils/nlpTextExtractor.js (behavior-preserving) so the new
  image route can reuse it without duplicating it.

See CHANGES.md for full details.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
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.

Multimodal Image-to-Task Extraction via OCR + Gemini AI

1 participant