Skip to content

fix: small QA findings (task reads, favicon, initials, in-app dialogs) - #48

Merged
anishmehta24 merged 4 commits into
mainfrom
fix/qa-small-things
Nov 18, 2026
Merged

anishmehta24 merged 4 commits into
mainfrom
fix/qa-small-things

Conversation

@anishmehta24

Copy link
Copy Markdown
Collaborator

Summary

These fix the smaller findings from the QA pass in #47.

  • Task reads are staff-only. GET /tasks, /tasks/my, /tasks/my/stats and /tasks/:id had no role rule, so a student got an empty list. They now need Admin, HOD or Faculty, the same as the task writes. No student page calls them.
  • Favicon. The site had none, so the tab icon was blank and /favicon.ico returned 404. app/icon.svg is the sidebar's mark: a cap on a blue square.
  • Avatar initials skip titles. "Dr. Priya Sharma" showed DS and now shows PS. The titles skipped are Dr, Prof, Mr, Mrs, Ms, Miss, Sir, Shri and Smt. A name made only of a title still gets initials.
  • No more browser pop-ups. Exams, assignments, files and timetable used window.confirm and alert. They now use the shared Dialog, the same pattern as deactivating an account:
    • Deleting an exam, assignment, file or timetable slot, removing a paper, and publishing results each ask in the dialog.
    • If the action fails, the reason shows inside the dialog.
    • Other errors show on the page. A successful publish shows "Results were calculated and published for N students."
  • Assignment Delete button. It only appeared once an assignment had submissions, so an empty assignment couldn't be deleted. It now shows for staff, and the API still checks that they run the class.

Rules used

  • Tasks are staff work, so students get 403 on reads as well as writes.
  • Confirmation and error copy say plainly what will happen, including when something can't be undone.

Validation

  • pnpm test: 380 pass. A new test checks that the four task reads require ADMIN, HOD or FACULTY.
  • pnpm lint, pnpm typecheck, api and db build, next build, git diff --check: pass.
  • Live check on the QA database in headless Chrome: 26 of 26 pass.
    • Students get 403 on all four task reads; faculty and admin get 200.
    • The login page links /icon.svg, it serves with 200, and there's no favicon 404.
    • The faculty header shows PS.
    • Files, assignment, exam paper, exam and timetable deletes open the dialog. Cancel keeps the item, and confirming removes it.
    • An approved paper has no Remove button.
    • Publishing shows the notice on the page.
    • An assignment with no submissions can be deleted.
    • Student pages make no 403 calls.
    • No native browser dialog opened at any point.

GET /tasks, /tasks/my, /tasks/my/stats and /tasks/:id had no role rule, so a student got an empty list instead of a 403. Tasks are staff work, so these now require Admin, HOD or Faculty like the writes do.
The site had no icon, so browsers showed a blank tab icon and requested /favicon.ico, which 404'd. app/icon.svg is the sidebar's cap-on-blue mark.
Initials took the first word, so Dr. Priya Sharma showed DS. Honorifics such as Dr., Prof., Mr. and Ms. are skipped now (PS); a name that is only a title still gets initials.
Exams, assignments, files and timetable asked with window.confirm and reported errors with alert. They now use the shared Dialog: deletes, removing a paper and publishing results ask there, a failure shows its reason in the dialog, and other errors and the publish outcome show on the page.

The assignment Delete button only appeared once the assignment had submissions, so an empty one could not be deleted; it now shows for the staff who can delete.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T16:22:18.546230Z d23a9e2 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@anishmehta24
anishmehta24 merged commit b4f2519 into main Nov 18, 2026
@anishmehta24
anishmehta24 deleted the fix/qa-small-things branch November 18, 2026 16:23
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