Skip to content

Frontend refactors #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Nov 2, 2024
Merged

Frontend refactors #14

merged 5 commits into from
Nov 2, 2024

Conversation

YUCLing
Copy link
Contributor

@YUCLing YUCLing commented Oct 27, 2024

This PR made some changes to the frontend, listed as follows:

  • Move to TypeScript
  • Use refreshContent for initialization (fixes not working when post edited #3)
  • Use DOM-based initialization check, so initialization after refreshContent is possible (won't cause regression of Duplicated popups on image click #11 in theory)
  • Fix the build of CSS on Windows
  • Fix Fancybox slide and gallery carousel's syncing Now it works out of box with Fancybox
  • Remove duplicated Fancybox style imported in JavaScript
  • Remove duplicated Fancybox's carousel event registration (it's completely useless now)

I think some places can be deleted as they seem to be redundant to me, but I'm not sure of the back story that makes them there. So I left them untouched.

Although I've tested it and it all seems fine and backward compatible, I would like some double-quality checks and feedback from you.

chore: move to typescript
chore: use refreshContent for initialization (fixes iamdarkle#3, this is fixed actually)
chore: use dom based initialization check (usually doesn't cause the regression of iamdarkle#11)
fix: css build cross-platform
fix: slide and gallery carousel syncing
remove: duplicated style imported in javascript
remove: duplicated carousel event registration
It looks like the syncing is automatically handled by Fancybox itself.
Let's remove it.
@iamdarkle
Copy link
Owner

Hi, thanks for the time and effort on this, I'm going to review it ASAP and test it locally.

I think some places can be deleted as they seem to be redundant to me, but I'm not sure of the back story that makes them there. So I left them untouched.

That's quite possible, did you refer to the syncing part or something else?

@YUCLing
Copy link
Contributor Author

YUCLing commented Oct 31, 2024

That's quite possible, did you refer to the syncing part or something else?

Yep, forgot to remove this part while editing.

@iamdarkle
Copy link
Owner

I've been testing it, and it works great. I really like the improvements you've made.

During the testing, I actually found an issue, but I'm sure it has nothing to do with your code. I checked, and it was already happening in the current version. If there are two galleries in the same post, the sync/index goes a bit crazy (#15).

If you want, I can release a version with your changes now, or if you don't mind waiting a bit, I can try to fix this issue and include it as well.

@YUCLing
Copy link
Contributor Author

YUCLing commented Nov 1, 2024

If there are two galleries in the same post, the sync/index goes a bit crazy

Hmm, my test post contains two galleries and two individual images and I didn't encounter this issue. Is that because my galleries contain only two images?

I can try to fix this issue and include it as well.

If you'd like to, I got no issue with it. 😃

@iamdarkle iamdarkle linked an issue Nov 2, 2024 that may be closed by this pull request
@iamdarkle
Copy link
Owner

Oh sorry, you were absolutely right, I wrote that right after trying to compare the multiple galleries case with the previous version, but cache played a trick on me. The error is actually in the current version, and this fixes it!

I took the chance to add lazy loading, and IMO everything looks good, so I'm going to tag the new version (including your other PR). If anything comes up, don't hesitate to open an issue, and I'll try to help. Thanks! 🙂

@iamdarkle iamdarkle merged commit 2d53777 into iamdarkle:main Nov 2, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

If there are multiple galleries the sync/match index loses track not working when post edited
2 participants