Add filter & sort options for single course FCE aggregation #203

Open
opened 2026-06-19 06:05:03 +00:00 by TenType · 0 comments
TenType commented 2026-06-19 06:05:03 +00:00 (Migrated from codeberg.org)

Objectives

Run /fce on a single course and select Aggregate by Instructor or All Semesters. By default, this filters out summer FCEs (keep only Fall/Spring unless we don't have that data) and sorts by most recent first.

We want to add a button that lets the user edit how we filter and sort the output. When the button is clicked, the user should be presented with these options:

  • Semesters to include - dropdown, multi-select every semester available (e.g. F25, S26, and M25)
    • Note that F = Fall, S = Spring, and M = Summer.
  • Sort option - dropdown, select one of sort by Teaching, Course, Workload, Response Rate, A-Z, Most Recently Taught, etc
  • Sort order - dropdown, select one of ascending or descending

When the user submits those options, the original FCE embed should be edited to reflect their filter & sort options, with a note in the footer indicating what they selected.

Suggested Approach

The crux of the work will be done in src/commands/fce.ts. The current file is split into two halves: running /fce on a single course, and running /fce on multiple courses. You'll only need to focus on the former.

Our codebase is unique in that we have an EmbedPaginator class to handle automatic pagination and buttons for navigating pages. Add a "Filter & Sort" button to that paginator's components in the FCE code here.

Edit the onCollect function in the paginator's parameters such that when we receive a new button click interaction, we present the user with an ephemeral components v2 embed that displays the dropdown and a green Submit button. src/commands/redirect-setup.ts does something similar; refer to that file for an example of how to do this!

Finally, filter and reorder byInstructorEntries and allSemesterEntries as appropriate and edit the original embed message when the submit button is pressed.

You may also need to edit the testcases in tests/fce.test.ts.

## Objectives Run `/fce` on a single course and select Aggregate by Instructor or All Semesters. By default, this filters out summer FCEs (keep only Fall/Spring unless we don't have that data) and sorts by most recent first. We want to add a button that lets the user edit how we filter and sort the output. When the button is clicked, the user should be presented with these options: - Semesters to include - dropdown, multi-select every semester available (e.g. `F25`, `S26`, and `M25`) - Note that F = Fall, S = Spring, and M = Summer. - Sort option - dropdown, select one of sort by Teaching, Course, Workload, Response Rate, A-Z, Most Recently Taught, etc - Sort order - dropdown, select one of ascending or descending When the user submits those options, the original FCE embed should be edited to reflect their filter & sort options, with a note in the footer indicating what they selected. ## Suggested Approach The crux of the work will be done in `src/commands/fce.ts`. The current file is split into two halves: running `/fce` on a single course, and running `/fce` on multiple courses. You'll only need to focus on the former. Our codebase is unique in that we have an `EmbedPaginator` class to handle automatic pagination and buttons for navigating pages. Add a "Filter & Sort" button to that paginator's components in the FCE code [here](https://codeberg.org/ScottyLabs/dalmatian/src/commit/482959210e159d0fb5a79ae9034868ad14fce494/src/commands/fce.ts#L257). Edit the `onCollect` function in the paginator's parameters such that when we receive a new button click interaction, we present the user with an ephemeral [components v2](https://discordjs.guide/legacy/popular-topics/display-components) embed that displays the dropdown and a green Submit button. `src/commands/redirect-setup.ts` does something similar; refer to that file for an example of how to do this! Finally, filter and reorder `byInstructorEntries` and `allSemesterEntries` as appropriate and edit the original embed message when the submit button is pressed. You may also need to edit the testcases in `tests/fce.test.ts`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ScottyLabs/dalmatian#203
No description provided.