Repository navigation
Feat/28 mini algo - #48
Merged
Merged
Conversation
…e-Sticker-Micro-Business
…e-Sticker-Micro-Business
or8655
reviewed
Nov 2, 2026
or8655
reviewed
Nov 3, 2026
or8655
left a comment
Contributor
There was a problem hiding this comment.
This looks great! I have three suggestions:
- Our model tier UML class diagram depicts stickers having height and width, not an area. Your algorithm should use the sticker's height and width to calculate its area.
- The algorithm should account for individual stickers and not group them together. The current algorithm takes each sticker and multiplies its area by the quantity present in the staging area. If that sticker gets examined during the algorithm, the area freed by removing it would be the equivalent of the area freed by removing all quantities of the sticker, not just one. Due to time constraints, I think this is acceptable, but it should be noted as an intentional design choice so that we don't forget and future developers understand why the algorithm does this.
- In the future, when you write complicated code, please include inline comments to explain your thought process behind the code. It makes it easier for reviewers to understand what your code is doing, and helps future developers understand and contribute to your code.
| const stickerArea = stickerToAdd.sticker.height * stickerToAdd.sticker.width * stickerToAdd.quantity; | ||
|
|
||
| // sticker cannot fit in area capacity? | ||
| if (stickerArea > STAGING_AREA_CAPACITY) { |
Contributor
There was a problem hiding this comment.
Not an issue for this ticket, but this is a good reminder that we need to think about how to handle sellers wanting to post stickers that can't fit alone on a half sheet
bug: fixing test that was missing implementation
or8655
reviewed
Nov 5, 2026
| const selected: typeof candidates = []; | ||
|
|
||
| // Recursive function to find a list of options to remove from the stickers in the staging area. | ||
| function collectOptions(startIndex: number, freedArea: number): void { |
Contributor
There was a problem hiding this comment.
I strongly suggest adding back the comments that explain what the arguments to this function are. This will help future developers understand what this function does quickly.
Also, why not move the function outside of the loop?
Contributor
|
My only suggestion is the one I commented above. I think this PR is ready to be merged. |
or8655
approved these changes
Nov 5, 2026
* build(deps-dev): bump vite from 8.3.2 to 8.3.5 in /frontend (#44) Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 8.3.2 to 8.3.5. - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v8.3.5/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-version: 8.3.5 dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * docs(4up): week 11 (#49) * feat: ci/cd gh actions (#53) * feat: ci/cd gh actions * docs(README): Moving CI section for better flow * ci: run frontend and backend workflows on pushes to main --------- Co-authored-by: Wesley-Fos <wwf4167@rit.edu> Co-authored-by: Oscar Rojas-Perez <or8655@rit.edu> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Oscar Rojas <94993190+or8655@users.noreply.github.com> Co-authored-by: Wesley-Fos <wwf4167@rit.edu> Co-authored-by: Oscar Rojas-Perez <or8655@rit.edu>
* build(deps-dev): bump vite from 8.3.2 to 8.3.5 in /frontend (#44) Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 8.3.2 to 8.3.5. - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v8.3.5/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-version: 8.3.5 dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * docs(4up): week 11 (#49) * feat: ci/cd gh actions (#53) * feat: ci/cd gh actions * docs(README): Moving CI section for better flow * ci: run frontend and backend workflows on pushes to main --------- Co-authored-by: Wesley-Fos <wwf4167@rit.edu> Co-authored-by: Oscar Rojas-Perez <or8655@rit.edu> * feat: moving things and fixing merge conflicts --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Oscar Rojas <94993190+or8655@users.noreply.github.com> Co-authored-by: Wesley-Fos <wwf4167@rit.edu> Co-authored-by: Oscar Rojas-Perez <or8655@rit.edu>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes
Mini algorithm for determining if a sticker can be added to a staging area.
Issue/Story ticket number and link
#28
Checklist before requesting a review