/credits large exam component failures #209
Labels
No labels
beginner friendly
bug
chore
documentation
duplicate
feature
help wanted
invalid
needs-triage
question
size/L
size/M
size/S
size/XL
size/XS
urgent
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ScottyLabs/dalmatian#209
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Overall Objective
/creditsbuilds invalid Discord Components V2 payloads when enough exams or awarded courses are rendered:Current form sizing:
Current result sizing is worse:
src/commands/credits.tsadds Gened data not available inside the per-award loop, so result containers can fail with even fewer selected examsSecondary issue related to this:
src/utils/creditCalculatorForm.tsembeds raw exam names in score-selectcustom_id, but the current IB ITGS HL exam name creates a score-select custom ID of length 101, exceeding Discord's 100-character limitSuggested Approach
One can use some form of compact, paginated views instead of one component per exam/course:
TextDisplaycomponents with one boundedTextDisplaysummary; show all selected exams when short, otherwise show the first N and+ X morecredits:score:<fieldKey>:<examIndex>:<nonce>and resolve them through the field option listTextDisplayper page rather than one component per courseA more detailed approach that I will be using for the main issue
onCompleteincredits.tsinto a pure helper returning{ awardedCourses, unitTotal, notices }SetupSchema.onCompleteto return result data or a renderable result view model (I'll see)a. Input form container with compact selected-exam summary
b. Optional score-select row with short custom ID
c. Result page container with bounded course entries and Prev/Next buttons
SetupFormformode,resultPage, and option pages if any field exceeds 25 optionscollector.stop("submitted")plusendto render results