Closed Ghst-dg closed 1 day ago
Hi @Ghst-dg I tried testing the code locally and it seems to hide left panel for submissions as expected. However, it seems to hide tabs as well including Description, Editorial and Submissions.
Can you update the code so it hides only submissions. Also, thank you for suggesting this feature and taking the time to implement it.
Hi @loveshdongre, Thanks for the response. I apologies for the mistake, I didn't properly tested my changes hence it was breaking the leetcode website. So, I have done appropriate changes. The newly added feature allows users to hide the "Submission" tab option in the coding area of the LeetCode website. The feature captures all the elements with the given selectors and dynamically identifies the tab with the appropriate innerText, in this case, "Submissions". It then adds the "hide" class to hide the "Submission" tab. This approach ensures that even if LeetCode introduces additional tabs in the future, the feature remains flexible and can hide the "Submission" tab effectively without relying on specific element positions. Also I have moved the submission toggle button to the columns fieldset.
hi @Ghst-dg With this feature, I have a few thoughts.
Instead of hiding submissions tabs which will hide all the submissions, can we hide submissions older than 1 day? A few use cases will still exist if we only hide submissions older than 1 day. a. Coders would be able to compare their optimisation solutions or refer to some code done on the same day. b. Submissions tab will give them insights about space and time complexity, and also allow them to refer to other folks' code.
Another thing to note is the successful submission, with the current implementation all the solutions are exposed. This might prevent us from achieving want we intended to in the first place.
It would be correct to put the submissions toggle field outside columns, the reason being the columns refer to the Problem set columns of the table for the following link: https://leetcode.com/problemset/all/
Also, I understand merely toggling submissions can solve some of the issues. However, I think it would be better if users don't have to toggle it every time they solve a problem. Let me know what are your thoughts on this, also thanks for the work.
Hi @loveshdongre, Idea of hiding submission older than 1day is great, users can refer or compare their newly optimized changes or new approach. The big challenge will be to hide the element because there are multiple elements with same selector in different sections, this is a big hurdle. For point 2 I don't think it is much of issue that a user is getting previous solution list after successful submission of code because my aim is stop user to see their previous solutions while they are coding. Also, user can easily compare their previous submissions with their current submission. And I apologies I was confused about the column fieldset, I will ensure to move submission option up.
Yes I strongly agree with your point and it is good point as well that what if user gives-up and want to see how they solve the problem previously, do they need to toggle every time. And yes, this is definitely not an optimal solution. So basically, my POV was to stop user to easily solve problem while they are revisiting the code. I want user to put same effort when they did approach the problems for the first time. As it is now easy to access previous submission as it is few clicks away. I want user to put effort first and then go for the problem. What I think for is to add countdown timer. User can set time and once the time is up the tab will start displaying. The timer will start once the user start writing. Or else leetcode also provide stopwatch we can also utilize that too.
Thanks for sharing your opinion and I will also do some changes as well in the code.
hi @Ghst-dg
Yes, agreed with the part about finding the right selector as lots of elements have the same selector. In Addition, I faced an issue in that Leetcode sometimes changes the structure of the page breaking the feature entirely, and forcing one to hardcode the selector name again.
Solution 1: a. Detect if the submissions tab is active b. Filter and hide all submissions older than 1 day.
Also, I see you solved the issue for the first submission when a problem is revisited.
[This could be a separate thread for discussion] Unlocking the submissions button on a timer would be tricky and add some more complexity. 1 Timer value can't be the same for everyone, we need to modify the UI to take input and process accordingly. 2 Creating an event to start/reset the timer.
I think if solution 1 works we might not have to go for more complex solutions. Thanks for adding new ideas.
Closing since no activity and current code has been modified a lot.
If a user, such as me, has a bad habit of constantly referring to their previously submitted solutions while revisiting code and revising questions, it can hinder productivity. To address this issue, I have implemented a new feature that allows you to hide or unhide previous submissions. I have added a checkbox labeled "Submissions" which enables you to hide the previous solutions and focus solely on the task at hand. This feature aims to boost productivity by minimizing distractions and encouraging independent problem-solving.