Skip to content

Library upload: inline '+ Add a course' succeeds but never appears in the per-file dropdown #186

@Jose-Gael-Cruz-Lopez

Description

@Jose-Gael-Cruz-Lopez

Severity: Medium
Labels: bug, frontend, P2
Location: frontend/src/components/DocumentUploadModal.tsx:256-269 (addCourseInline), per-item course select :415-422

Description

addCourseInline calls addCourse(...), toasts success, and clears the search — but courses is owned by the parent (Library.load()), which only refetches in onComplete (fired on done/close). So after adding a course inline, the per-file Course dropdown still doesn't list it; the user can't assign their file to the just-added course without closing and reopening the modal.

Steps to reproduce

  1. In the upload modal, use "+ Add a course" to add a new course (success toast appears).
  2. Open a file's Course dropdown — the new course isn't there.

Expected vs actual

  • Expected: the newly added course is immediately selectable.
  • Actual: absent until the modal is reopened.

Suggested fix

Lift the added course into modal state and merge it into the dropdown options immediately (or expose an onCoursesChanged callback that refreshes the prop live).

Acceptance criteria

  • A course added inline appears in the per-file dropdown without reopening the modal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium prioritybugSomething isn't workingfrontendFrontend / UI

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions