ZJUSCT / mirror-front

ZJU mirror front-end
https://mirrors.zju.edu.cn
MIT License
32 stars 7 forks source link

implement lexicographic navigation #68

Closed OrkWard closed 1 year ago

OrkWard commented 1 year ago

preview the build at https://orkward.github.io/mirror-front

RalXYZ commented 1 year ago

6,牛逼

OrkWard commented 1 year ago

虽然 index.jsx 看起来改了很多其实只是不小心缩进的原因导致( 我应该只在最后面添加了一个新的 component 然后把整个用 <></> 包起来(毕竟不能直接 return 多个并列标签)

RalXYZ commented 1 year ago

@OrkWard I have reviewed this pull request and completed all the comments. If you have better suggestions regarding the comments, we can continue the discussion.

OrkWard commented 1 year ago

I think a better method to perform navigation is using window.srollTo or Element.prototype.scrollIntoView instead of hashtag, which causes no change in window.location, allow history navigation working properly; and may improve performance(I doubt change hash will cause some rerender in React)
will try this in spare time, if work as expected I'll close this and open a new pr

wfwf1997 commented 1 year ago

I suppose hash navigation is totally fine. It's simple but works. Actually, it is a quite common practice to use hash for quick navigation in a long articles. The url with hash can also make people who open the link jump to the target paragraph faster. React will not trigger re-rendering when the hash changes by default. And if you're really concerned with the history, just use history.replaceState. But for me, I don't mind the change.

wfwf1997 commented 1 year ago

@RalXYZ I suppose we could also add hash for each mirror card!

OrkWard commented 1 year ago

Glad to heard that, I don't mean to pursue perfect either, just merge it if no other problem

Also it won't be busy in my 4th year, so if need I can participate in maintainance

RalXYZ commented 1 year ago

Also it won't be busy in my 4th year, so if need I can participate in maintainance

Thank you very much! We really appreciate your contribution, but we don't want to burden you with too much work. After all, contributing to open-source communities may not bring you material benefits or provide significant technical and product experience compared to participating in internships. Furthermore, our current version of the frontend is already approaching perfection, and there are few new features to be added.

In the future, if we have new requirements that need to be implemented, we will create an issue for it. This information will not be directly notified to you, as we don't want it to be like assigning tasks. If you are willing to implement a specific issue, you can communicate with us there.

Contributions are welcomed 😊

OrkWard commented 1 year ago

Thank you for your patient reply. However contribution is more like a kind of fun and learning experience...in that case I'll participate in my own pace

iamNCJ commented 1 year ago

Really thank you for your great work! @OrkWard

fish98 commented 1 year ago

❤️