Add pull request files line selections#36014
Conversation
|
The logic is quite complex, I would suggest to carefully review every line and make sure every line is clear. Or you can also help to answer my questions. Thank you. @lafriks @Zettat123 |
| if (e.defaultPrevented) return; | ||
| handleDiffLineNumberClick(cell, e); | ||
| }); | ||
| window.addEventListener('hashchange', () => { |
There was a problem hiding this comment.
Why duplicate "hashchange" listeners? Won't it conflict with window.addEventListener('hashchange', onLocationHashChange);?
| window.location.hash = ''; | ||
| window.location.hash = currentHash; |
There was a problem hiding this comment.
Do you think readers can understand why it needs these two lines?
When you copy code, why not also copy the comments? Or, why not introduce a common function for such requirement?
| if (targetElement) { | ||
| // Try again to highlight and scroll now that the element is loaded | ||
| const success = await highlightDiffSelectionFromHash(); | ||
| if (success) return; |
There was a problem hiding this comment.
Is this loop still right?
If the selected line are in the expanded area (blob excerpt), now you just keep "loading more files", but the selected range can never be really loaded.
|
@silverwind although AI reviewing is good, I believe we should make sure the code is overall correct, and the design is overall good enough and maintainable, before asking AI to review. Otherwise, it a waste of everyone's time, including AI's time. |
|
Yeah sorry, just thought some more feedback may be good. This PR needs a bigger cleanup in any case, maybe I'll try later. |
|
any plans here? |
I’m currently tied up with other priorities. Would you be able to take this on? |
I currently have too many open PRs, I think I need to first fix them and then I can maybe have a look at it |
|
This is definitely a useful feature, just needs some cleanup. |
TBH, not "just needs some cleanup", the current design and implementation are problematic. It needs a new design and maybe completely rewritten. |
|
Hmm yeah I'd probably start on a fresh branch on this too. |
This PR allows select multiple lines on the pull request files view page.