Skip to content

Multi task feature#835

Open
coryzoon wants to merge 2 commits into
masterfrom
multi-task-feature
Open

Multi task feature#835
coryzoon wants to merge 2 commits into
masterfrom
multi-task-feature

Conversation

@coryzoon

@coryzoon coryzoon commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds support for multi-task workflows on mobile (volunteer answers 2+ tasks in sequence before a single
classification POST) and refactors the four classifier screens into a single unified shell to make that
possible.

What changed

Phase 1 — Classifier refactor (prep work for multi-task)

The four legacy classifier screens (Question, MultiAnswer, Drawing, Swiper) previously each owned their own data
loading, layout, and submission logic. They've been replaced with a single ClassifierScreen shell that
dispatches to one of four prop-driven workflow body components (SingleChoice, MultiSelect, Drawing,
Swipe).

  • New hooks for shared concerns: useSubjectQueue, useWorkflowResources, useProjectTranslations,
    useFeedbackFlow.
  • New components replace connect()ed legacy versions where the new prop-driven flow needs them (drawing
    canvas, tool panel, subject viewer, modal sheet).
  • New plain-async submission helpers replace the legacy classifier-submission thunks for the new flow. Legacy
    thunks stay in place so the legacy screens still work as a rollback option.
  • Legacy classifier screens are kept in the navigator but unreached — intentional, for A/B rollback if anything
    regresses.

Phase 2 — Multi-task chain

  • taskChain.js — pure helpers (isMultiTaskWorkflow, getNextTaskKey, isLastTaskInChain,
    activePathTaskKeys) that decide whether a workflow chains and where each task points next.
  • classification RTK slice extended with currentTaskKey, taskHistory, and annotationsByTask so each
    chain task's annotation is stored, restorable on Back, and prunable on re-branch.
  • ClassifierScreen reads currentTaskKey from the slice and remounts the correct body on chain advance.
    Subject queue lifted into the shell so a Swipe → non-Swipe advance keeps the active subject.
  • ChainBackButton renders whenever taskHistory.length > 0. Re-picking a different branch after Back
    automatically prunes stale downstream annotations.
  • Submit button labels flip between "Submit" / "Next" / "Done" based on the chain's position; MultiSelect "Done"
    is gated on a non-empty selection mid-chain (matches FEM).
  • Single-task workflows are unchanged — POST shape is byte-equivalent to before this PR.
  • New i18n keys (next, done, back) in en/mobileEn.json; other locales fall back to inline English.

Notes for review

  • HAVI test project bypass: src/actions/projects.js has three // TEMP: patches that force the HAVI test
    project (32778) and workflow (31723) through the project/workflow pipeline despite mobile_friendly: false.
    These must be removed once the backend marks HAVI as mobile-friendly and isValidMobileWorkflow is relaxed to
    accept multi-task chains.
  • Legacy classifier screens are intentionally kept for rollback / A/B. Will submit follow up PR for removal.

Comment thread src/actions/choiceClassification.js
Comment thread src/actions/drawingClassification.js
Comment thread src/components/Markings/DrawingModalSheet.js
Comment thread src/components/Markings/DrawingSubjectViewer.js
Comment thread src/components/Markings/components/DrawingCanvas.js
Comment thread src/components/classifier/MultiImageCarousel.js
Comment thread src/components/classifier/SubjectVideo.js
Comment thread src/components/classifier/SubjectViewer.js
Comment thread src/components/classifier/TaskPanel.js
Comment thread src/components/classifier/TaskQuestion.js
@mcbouslog mcbouslog self-requested a review June 11, 2026 05:44
@mcbouslog mcbouslog self-assigned this Jun 11, 2026
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.

2 participants