Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🪲 fix discrepancy programs count #5642

Merged
merged 9 commits into from
Jul 5, 2024
Merged

Conversation

hasan-sh
Copy link
Contributor

@hasan-sh hasan-sh commented Jul 1, 2024

Fixes #5199

How to test?

  • login to some user; user3
  • see the number of created programs in /users/user3 and /landing-page
  • they should match.
  • run some other programs and perhaps submit some.
  • revist the pages, and the numbers should match.

Copy link
Contributor

@Annelein Annelein left a comment

Choose a reason for hiding this comment

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

Hey @hasan-sh , looks good and it works for user3!

But if I login with teacher1 in /programs I have 6 programs saved and in /user/teacher1 there are only 2, and in /landing-page there are 7....

@hasan-sh
Copy link
Contributor Author

hasan-sh commented Jul 3, 2024

Hey @hasan-sh , looks good and it works for user3!

But if I login with teacher1 in /programs I have 6 programs saved and in /user/teacher1 there are only 2, and in /landing-page there are 7....

Hey @Annelein , in the landing page, we forgot to add the is_modified check. Just added it! So, it should be the same as in /programs now.

For the /user/<username> page, the count isn't necessarly the same as the other two, because here we only see public programs. Perhaps change the label? Or is it clear @Felienne ?

@Annelein
Copy link
Contributor

Annelein commented Jul 3, 2024

Hey @Annelein , in the landing page, we forgot to add the is_modified check. Just added it! So, it should be the same as in /programs now.

For the /user/<username> page, the count isn't necessarly the same as the other two, because here we only see public programs. Perhaps change the label? Or is it clear @Felienne ?

hey! @hasan-sh looks good and yes you are right, those are public programs so they are different. But I guess it is confusing because the label indeed is the same. What about x public programs | x programs saved | x programs submitted ?
Let me know if you don't understand what I mean!

@hasan-sh
Copy link
Contributor Author

hasan-sh commented Jul 4, 2024

hey! @hasan-sh looks good and yes you are right, those are public programs so they are different. But I guess it is confusing because the label indeed is the same. What about x public programs | x programs saved | x programs submitted ? Let me know if you don't understand what I mean!

Not sure if it's logical to show x programs saved AND public programs, because this page is a public one and users don't need to see how many private&public programs a user has made.

What do you think @Felienne?
image

@Annelein
Copy link
Contributor

Annelein commented Jul 4, 2024

Not sure if it's logical to show x programs saved AND public programs, because this page is a public one and users don't need to see how many private&public programs a user has made.

Then I would say, lets change the label, and make it say 'x public programs', to avoid confusions.

@Felienne
Copy link
Member

Felienne commented Jul 4, 2024

Not sure if it's logical to show x programs saved AND public programs, because this page is a public one and users don't need to see how many private&public programs a user has made.

Then I would say, lets change the label, and make it say 'x public programs', to avoid confusions.

Yes makes sense to me!

@hasan-sh
Copy link
Contributor Author

hasan-sh commented Jul 4, 2024

Ok, after further investigation, the count is actually correct. The problem is that the property program_count in the users table for teacher1 was not updated in data-for-testing.json. This is probably because we added programs for testing purposes without updating the program_count field! I'll update it in the local database.

Meaning what you see under x programs saved actually reflects the total programs saved by the user. You can test this by loging in as user with no programs, run programs and see the count in the public-page reflected accordingly.

The question remains do you still need an extra label that counts the number of public programs, even though the page lists all public programs by the user?

@Annelein
Copy link
Contributor

Annelein commented Jul 4, 2024

@hasan-sh @Felienne

Allright so the x public programs label should be added for sure, because thats whats being shown in the page.

And then for the x programs saved label, I think we can still keep it, I think users might find it cool to see/show the amount of programs saved? Let me know what you think!

@Felienne
Copy link
Member

Felienne commented Jul 4, 2024

And then for the x programs saved label, I think we can still keep it, I think users might find it cool to see/show the amount of programs saved? Let me know what you think!

I don't think I agree. Because what does "saved" mean, if users never save anything actively? It used to be an action with a click (before either of you joined, I think, so you might not know all history)

A better label would be "adventures explored" or "tried" because that is what is semantically comes down to.

Or, if we want to keep it simple, we can do "public programs" and simple "programs" <-- My preferred option, I think.

@Annelein
Copy link
Contributor

Annelein commented Jul 4, 2024

And then for the x programs saved label, I think we can still keep it, I think users might find it cool to see/show the amount of programs saved? Let me know what you think!

I don't think I agree. Because what does "saved" mean, if users never save anything actively? It used to be an action with a click (before either of you joined, I think, so you might not know all history)

A better label would be "adventures explored" or "tried" because that is what is semantically comes down to.

Or, if we want to keep it simple, we can do "public programs" and simple "programs" <-- My preferred option, I think.

I agree! But that's a different discussion as to keeping this counter or removing it, I guess? Because the counter in /programs and /landing-page also has the label x programs saved. Thats why I compared it to keeping it in this page. So then we would have to change those labels too right?

I want to work on this for #5386 but there is not design proposal yet...

So:

  • keep the counter in `/user/teacher1'
  • change all labels in to 'adventures explored' or 'adventures tried' or something
  • add the counter x public adventures

@Felienne
Copy link
Member

Felienne commented Jul 4, 2024

And then for the x programs saved label, I think we can still keep it, I think users might find it cool to see/show the amount of programs saved? Let me know what you think!

I don't think I agree. Because what does "saved" mean, if users never save anything actively? It used to be an action with a click (before either of you joined, I think, so you might not know all history)
A better label would be "adventures explored" or "tried" because that is what is semantically comes down to.
Or, if we want to keep it simple, we can do "public programs" and simple "programs" <-- My preferred option, I think.

I agree! But that's a different discussion as to keeping this counter or removing it, I guess? Because the counter in /programs and /landing-page also has the label x programs saved. Thats why I compared it to keeping it in this page. So then we would have to change those labels too right?

I want to work on this for #5386 but there is not design proposal yet...

So:

  • keep the counter in `/user/teacher1'
  • change all labels in to 'adventures explored' or 'adventures tried' or something
  • add the counter x public adventures

Yes, all these three things afaiac!

@hasan-sh
Copy link
Contributor Author

hasan-sh commented Jul 4, 2024

"programs" <-- My preferred option, I think.

This makes a lot of sense since they don't really save indeed. Will change the amount_saved to simply be programs. And any further changes can be done in your PR @Annelein ?

Now:
image

This clearly shows the user has 7 programs and all programs in the tiles are public.

Copy link
Contributor

mergify bot commented Jul 5, 2024

Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit bc35b44 into main Jul 5, 2024
12 checks passed
Copy link
Contributor

mergify bot commented Jul 5, 2024

Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot deleted the discrepancy-program-count branch July 5, 2024 10:13
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.

🪲 Discrepancy in program count
3 participants