Skip to content

feat: add a prototype for the Guild Loot Tracker lab#1078

Open
Sebastian-Wlo wants to merge 8 commits intofreeCodeCamp:mainfrom
Sebastian-Wlo:lab-nutrient-tracker-dictionary
Open

feat: add a prototype for the Guild Loot Tracker lab#1078
Sebastian-Wlo wants to merge 8 commits intofreeCodeCamp:mainfrom
Sebastian-Wlo:lab-nutrient-tracker-dictionary

Conversation

@Sebastian-Wlo
Copy link

@Sebastian-Wlo Sebastian-Wlo commented Dec 15, 2025

Checklist:

Relates to: freeCodeCamp/freeCodeCamp#64119

  • link to the related issue: Lab – Guild Loot Tracker freeCodeCamp#64119 ,
  • currently, the prototype uses for() loops and Array.prototype.sort() method,
  • I couldn't figure out how to use "Object.values()" in the functions (maybe adding a function returning the sums of ingredient macros to the requirements would be a good place to implement it?)

This adds a prototype for the Nutrient Tracker Dictionary lab.
Currently, the prototype uses "for()" loops and ".sort()" method.
Couldn't figure out how to use "Object.values()" in the functions.
Copy link
Contributor

@jdwilkin4 jdwilkin4 left a comment

Choose a reason for hiding this comment

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

Please make to include the user stories so those can be review too just in case updates need to be made there.

Also, please let us know where this falls in the curriuclum.

loops module?
review modules?
higher order functions?

we will need that information when conducting reviews 👍🏾

@Sebastian-Wlo
Copy link
Author

Just to make sure: should the user stories be a copy of those mentioned in the related issue, or should I come up with some new ones?

As for where this lab should be placed in the curriculum - originally, it was supposed to be in the Objects module. But I think listTopIngredients(), which was supposed to return sorted output requires the use of a loop. sort() would be ideal, but it should be doable with just a for() loop (I'd definitely need to make some changes to make it work).

So, Loops would probably be the right place for it.

Thank you, I'll add the user stories as soon as I can.

@majestic-owl448
Copy link
Contributor

you can use those from the issue as base, and update as needed based on changes that have been made

@Sebastian-Wlo Sebastian-Wlo deleted the lab-nutrient-tracker-dictionary branch December 16, 2025 14:08
@Sebastian-Wlo Sebastian-Wlo restored the lab-nutrient-tracker-dictionary branch December 16, 2025 14:08
@Sebastian-Wlo
Copy link
Author

Sebastian-Wlo commented Dec 16, 2025

Sorry! I tried to rename the branch without thinking what it would do to the PR.

user-stories.md has been added

@Sebastian-Wlo Sebastian-Wlo reopened this Dec 16, 2025
@majestic-owl448
Copy link
Contributor

wouldn't this project have a similar issue to the nutrient tracker that we are replacing because potentially triggering?

@Sebastian-Wlo
Copy link
Author

wouldn't this project have a similar issue to the nutrient tracker that we are replacing because potentially triggering?

Possibly, in the current form at least - someone actually pointed it out after I chose the issue.
It's possible that I misinterpreted the response, but the way I understood it was that this could still be useful, but maybe after changing its subject.

I'm not sure if it means I should come up with a different theme (I'm not the most creative person out there, so it might take some time), or leave the prototype as if for now and wait for a review.

@majestic-owl448
Copy link
Contributor

there are many other things that could be tracked in a pretty similar way, so the prototype is still good, there will be need to change the name of some things before it's ready tho

Changed "lab-nutrient-tracker-dictionary" to "lab-guild-loot-tracker" to fit the new topic for the Lab.
Changes all references in "user-stories.md" from nutrient tracking to guild loot management, and "dictionaries" to "objects".
Changed references "nutrient tracking" references in "script.js" to tracking guild loot management.
@Sebastian-Wlo
Copy link
Author

The overall "theme" has been changed to a new one (thank you once more @naomi-lgbt, if it wasn't for you, I would have been stuck at coming up with something for some time).

It will definitely need changes, since getMemberTotals() is the only function that returns a string while the other return objects (incidentally, it is unfortunately the only point where I managed to find a use for Object.values() in). I hope that at least one approach is good, and can be applied to the rest of the functions.

Should I request another review for this?

Copy link
Contributor

@jdwilkin4 jdwilkin4 left a comment

Choose a reason for hiding this comment

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

I left some thoughts on the user stories.
But also noticed that none of these functions are being used anywhere.

From an educational standpoint, we don't want to send the message to beginners to create functions in their code and not use it. All of these functions should be used in some way so campers can connect the dots and see what is actually happening in the code. Even if it is just logging these function call results to the console.

4. You should implement `listTopMembers(object, key, limit)` that sorts descending by a specific resource type (e.g., finding the member with the most `gold`).
5. You should implement `cloneGuildData(object)` to protect against accidental mutations.

Note: Use `Object.keys`, `Object.values`, and `Object.entries`. Include tests for aggregation accuracy and cloning behavior.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this just a note for yourself? Or part of the user stories?
Also, please double check in the curriculum if Object.keys, Object.values, and Object.entries has been taught by this point. My gut reaction is no. If that is the case, then you will need to update the approach for this lab.

Copy link
Author

Choose a reason for hiding this comment

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

I copied the current user stories from the original issue - the contribution guide mentions the additions of notes/tips, so I included the note from them as well. Since I've only contributed to some quiz questions before, trying to match the initial requirements as close as I could seemed safer than rewriting them (i hope that makes at least some sense).

Thank you, I'll go over the other labs in this part of the curriculum and try to make the user stories more descriptive and uniform with those.

@jdwilkin4
Copy link
Contributor

Also, please update your PR title since the project was changed 👍🏾

@Sebastian-Wlo Sebastian-Wlo changed the title feat: add a prototype for the Nutrient Tracker Dictionary lab feat: add a prototype for the Guild Loot Tracker lab Dec 24, 2025
Copy link
Contributor

@jdwilkin4 jdwilkin4 left a comment

Choose a reason for hiding this comment

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

I can't find where Object.keys, Object.values, and Object.entries is taught in the JS curriculum.

A new lesson can be added to the JS fundamentals module for that.
But until that can happen, we won't be able to add this lab to the curriculum because we can't ask campers to build projects on topics they haven't learned yet. And this lab seems to be solely dedicated to practicing those methods mentioned earlier.

So you will need to reach out to Naomi on next steps. Either we are going to wait until the new lesson has been added so this lab can be added. Or not add this new lab at all.

@Sebastian-Wlo
Copy link
Author

But until that can happen, we won't be able to add this lab to the curriculum because we can't ask campers to build projects on topics they haven't learned yet. And this lab seems to be solely dedicated to practicing those methods mentioned earlier.

That's fair - I've been trying to make the prototype work without these methods, and while it could be done, it felt like it wasn't introducing anything that wasn't already shown in the labs for the loops. It also felt more "awkward" than it probably should, if that makes sense, but I wasn't sure if that was because the lab's description didn't really fit that section, or if it was just me doing a bad job of it.

So you will need to reach out to Naomi on next steps. Either we are going to wait until the new lesson has been added so this lab can be added. Or not add this new lab at all.

I'll do that, thank you!

@jdwilkin4
Copy link
Contributor

@Sebastian-Wlo

What's the status for this lab?

@Sebastian-Wlo
Copy link
Author

@jdwilkin4
Sorry, forgot to forward it here - if I understood correctly, it might get turned into a workshop for using .entries(), .keys() and .values() at some point.

I haven't worked on it in a while, but I can try modifying the prototype to use these specific methods instead of loops so it would be ready to be divided into steps.

@jdwilkin4
Copy link
Contributor

I would confirm with Naomi to see what next steps should be here 👍🏾

@Sebastian-Wlo
Copy link
Author

I asked her a while ago, this is what she told me:

The only place we are using a loop is in that "listTopMembers" function.
What if we:

  1. Change that to listMembers and just print the Object.entries or something simple.
  2. That means we could put this in the objects section instead of the loops section, I think?
  3. Which then means we could turn it into a workshop and teach those concepts there!

... which, had I read the response properly back then, I could have done a long time ago. I'll make the changes soon.

Removed the "listTopMembers" function and added "listMembers", which logs the input object entries to the console.
…d description of "listMembers"

Replaces description of the removed "listTopMembers" function with one for "listMembers".
@Sebastian-Wlo
Copy link
Author

Actually, as far as I understand, turning this lab into a workshop would probably require going through a completely different process - I'll ask Naomi how to do it properly and if I should create, or wait for, an issue about the lab.
Sorry, I've been a little distracted lately.

@majestic-owl448
Copy link
Contributor

at the prototype stage, the main difference is that a workshop does not need user stories, and that the protytpe is the final solution of the project, not just a possible solution

@jdwilkin4
Copy link
Contributor

jdwilkin4 commented Feb 26, 2026

@Sebastian-Wlo

Can you post any updates you have regarding this project?
Thanks 👍🏾

@jdwilkin4
Copy link
Contributor

It looks like a quick glance there were recent conversations on discord regarding this. But those conversations can easily be burried.
So it is best to post an update here so we can track of the progress all in one place 👍🏾

@Sebastian-Wlo
Copy link
Author

@jdwilkin4, Sorry for the lack of any activity!
I know that this will get turned into a workshop - so, I need to remove the remaining for() loop, make sure that the prototype is cleanly written and get rid of the user stories before planning out how to break the code into steps.
I'll do my best to update the prototype over the weekend, or in the worst case early next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BLOCKED full stack cert lab This work is for the labs team only

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

4 participants