Skip to content

feat: add "no conflict with schedule" filter to catalog#1145

Merged
ARtheboss merged 2 commits into
mainfrom
advay/schedule-conflict-filter
May 19, 2026
Merged

feat: add "no conflict with schedule" filter to catalog#1145
ARtheboss merged 2 commits into
mainfrom
advay/schedule-conflict-filter

Conversation

@ARtheboss
Copy link
Copy Markdown
Contributor

Adds a new filter option that allows users to select one of their schedules and filter out catalog classes that conflict with non-hidden items in that schedule.

  • Extract conflict detection utilities to lib/schedule/conflict.ts
  • Add ScheduleConflictFilter component (only shown when logged in)
  • Add meetings field to catalog search query for conflict detection
  • Filter classes client-side based on schedule conflicts

Adds a new filter option that allows users to select one of their
schedules and filter out catalog classes that conflict with non-hidden
items in that schedule.

- Extract conflict detection utilities to lib/schedule/conflict.ts
- Add ScheduleConflictFilter component (only shown when logged in)
- Add meetings field to catalog search query for conflict detection
- Filter classes client-side based on schedule conflicts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ARtheboss ARtheboss requested review from PineND and sashakmurray May 17, 2026 17:15
@github-actions
Copy link
Copy Markdown

Linting Failed

Note: The status check will always pass. Run npm run lint -- --continue to see the full output locally.

Click to expand lint output

> lint
> turbo run lint --continue --output-logs=errors-only


Attention:
Turborepo now collects completely anonymous telemetry regarding usage.
This information is used to shape the Turborepo roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://turborepo.com/docs/telemetry

• Packages in scope: @repo/BtLL, @repo/common, @repo/eslint-config, @repo/gql-typedefs, @repo/shared, @repo/sis-api, @repo/storybook, @repo/theme, @repo/typescript-config, ag-frontend, api-sandbox, backend, datapuller, frontend, staff-frontend
• Running lint in 15 packages
• Remote caching disabled
�[;31mbackend:lint�[;0m
cache miss, executing d36054bbf490c50b

> lint
> eslint src/


/home/runner/work/berkeleytime/berkeleytime/apps/backend/src/bootstrap/loaders/apollo.ts
  193:10  error  'getOperationName' is defined but never used  @typescript-eslint/no-unused-vars

✖ 1 problem (1 error, 0 warnings)

npm error Lifecycle script `lint` failed with error:
npm error code 1
npm error path /home/runner/work/berkeleytime/berkeleytime/apps/backend
npm error workspace backend
npm error location /home/runner/work/berkeleytime/berkeleytime/apps/backend
npm error command failed
npm error command sh -c eslint src/
[WARN] command finished with error, but continuing...
�[;31mfrontend:lint�[;0m
cache miss, executing 599cc2de1d7833ab

> lint
> eslint src/


/home/runner/work/berkeleytime/berkeleytime/apps/frontend/src/app/GradTrak/BtLLInterface/index.tsx
  30:17  warning  Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components  react-refresh/only-export-components

/home/runner/work/berkeleytime/berkeleytime/apps/frontend/src/components/BubbleCard/index.tsx
  106:10  warning  Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components  react-refresh/only-export-components

/home/runner/work/berkeleytime/berkeleytime/apps/frontend/src/components/Capacity/index.tsx
  9:14  warning  Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components  react-refresh/only-export-components

/home/runner/work/berkeleytime/berkeleytime/apps/frontend/src/components/Chart/ChartContext.tsx
  7:17  warning  Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components  react-refresh/only-export-components

/home/runner/work/berkeleytime/berkeleytime/apps/frontend/src/components/Chart/index.tsx
   2:10  warning  Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components  react-refresh/only-export-components
   7:10  warning  Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components  react-refresh/only-export-components
  10:3   warning  Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components  react-refresh/only-export-components
  11:3   warning  Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components  react-refresh/only-export-components
  12:3   warning  Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components  react-refresh/only-export-components
  13:3   warning  Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components  react-refresh/only-export-components

/home/runner/work/berkeleytime/berkeleytime/apps/frontend/src/components/ClassBrowser/Filters/ScheduleConflictFilter.tsx
  9:8  error  Unused classes found in Filters.module.scss: root, body, closeFiltersButton, filtersHeader, filtersTitle, clearButton, sortControls, sortToggleButton, timeRangeInputs, timeInputGroup, timeLabel, timeInput, requirementsSelectContent, requirementsTabs  css-modules/no-unused-class

/home/runner/work/berkeleytime/berkeleytime/apps/frontend/src/components/ScheduleSummary/index.tsx
  11:14  warning  Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components  react-refresh/only-export-components

✖ 12 problems (1 error, 11 warnings)

npm error Lifecycle script `lint` failed with error:
npm error code 1
npm error path /home/runner/work/berkeleytime/berkeleytime/apps/frontend
npm error workspace frontend
npm error location /home/runner/work/berkeleytime/berkeleytime/apps/frontend
npm error command failed
npm error command sh -c eslint src/
[WARN] command finished with error, but continuing...
::error::backend#lint: command (/home/runner/work/berkeleytime/berkeleytime/apps/backend) /opt/hostedtoolcache/node/22.12.0/x64/bin/npm run lint exited (1)
::error::frontend#lint: command (/home/runner/work/berkeleytime/berkeleytime/apps/frontend) /opt/hostedtoolcache/node/22.12.0/x64/bin/npm run lint exited (1)

 Tasks:    5 successful, 7 total
Cached:    0 cached, 7 total
  Time:    11.897s 
Failed:    backend#lint, frontend#lint

 ERROR  run failed: command  exited (1)

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b8384c6afd

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

page: queryResult.page,
pageSize: queryResult.pageSize,
hasNextPage: queryResult.hasNextPage,
hasNextPage: selectedSchedule ? false : queryResult.hasNextPage,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep pagination enabled when conflict filter is active

In useCatalogBrowser, setting hasNextPage to false whenever a schedule is selected stops List from calling loadNextPage, so conflict filtering only runs on the first page of catalog results (25 classes) and silently drops all later matches. This makes the "No Conflict With Schedule" results incomplete for any query with more than one page, including the common case where the selected schedule has no meetings (which should return all classes).

Useful? React with 👍 / 👎.

const selectedSchedule = useMemo(() => {
if (!filterState.scheduleConflictFilter || !schedules) return null;
return (
schedules.find((s) => s?._id === filterState.scheduleConflictFilter) ??
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restrict selected schedule to the current term

The selected schedule lookup only matches by _id and ignores year/semester, so after a user switches catalog term, a previously selected schedule from another term can remain active and still filter results. Because ScheduleConflictFilter hides itself when there are no schedules in the new term, this leaves an effectively hidden cross-term filter that users cannot adjust from the control.

Useful? React with 👍 / 👎.

- Keep pagination working when schedule filter is active so all pages
  can be loaded and filtered (not just first 25 classes)
- Validate selected schedule matches current term (year + semester)
  to prevent hidden cross-term filtering when switching catalog terms

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

Linting Failed

Note: The status check will always pass. Run npm run lint -- --continue to see the full output locally.

Click to expand lint output

> lint
> turbo run lint --continue --output-logs=errors-only


Attention:
Turborepo now collects completely anonymous telemetry regarding usage.
This information is used to shape the Turborepo roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://turborepo.com/docs/telemetry

• Packages in scope: @repo/BtLL, @repo/common, @repo/eslint-config, @repo/gql-typedefs, @repo/shared, @repo/sis-api, @repo/storybook, @repo/theme, @repo/typescript-config, ag-frontend, api-sandbox, backend, datapuller, frontend, staff-frontend
• Running lint in 15 packages
• Remote caching disabled
�[;31mbackend:lint�[;0m
cache miss, executing d36054bbf490c50b

> lint
> eslint src/


/home/runner/work/berkeleytime/berkeleytime/apps/backend/src/bootstrap/loaders/apollo.ts
  193:10  error  'getOperationName' is defined but never used  @typescript-eslint/no-unused-vars

✖ 1 problem (1 error, 0 warnings)

npm error Lifecycle script `lint` failed with error:
npm error code 1
npm error path /home/runner/work/berkeleytime/berkeleytime/apps/backend
npm error workspace backend
npm error location /home/runner/work/berkeleytime/berkeleytime/apps/backend
npm error command failed
npm error command sh -c eslint src/
[WARN] command finished with error, but continuing...
�[;31mfrontend:lint�[;0m
cache miss, executing 7d90b5ce2a071f23

> lint
> eslint src/


/home/runner/work/berkeleytime/berkeleytime/apps/frontend/src/app/GradTrak/BtLLInterface/index.tsx
  30:17  warning  Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components  react-refresh/only-export-components

/home/runner/work/berkeleytime/berkeleytime/apps/frontend/src/components/BubbleCard/index.tsx
  106:10  warning  Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components  react-refresh/only-export-components

/home/runner/work/berkeleytime/berkeleytime/apps/frontend/src/components/Capacity/index.tsx
  9:14  warning  Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components  react-refresh/only-export-components

/home/runner/work/berkeleytime/berkeleytime/apps/frontend/src/components/Chart/ChartContext.tsx
  7:17  warning  Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components  react-refresh/only-export-components

/home/runner/work/berkeleytime/berkeleytime/apps/frontend/src/components/Chart/index.tsx
   2:10  warning  Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components  react-refresh/only-export-components
   7:10  warning  Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components  react-refresh/only-export-components
  10:3   warning  Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components  react-refresh/only-export-components
  11:3   warning  Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components  react-refresh/only-export-components
  12:3   warning  Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components  react-refresh/only-export-components
  13:3   warning  Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components  react-refresh/only-export-components

/home/runner/work/berkeleytime/berkeleytime/apps/frontend/src/components/ClassBrowser/Filters/ScheduleConflictFilter.tsx
  9:8  error  Unused classes found in Filters.module.scss: root, body, closeFiltersButton, filtersHeader, filtersTitle, clearButton, sortControls, sortToggleButton, timeRangeInputs, timeInputGroup, timeLabel, timeInput, requirementsSelectContent, requirementsTabs  css-modules/no-unused-class

/home/runner/work/berkeleytime/berkeleytime/apps/frontend/src/components/ScheduleSummary/index.tsx
  11:14  warning  Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components  react-refresh/only-export-components

✖ 12 problems (1 error, 11 warnings)

npm error Lifecycle script `lint` failed with error:
npm error code 1
npm error path /home/runner/work/berkeleytime/berkeleytime/apps/frontend
npm error workspace frontend
npm error location /home/runner/work/berkeleytime/berkeleytime/apps/frontend
npm error command failed
npm error command sh -c eslint src/
[WARN] command finished with error, but continuing...
::error::backend#lint: command (/home/runner/work/berkeleytime/berkeleytime/apps/backend) /opt/hostedtoolcache/node/22.12.0/x64/bin/npm run lint exited (1)
::error::frontend#lint: command (/home/runner/work/berkeleytime/berkeleytime/apps/frontend) /opt/hostedtoolcache/node/22.12.0/x64/bin/npm run lint exited (1)

 Tasks:    5 successful, 7 total
Cached:    0 cached, 7 total
  Time:    11.947s 
Failed:    backend#lint, frontend#lint

 ERROR  run failed: command  exited (1)

@ARtheboss ARtheboss merged commit 2f75e3b into main May 19, 2026
5 checks passed
@ARtheboss ARtheboss deleted the advay/schedule-conflict-filter branch May 19, 2026 23:11
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