Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

10 — Interaction Specification (Homework Module)

Module-specific interactions layered on shared 00-shared/08. Covers every input modality on phone/tablet/desktop for list, forms, grading, attachments.


1. Phone / touch

GestureBehaviourWhere
Tapopen card, submit, grade, preview attachmentall
Tap on submit/grade CTAsubmitting-aware disabled re-tapsubmit/grade forms
Long-pressAppMenu on homework rows (Edit/Delete); attachment menu (Save/Share)lists, attachments
Double-tapzoom in attachment preview (PDF/image)preview only (08 §1)
Swipe lefthomework row quick actions (Edit, Delete) — ≤ 2 (08 §1)teacher list
Pull downrefresh list / submissions (RefreshIndicator)all scrollables
Hardware backpop form/sheet → previous screen; form with content → discard promptall
Edge swipeshell drawerapp shell

2. Keyboard / desktop / mouse

InputBehaviour
Tablogical form order (class → subject → title → description → dueDate → attachments → CTA); focus ring primary
Entersubmits single-field contexts; Ctrl+Enter submits forms from text areas (remarks/description)
Esccloses sheet/dialog/menu; cancels selection; focus returns to trigger
Nnew homework (list screen, teacher)
Ctrl/Cmd+Kglobal search (shell)
Arrowsdropdown navigation (class/subject/status)
Right-clickcontext menu = long-press menu
Hoverm-fast tint on cards/rows; tooltip after 500 ms
Focusvisible ring everywhere; logical traversal (09 §6)

3. Haptics (mobile)

EventHaptic
Submit successlightImpact
Grade savedlightImpact
409 duplicate (already submitted)selectionClick (informational)
Delete confirmheavyImpact
Upload complete (per file)selectionClick
Upload failedmediumImpact
Ruleoff when system haptics off; none on desktop (08 §3)

4. Motion language (module extension of 08 §4)

TransitionDuration/curveUsed by
List → detailm-base slide (+ Hero on card title m-slow)detail open
Form openm-base slide-upcreate/edit/submit
Status chip changeAnimatedSwitcher fade m-fastsubmitted→graded
Row removal after deletem-base fade/slidelist
Card entrancem-entrance stagger 40 mslist load
Upload progress bardeterminate m-instant updatesattachment uploader
Late badge appearm-fast popcomputed on load

Reduced-motion: fades + instant only; no stagger, no hero, no shake.

5. Micro-interactions catalogue

InteractionDetail
Submit pressedbutton loading swap m-base, double-tap locked, haptic on success
409 already-submittedform swaps to success-ish state + info banner; no red flash
Grade savedsnackbar "Grade saved" + row re-animates (marks badge pop m-fast)
Attachment uploadedchip icon morph file→check m-fast; progress 100% → selectionClick
Attachment failedred ring + failed chip + Retry button; error persists until acted
Delete homeworkconfirm dialog → server confirm → row fade-out; snackbar "Homework deleted" (no undo — no restore endpoint)
Regrade confirmwarning banner inside sheet + dialog if a previous grade exists

6. Frustration controls (shared 08 §6 + module)

  • All presses respond < 100 ms with m-fast ripple.
  • Every network action shows pending state (button spinner, per-file progress, skeleton).
  • Submit/grade buttons disabled while pending — anti-double-submit.
  • Uploads never fail silently: per-file error + retry.
  • Errors persist until corrected/dismissed (persistent banner for 409/regrade warnings).
  • No auto-retry on 429; countdown shown.
  • studylyon://homework/:id → detail; notification tap (graded/submitted) → detail.
  • Attachment preview: copy text-selection in PDF; share via platform sheet.
  • Marks entry: paste a number is accepted; formatter strips non-digits.

8. Validation of interaction to server semantics

  • Never block submit client-side on dueDate (server accepts late — OQ-1).
  • Never allow a second submission in UI (409 is the boundary; UI treats it as done).
  • Grade feedback always rendered from the server doc (marks? may be absent while status='submitted'homework-submission.schema.ts:24,30-31).
  • Delete = soft delete; the row must disappear from lists (isDeleted filter, base.repository.ts:20-30) but the client must not assume the file records are gone.
  • No optimistic mutations anywhere in the module (create/submit/grade/delete all server-confirmed — 00-shared/07 §9).