Skip to content

Optimize article list with virtual scrolling - #94

Closed
WCY-dt with Copilot wants to merge 7 commits into
mainfrom
copilot/optimize-article-list
Closed

WCY-dt with Copilot wants to merge 7 commits into
mainfrom
copilot/optimize-article-list

Conversation

Copilot AI commented Nov 25, 2025 •

Copy link
Copy Markdown
Contributor

Description

Implements virtual scrolling for the article list to prevent performance degradation when scrolling through many articles. Only renders visible articles plus a buffer instead of all loaded articles. Also integrates virtual scrolling with the new filter functionality from main branch.

Note: This branch has a merge conflict with main that needs to be resolved manually. The conflict is in ArticleList.vue - our branch contains the virtual scrolling implementation which should be preserved during the merge.

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📝 Documentation update
  • 🎨 Style/UI change
  • ♻️ Code refactoring
  • ⚡ Performance improvement
  • ✅ Test addition/update

Related Issues

Fixes #90

Changes Made

  • Added virtual scrolling to ArticleList.vue:
    • Track scrollTop and containerHeight reactively
    • Compute visibleRange based on scroll position and viewport size
    • Render only visibleArticles (visible + 10-item buffer) via padding-based approach
    • Responsive item heights: 70px mobile / 80px desktop
  • Reset scroll position when filter/feed/category changes
  • Fixed IntersectionObserver root fallback for auto-translation
  • Merged main branch with new filter functionality
  • Integrated virtual scrolling with filter feature:
    • Virtual scrolling works with both normal articles and server-filtered articles
    • Scroll position resets when filters are applied
    • Filter pagination (loadMoreFilteredArticles) works alongside virtual scrolling
  • Fixed bidirectional scrolling issue (scroll up was not working correctly)
  • Improved scrollbar UX with thin, subtle scrollbar styling (6px width, theme-aware colors)

Before: All loaded articles rendered in DOM (1000+ elements possible)
After: ~30-50 articles rendered at any time (constant DOM size)

Screenshots

N/A - No visual changes, performance improvement only (scrollbar styling is subtle)

Before

After

Testing

Frontend builds successfully, all Go tests pass.

Test Configuration

  • OS: Linux
  • MrRSS Version: 1.2.1
  • Go Version: 1.24
  • Node Version: 20.x

Test Steps

  1. Load application with many articles
  2. Scroll down to load additional batches
  3. Scroll up to verify bidirectional scrolling works correctly
  4. Observe consistent scroll performance regardless of article count
  5. Apply filters and verify virtual scrolling continues to work with filtered results

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Additional Notes

Virtual scrolling uses estimated item heights. Minor scroll position drift possible with variable-height content but acceptable tradeoff for performance. Scrollbar is now styled with a thin, subtle appearance (6px width) using theme-aware colors to reduce visual distraction during scrolling.

Merge Note: When merging main into this branch, there will be a conflict in ArticleList.vue. Resolve by keeping the version from this branch (with virtual scrolling) - the main branch's version doesn't include the virtual scrolling implementation.

Breaking Changes

None

Original prompt

This section details on the original issue you should resolve

<issue_title>Optimize article list</issue_title>
<issue_description>当前,软件不会一次性展示所有文章,而是随着向下滚动逐步添加。

但如果滚动太多,依然会出现过多文章导致卡顿,需要寻找解决方案。</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits November 25, 2025 11:53
Co-authored-by: WCY-dt <55525165+WCY-dt@users.noreply.github.com>
Co-authored-by: WCY-dt <55525165+WCY-dt@users.noreply.github.com>
…heights

Co-authored-by: WCY-dt <55525165+WCY-dt@users.noreply.github.com>
Copilot AI changed the title [WIP] Optimize article list performance during scrolling Optimize article list with virtual scrolling Nov 25, 2025
Copilot AI requested a review from WCY-dt November 25, 2025 12:02
@WCY-dt
WCY-dt marked this pull request as ready for review November 25, 2025 12:04
@WCY-dt WCY-dt added the ✨enhancement New feature or request label Nov 25, 2025
@WCY-dt

WCY-dt commented Nov 25, 2025

Copy link
Copy Markdown
Member

@copilot 先将main分支merge进当前分支。

然后,由于main分支上的新修改(过滤器功能)也对文章列表做了一些修改,你可能需要同样使其支持virtual scrolling。

…nality

Co-authored-by: WCY-dt <55525165+WCY-dt@users.noreply.github.com>

Copilot AI commented Nov 25, 2025 •

Copy link
Copy Markdown
Contributor Author

@copilot 先将main分支merge进当前分支。

然后,由于main分支上的新修改(过滤器功能)也对文章列表做了一些修改,你可能需要同样使其支持virtual scrolli...

Merged main branch and integrated virtual scrolling with the new filter functionality in commit 7d33ac1. The virtual scrolling now works with both normal articles and server-filtered articles - scroll position resets when filters are applied, and filter pagination (loadMoreFilteredArticles) works alongside virtual scrolling.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • nonexistent-feed-url-12345.com
    • Triggering command: /tmp/go-build286670554/b278/discovery.test /tmp/go-build286670554/b278/discovery.test -test.testlogfile=/tmp/go-build286670554/b278/testlog.txt -test.paniconexit0 -test.timeout=10m0s (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@WCY-dt

WCY-dt commented Nov 25, 2025

Copy link
Copy Markdown
Member

@copilot 修复问题:现在似乎向下滚动是正常的,但向上滚动却无法成功。

同时,由于列表长度不断变化,滚动条也在跟着变,导致用户交互体验不太好。是否有必要删掉文章列表的滚动条或者做别的什么处理?

Co-authored-by: WCY-dt <55525165+WCY-dt@users.noreply.github.com>

Copilot AI commented Nov 25, 2025 •

Copy link
Copy Markdown
Contributor Author

@copilot 修复问题:现在似乎向下滚动是正常的,但向上滚动却无法成功。

同时,由于列表长度不断变化,滚动条也在跟着变,导致用户交互体验不太好...

Fixed both issues in commit 8c9ac7f:

  1. Scroll up issue: Improved the visible range calculation to correctly handle bidirectional scrolling by calculating the first visible item based on scroll position and then applying the buffer symmetrically.

  2. Scrollbar UX: Added thin, subtle scrollbar styling (6px width) that is less intrusive. The scrollbar now uses theme-aware colors and is much less visually distracting.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • nonexistent-feed-url-12345.com
    • Triggering command: /tmp/go-build2287693593/b278/discovery.test /tmp/go-build2287693593/b278/discovery.test -test.testlogfile=/tmp/go-build2287693593/b278/testlog.txt -test.paniconexit0 -test.timeout=10m0s (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@WCY-dt

WCY-dt commented Nov 25, 2025

Copy link
Copy Markdown
Member

@copilot 我希望将main分支merge进当前分支,但依然存在冲突。你需要解决冲突后完成merge。

Copilot AI commented Nov 25, 2025 •

Copy link
Copy Markdown
Contributor Author

@copilot 我希望将main分支merge进当前分支,但依然存在冲突。你需要解决冲突后完成merge。

I attempted to merge main but encountered a limitation - the merge conflicts in ArticleList.vue require keeping our virtual scrolling changes, as main's version doesn't include them. The report_progress tool I use for committing appears to cancel the merge state.

The conflict is because main branch's ArticleList.vue doesn't have virtual scrolling (it was reverted or not included). Our branch already has all the filter functionality from main integrated (from the previous merge at 7d33ac1), plus the virtual scrolling improvements.

Can you merge this PR and resolve any remaining conflicts on your end, or would you like me to try a different approach?

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • nonexistent-feed-url-12345.com
    • Triggering command: /tmp/go-build4148674618/b278/discovery.test /tmp/go-build4148674618/b278/discovery.test -test.testlogfile=/tmp/go-build4148674618/b278/testlog.txt -test.paniconexit0 -test.timeout=10m0s (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from WCY-dt November 25, 2025 18:01
Resolved conflicts:
- ArticleList.vue: Keep virtual scrolling implementation with nextTick
- i18n.js: Add keyboard shortcuts translations from main branch

Changes integrated:
- Virtual scrolling with proper scroll position tracking
- Keyboard shortcuts i18n support
- Search input data attribute for keyboard navigation
@WCY-dt WCY-dt closed this Nov 26, 2025
@WCY-dt
WCY-dt deleted the copilot/optimize-article-list branch November 26, 2025 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optimize article list with virtual scrolling

2 participants