diff --git a/AGENTS.md b/AGENTS.md index 42fdcad..d84ef12 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -85,7 +85,7 @@ Solid components run **once**, there is no re-render: - `docs/role-scope-matrix.md` — role access matrix for pages/nav/dashboard cards. - `docs/backend-ui-alignment-plan.md` — completed backend-alignment archive; do not treat it as active work unless backend scope changes. - Durable resources use full detail pages. Short create/edit/filter work uses `SidePanel`. Destructive actions use confirm dialogs. -- Header create actions use compact icon+label buttons with consistent size and current radius. +- Header create actions use compact icon+label buttons with consistent size and current radius (e.g. `variant="outline" size="sm" class="rounded-lg"` in `SectionDisclosure` header `actions`). Action buttons inside sub-panels must not duplicate section headers — primary create/add/assign actions must be placed in the header `actions` prop of the parent disclosure or page header. - Application tables must use `src/components/ui/data-table.tsx` `DataTable`. Pages/domain components must not import or render `Table` primitives directly; only the `DataTable` wrapper and table primitive files may do that. diff --git a/src/components/courses/course-teachers-panel.tsx b/src/components/courses/course-teachers-panel.tsx index e94c2ad..585a05b 100644 --- a/src/components/courses/course-teachers-panel.tsx +++ b/src/components/courses/course-teachers-panel.tsx @@ -18,10 +18,11 @@ export function CourseTeachersPanel(props: { courseId: string; teachers: PersonRef[]; canStaff: boolean; + assignOpen: boolean; + onAssignOpenChange: (open: boolean) => void; onCourseUpdated: () => void; }) { const t = useT(); - const [showAssignPanel, setShowAssignPanel] = createSignal(false); const [selectedTeacherId, setSelectedTeacherId] = createSignal(""); const [removeTarget, setRemoveTarget] = createSignal(null); const [error, setError] = createSignal(""); @@ -79,7 +80,7 @@ export function CourseTeachersPanel(props: { await postCourseTeacher(props.courseId, teacherId); setFlash(t("courses.teacherAssigned")); setSelectedTeacherId(""); - setShowAssignPanel(false); + props.onAssignOpenChange(false); props.onCourseUpdated(); } catch (err) { setError(formatApiError(err)); @@ -116,16 +117,6 @@ export function CourseTeachersPanel(props: { {error()} -
-

{t("courses.teachers")}

- - - -
- 0} fallback={ @@ -134,7 +125,7 @@ export function CourseTeachersPanel(props: { description="" action={ props.canStaff ? ( - @@ -147,9 +138,9 @@ export function CourseTeachersPanel(props: { { - setShowAssignPanel(open); + props.onAssignOpenChange(open); if (!open) { setSelectedTeacherId(""); setError(""); @@ -177,7 +168,7 @@ export function CourseTeachersPanel(props: { + + } >