You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refined GitHub is wrongly hiding projects assigned to issues which are using the older GitHub Project format (now renamed to "Projects (classic)" and I suspect that's what broke RG's logic for it).
Here's how it looks without RG:
And with RG, video of refreshing the page (don't mind the lock symbol, I made it public afterwards):
simplescreenrecorder-2022-06-30_13.49.43.mp4
Include in this issue:
Screenshots/video/gif demonstrating the bug, if it’s visual
Console errors, if any
Reacted by gregoirenovel, Marty Cochrane, Ilya Mashchenko and Ignacio Ceballos (Yayo)
changed the title [-]GitHub "Projects (classic)" are wrongly hidden from the issue toolbar[/-][+]GitHub Projects are wrongly hidden from the issue toolbar[/+]on Jun 30, 2022
changed the title [-]GitHub Projects are wrongly hidden from the issue toolbar[/-][+]`clean-conversation-sidebar` wrongly hides projects[/+]on Jun 30, 2022
I thought about a solution where I pass the number of "steps" to take get the firstElementChild
steps =1 ===> heading.nextElementSibling?.firstElementChild
steps =2 ===> heading.nextElementSibling?.nextElementSibling?.firstElementChild
functioncleanSection(selector: string,step:number=1): boolean{constcontainer=select(selector)?.closest('form, .discussion-sidebar-item');if(!container){returnfalse;}constheading=select(':scope > details, :scope > .discussion-sidebar-heading',container)!;// Magic. Do not touch.// Section is empty if: no sibling element OR empty sibling elementif(step===1&&heading.nextElementSibling?.firstElementChild){returnfalse;}if(step===2&&heading.nextElementSibling?.nextElementSibling?.firstElementChild){returnfalse;}constsection=container.closest('.discussion-sidebar-item')!;if(canEditSidebar()){getNodesAfter(heading).deleteContents();section.classList.add('rgh-clean-sidebar');}else{section.remove();}returntrue;}
Ps. I was going for a solution where I did not have to change a bunch so WDYT?
'icon, progress, etc' would be a selector for elements that appear only if these sections are full. It's probably .Progress, .octicon-table, [data-hovercard-type] but it needs testing to ensure it doesn't match elements inside the dropdown/selector
Activity
akien-mga commentedon Jun 30, 2022
Actually it's also failing with "Projects (beta)" links, e.g. here: godotengine/godot-proposals#4548
Without RG:
With RG:
[-]GitHub "Projects (classic)" are wrongly hidden from the issue toolbar[/-][+]GitHub Projects are wrongly hidden from the issue toolbar[/+]Wenderson-P commentedon Jun 30, 2022
The Projects reappeared after I turned off the
clean-conversation-sidebarsetting[-]GitHub Projects are wrongly hidden from the issue toolbar[/-][+]`clean-conversation-sidebar` wrongly hides projects[/+]iamziike commentedon Jul 2, 2022
The problem lies here
refined-github/source/features/clean-conversation-sidebar.tsx
Lines 45 to 47 in 09466a8
The heading.nextElementSibling?.firstElementChild is null when passed a selector here
refined-github/source/features/clean-conversation-sidebar.tsx
Line 120 in 09466a8
I thought about a solution where I pass the number of "steps" to take get the firstElementChild
steps =1 ===> heading.nextElementSibling?.firstElementChild
steps =2 ===> heading.nextElementSibling?.nextElementSibling?.firstElementChild
Ps. I was going for a solution where I did not have to change a bunch so WDYT?
fregante commentedon Jul 2, 2022
how dare you touch it 😰 😜
refined-github/source/features/clean-conversation-sidebar.tsx
Line 43 in 09466a8
The magic broke and now
heading.nextElementSiblingpoints to a new intermediate element:I think we should just replace the line with something more specific that covers every scenario (milestones, projects, linked issues):
'icon, progress, etc'would be a selector for elements that appear only if these sections are full. It's probably.Progress, .octicon-table, [data-hovercard-type]but it needs testing to ensure it doesn't match elements inside the dropdown/selectoriamziike commentedon Jul 2, 2022
@fregante ok, I'll like to work on it but to clarify we are ditching the "Magic" right
fregante commentedon Jul 2, 2022
Correct. The piece of code I suggested replaces the magic condition
Fix: refined-github#5757 clean-conversation-sidebar wrongly hiding pr…
Disable `clean-conversation-sidebar` due to #5757
fregante commentedon Jul 7, 2022
Oof, can’t wait to turn this feature into a CSS-based feature thanks to the
:has()selector. So many possibilities!Disable `clean-conversation-sidebar`
matschaffer commentedon Jul 21, 2022
thanks @fregante ! Seems to be working great
fregante commentedon Jul 21, 2022
Thank @iamziike 🎉
matschaffer commentedon Jul 21, 2022
Indeed! Thank you @iamziike and apologies - I thought the issue "closed" timeline would have mentioned the PR author. Guess not 😊
Great to have it fixed and back to using Refined Github!
marcphilipp commentedon Jul 21, 2022
It seems this is still disabled (in Firefox) with 22.7.20, isn't it?
Re-enable `clean-conversation-sidebar` in 22.7.20
fregante commentedon Jul 21, 2022
It was disabled via YOLO. Clear your cache (options page) to see it work again