Skip to content

fix: allow feedback updates and surface submission state in UI - #72

Merged
clates merged 5 commits into
mainfrom
fix/html-worksheet-followups
May 26, 2026
Merged

fix: allow feedback updates and surface submission state in UI#72
clates merged 5 commits into
mainfrom
fix/html-worksheet-followups

Conversation

@clates

@clates clates commented May 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • 400 on re-submit fixed: save_packet_feedback now upserts (UPDATE if exists, INSERT if not) instead of raising on duplicate
  • Student profile stays correct on update: reverse_quantity_feedback undoes the prior activity_bias adjustment before the corrected value is applied; mastery re-processing appends a correction entry to history
  • UI knows about existing feedback: list_weekly_packets LEFT JOINs packet_feedback to surface has_feedback and feedback_completed_at on every packet summary
  • Modal pre-populates on edit: existing feedback is fetched when opening the modal for a packet with has_feedback=true; mastery and quantity ratings are pre-populated
  • State-aware button: plan detail shows "Edit Feedback" vs "Provide Feedback" vs disabled "Feedback Submitted" (locked after 3 weeks)

Test Plan

  • Submit feedback for a packet for the first time — succeeds as before
  • Re-open the plan detail for that packet — button reads "Edit Feedback"
  • Click "Edit Feedback" — modal pre-populates with previous selections
  • Change a rating and submit — 204, profile updated correctly (no double-apply)
  • For a packet with feedback_completed_at older than 3 weeks — button reads "Feedback Submitted" and is disabled
  • 108 tests passing (excluding pre-existing phonics script test)

🤖 Generated with Claude Code

clates and others added 5 commits April 19, 2026 12:58
Two bugs:
- Print endpoint was walking the packet JSON blob for artifacts, but
  artifacts are stored in the worksheet_artifacts DB table. Switch to
  list_packet_artifacts() like the manifest endpoint does.
- HTML artifact downloads forced Content-Disposition: attachment, causing
  a file download instead of opening in the browser. HTML is now served
  inline (text/html + Content-Disposition: inline) for a seamless
  view-then-print workflow.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
260 words across 4 blend families (L, R, S, Final).
20% of words displayed with grapheme-chunk markup (blend in accent
color + middle-dot separator). OpenDyslexic font, letter-size,
auto-print on load.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Feedback was rejected with 400 when resubmitting for a packet that
already had feedback. Also, the UI showed Provide Feedback regardless
of whether feedback had been submitted.

- packet_store: upsert feedback instead of INSERT-only; add has_feedback
  and feedback_completed_at to list_weekly_packets via LEFT JOIN
- feedback_processor: add reverse_quantity_feedback to undo prior
  activity_bias before applying a corrected value
- main: fetch existing feedback before processing; reverse old quantity
  effect when updating
- frontend: surface has_feedback/feedback_completed_at in types;
  add getFeedback API call; pre-populate modal with existing values;
  show Edit Feedback vs Provide Feedback; lock after 3 weeks

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@clates
clates merged commit 32eeb9d into main May 26, 2026
2 checks passed
@clates
clates deleted the fix/html-worksheet-followups branch May 26, 2026 22:51
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.

1 participant