Skip to content

set up the UI - #5

Merged
Niro0526 merged 1 commit into
masterfrom
niroja
Sep 4, 2026
Merged

Niro0526 merged 1 commit into
masterfrom
niroja

Conversation

@Niro0526

@Niro0526 Niro0526 commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@Niro0526
Niro0526 merged commit fc9ab1a into master Sep 4, 2026
1 of 2 checks passed
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Improve course filters and surface unavailable cutoffs

✨ Enhancement 🐞 Bug fix 🕐 20-40 Minutes

Grey Divider

AI Description

• Distinguishes courses with unavailable district cutoffs from eligible and ineligible results.
• Reorganizes course search and filters into a responsive, resettable layout.
• Truncates long select labels and improves empty-filter guidance.
Diagram

graph TD
  A["Checker API"] --> B["Typed groups"] --> C["Status filters"] --> D["Result cards"]
  E["Course API"] --> F["Course filters"] --> G["Course grid"]
  H["Select control"] --> F
Loading
High-Level Assessment

The current approach is appropriate: it extends the existing result-group contract, reuses established filtering state, and improves the shared select primitive rather than introducing page-specific dropdown behavior. Deriving unavailable-cutoff courses from another group in the client was considered but would duplicate domain classification logic and risk inconsistent labels.

Files changed (4) +185 / -95

Enhancement (3) +183 / -93
checker.tsAdd the cutoff-unavailable checker result group +1/-1

Add the cutoff-unavailable checker result group

• Extends the checker response contract with a dedicated 'cutoffUnavailable' group so clients can represent programmes meeting handbook requirements without a district cutoff.

frontend/src/api/checker.ts

checker-results.tsxDisplay and filter cutoff-unavailable recommendations +56/-13

Display and filter cutoff-unavailable recommendations

• Adds a dedicated unavailable-cutoff result collection, count, filter tab, search inclusion, and explanatory status text. Uses amber styling and a help icon to distinguish these recommendations from eligible and ineligible outcomes.

frontend/src/components/checker/checker-results.tsx

courses.tsxReorganize course filters and add reset actions +126/-79

Reorganize course filters and add reset actions

• Moves search and eligibility controls into a responsive row and arranges metadata filters in a responsive grid. Adds reset actions, university-name fallbacks and tooltips, plus a guided empty-results state.

frontend/src/pages/courses.tsx

Bug fix (1) +2 / -2
select.tsxPrevent long select values from overflowing +2/-2

Prevent long select values from overflowing

• Adds spacing, truncation, alignment, and minimum-width handling to selected values while preventing the dropdown icon from shrinking.

frontend/src/components/ui/select.tsx

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Cutoff tab always empty 🐞 Bug ≡ Correctness
Description
The UI reads a new groups.cutoffUnavailable array, but the checker backend still returns only
eligible and notEligible and places missing-cutoff recommendations in notEligible.
Consequently, the new tab always shows zero courses while NQC/new courses remain under Non-Eligible.
Code

frontend/src/components/checker/checker-results.tsx[R259-260]

+  const cutoffUnavailable = useMemo(
+    () => [...(res?.groups?.cutoffUnavailable ?? [])].sort((a, b) => a.courseName.localeCompare(b.courseName)),
Evidence
The backend recognizes a missing cutoff and assigns the corresponding status, but its response
contract and grouping logic expose only two groups. The changed frontend exclusively sources the new
tab and count from a third group that the backend never sends.

backend/src/db/official-handbook-query.ts[116-127]
backend/src/db/official-handbook-query.ts[474-478]
backend/src/db/official-handbook-query.ts[531-540]
backend/src/db/official-handbook-query.ts[596-600]
frontend/src/components/checker/checker-results.tsx[259-272]
frontend/src/components/checker/checker-results.tsx[363-378]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The frontend introduces a `cutoffUnavailable` recommendation group, but the backend response does not define or populate it. Courses that meet handbook requirements but have no district cutoff are therefore returned under `notEligible`, leaving the new tab empty.

## Issue Context
Keep frontend and backend response contracts aligned. During backend grouping, place recommendations where `meetsHandbookRequirements` is true and `officialCutoff` is null into `cutoffUnavailable`, and include that group in the response type, initialization, and sorting/tests.

## Fix Focus Areas
- frontend/src/api/checker.ts[102-140]
- frontend/src/components/checker/checker-results.tsx[251-278]
- backend/src/db/official-handbook-query.ts[116-127]
- backend/src/db/official-handbook-query.ts[474-478]
- backend/src/db/official-handbook-query.ts[531-540]
- backend/src/db/official-handbook-query.ts[596-620]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
Review mode: ⚖️ Balanced: This changes runtime UI filtering and checker-result classification across multiple components, creating meaningful behavioral risk but not enough independent logic density to warrant redundant extended review.

Grey Divider

Tip of the day
💡 Did you know, you can route each action level your way: inline, summary, both, or drop

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment on lines +259 to +260
const cutoffUnavailable = useMemo(
() => [...(res?.groups?.cutoffUnavailable ?? [])].sort((a, b) => a.courseName.localeCompare(b.courseName)),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Cutoff tab always empty 🐞 Bug ≡ Correctness

The UI reads a new groups.cutoffUnavailable array, but the checker backend still returns only
eligible and notEligible and places missing-cutoff recommendations in notEligible.
Consequently, the new tab always shows zero courses while NQC/new courses remain under Non-Eligible.
Agent Prompt
## Issue description
The frontend introduces a `cutoffUnavailable` recommendation group, but the backend response does not define or populate it. Courses that meet handbook requirements but have no district cutoff are therefore returned under `notEligible`, leaving the new tab empty.

## Issue Context
Keep frontend and backend response contracts aligned. During backend grouping, place recommendations where `meetsHandbookRequirements` is true and `officialCutoff` is null into `cutoffUnavailable`, and include that group in the response type, initialization, and sorting/tests.

## Fix Focus Areas
- frontend/src/api/checker.ts[102-140]
- frontend/src/components/checker/checker-results.tsx[251-278]
- backend/src/db/official-handbook-query.ts[116-127]
- backend/src/db/official-handbook-query.ts[474-478]
- backend/src/db/official-handbook-query.ts[531-540]
- backend/src/db/official-handbook-query.ts[596-620]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

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