Repository navigation
feat(client,api): add a per module reset - #62547
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
815d3c8 to
5d588b6
Compare
5d588b6 to
d543e75
Compare
9c247f9 to
2930020
Compare
91b317a to
aba052d
Compare
|
I'm not set up for testing, but this UI looks amazing. This is very much what I had in mind and I think it's pretty clear. I'm not 100% on using the "refresh" icon "↻" for the reset, if only because it sort of implies that you are "refreshing" the content. Maybe something like a "recycle" ♻ icon? That has the advantage of being sort of triangular which is also associated with warning. Other thoughts:
|
aba052d to
2cf9a93
Compare
|
Updates:
|
ShaunSHamilton
left a comment
There was a problem hiding this comment.
Some suggestions open for discussion, and some code changes that require more changes than the diff UI allows.
|
I like the eraser icon. I guess we can live with it being desktop only for now. Perhaps we can find a better home for it in the future. If there were more block-wide actions, a three dot menu might be a good place for it, to the right of the counts. In terms of functionality, this looks good to me. |
|
Thanks.
I considered it. The problem is the hit area is same as a any other icon, so it takes up same physical space (to maintain a11y). We could consider collapsing the counts into an icon (which shows counts when clicked??). But that is a broader refactor, beyond this PR. |
ojeytonwilliams
left a comment
There was a problem hiding this comment.
Hey @raisedadead I don't want to get too deep into the weeds, but my high level recommendations are just:
- Use
{ blockIds: [] }as theaccount/reset-modulebody, rather than having the client send one request at a time and having to space them out. It's more efficient for the api and faster for the user. - send something back from the api so that the client has enough data to update it's state. The changed parts of the user object could work.
It's not really a recommendation, but the reset-modal is getting unmounted and then attempting to update its state (you can check the console for errors, it happens every time). I didn't dig too deeply into it, because it might go away if you change things, but it's something to keep an eye on.
I also, while thinking about this, noticed a few details along the way. They're less important, particularly if the above recommendations make sense. I'll just review again from scratch.
|
|
||
| handleResetConfirm = (): void => { | ||
| const { fetchUser } = this.props; | ||
| fetchUser(); |
There was a problem hiding this comment.
So, this works, but it's a bit at odds with how we typically do things and results in more api requests. Normally we make a single api call (i.e. the one to /account/reset-module), send some data as a response and use that to update the client's state.
Calling fetchUser is a blunt instrument and is a call we don't have to make.
maybe the completion can't be removed? various certifications save the code of a certification project and show it together with the claimed cert alternatively, the certification could be revoked |
5244d11 to
5ff4f66
Compare
We discussed this in a platform meeting and the abuse vector is not worth adding the complexity. We will leave it as is for now. |
The artificial slowed requests is a design element to be honest. The modal (with the progress) has two functions:
We can always "optimize" it to one call and then update the client in the same request like you recommend in future if we see the feature not getting used as much. I think this is an opportunity to experiment. Also I feel the "module" is an atomic enough unit, so delegating some computation to the client should be fine. I will address some of the other points that you have brought up though. |
5ff4f66 to
db52dfd
Compare
ahmaxed
left a comment
There was a problem hiding this comment.
Thanks for working on this feature. Here are a few suggestions:
The UI looks legit. The only thing I would change in upcoming prs is finding a solution that would work for mobile as well.
The easiest thing I could think of would be exposing the reset buttons on demand.
For instance, moving the 'Courses' subtitle to the left and adding a button to the right that exposes a column of delete icon could be a viable option for desktop and mobile.
|
|
||
| export function deleteResetModule(body: { | ||
| blockId: string; | ||
| }): Promise<ResponseWithData<void>> { |
There was a problem hiding this comment.
This would throw an error since combineDataWithResponse tries to parse an empty response to a JSON.
|
|
||
| handleResetConfirm = (): void => { | ||
| const { fetchUser } = this.props; | ||
| fetchUser(); |
There was a problem hiding this comment.
I understand that you are trying to show the latest updates to the completed challenges here. If you don't want to return data from a 204 to update the store, I suggest moving the store state modification and api request logic to a saga, send the to be deleted blocks here and handle it accordingly.
| </svg> | ||
| ); | ||
| function Reset(): JSX.Element { | ||
| return <FontAwesomeIcon icon={faEraser} aria-hidden='true' />; |
There was a problem hiding this comment.
I know this have been discussed, but the circular arrow is more common and versatile.
There is a pr in works to bring the recover saved code to the lower jaw which would use a variation of this icon either with a cloud or a disk.
The best rule of thumb for choosing an icon is searching for the action + icon on the web.
db52dfd to
f8f7c64
Compare
70f958a to
7df4e51
Compare
b305e61 to
d6b29c1
Compare
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|




Closes #47464
Note: One of the things that is not handled yet is what do we do if a block etc qualifies for a certification, and the certification has been claimed. I think we could explore than in future PRs.
Screenshots and Demo
Enabled (section has progress) - Superblock:
Enabled (section has progress) - Chapter:
Disabled (section doesn't have progress:
Warning Modal
Progress Modal for larger sections (Superblocks or Chapters)
Screencap:
Reset-Progress.mp4