Skip to content

Liisa/enhancement/623 implement skeleton loaders#647

Merged
Rutjake merged 6 commits into
mainfrom
liisa/enhancement/623-implement-skeleton-loaders
May 8, 2026
Merged

Liisa/enhancement/623 implement skeleton loaders#647
Rutjake merged 6 commits into
mainfrom
liisa/enhancement/623-implement-skeleton-loaders

Conversation

@davylis
Copy link
Copy Markdown
Contributor

@davylis davylis commented May 5, 2026

📄 Pull Request Overview

Closes #623

🔧 Changes Made

  1. Added skeleton loading states for both the news listing page and individual news element page.
  2. Replaced plain Loading... text with reusable skeleton loader components.
  3. Increased the initial news fetch limit from 6 to 12 cards.
  4. Added responsive SCSS styles and pulse animation for news skeleton cards.
  5. Updated news loading logic to wait for both main news data and related news data before rendering.

Checklist Before Submission

  • Functionality: I have tested my code, and it works as expected.
  • JSDoc: I have added or updated JSDoc comments for all relevant code.
  • Debugging: No console.log() or other debugging statements are left.
  • Clean Code: Removed commented-out or unnecessary code.
  • Tests: Added new tests or updated existing ones for the changes made.
  • Documentation: Documentation has been updated (if applicable).

📝 Additional Information

Provide any additional context or information that reviewers may need to know:

  • Screenshots:
Screenshot 2026-05-05 at 14 55 13

davylis added 3 commits May 5, 2026 10:04
Add working skeletonLoader with small issues
-Added same layout as in NewsCard for loader
-Made them appear responsively
-Added documentation for News Skeletonloader
@davylis davylis self-assigned this May 5, 2026
@davylis davylis linked an issue May 5, 2026 that may be closed by this pull request
@davylis davylis moved this to In review in altzone-webpages May 6, 2026
Copy link
Copy Markdown
Member

@Skoivumaki Skoivumaki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job on this! I had a hard time catching the loader in action because the Directus queries load almost instantly. I was originally picturing a skeleton loader using Tailwind's pulse, but your implementation gets the job done perfectly it seems. (it looks like it has the pulse effect or similar) https://tailwindcss.com/docs/animation#adding-a-pulse-animation


const limit = 6;
//limit for initial load(no news data fetched yet)
const limit = 12;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Increasing limit was not part of issue. I think it wont cause issues with infinite scroll.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I’ll revert the limit back to 6

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work for appending a existing skeleton loader file with new stuff. Ultimately we should have a skeleton loader that can take the existing component and render on it, for all cases.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the news cards have a very specific layout compared to other components, I created a news skeleton structure here. I agree that a reusable skeleton loader would be a better option and I’ll definitely try that approach next time!


const pageIsLoading = isNewsLoading || isMoreNewsLoading || !data || !moreNews;

const getLngCode = (lng: string) => {
Copy link
Copy Markdown
Member

@Skoivumaki Skoivumaki May 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is missing fallback for RUS, but such doesn't exist for News page anyway. This is a bug @Rutjake

@davylis davylis moved this from In review to In progress in altzone-webpages May 8, 2026
Reverting value to original
@davylis davylis moved this from In progress to In review in altzone-webpages May 8, 2026
Copy link
Copy Markdown
Contributor

@Rutjake Rutjake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great and works well, nice job!

Using the Network Throttling feature in DevTools to simulate a slower connection is usually very helpful for catching these kinds of loading state issues.

For future improvements, we should investigate how Next.js loading.tsx could work within our project. Since we have the src/app structure, it might allow us to define loading UIs easily at the route level without having to modify the page code directly. It's a powerful pattern that could simplify how we handle these loading states moving forward.

@Rutjake Rutjake merged commit 153ae00 into main May 8, 2026
3 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in altzone-webpages May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Implement Skeleton Loaders for News Pages (Extend SkeletonLoader.tsx)

3 participants