Skip to content

fix: resolve flickering issue in AssetCardContainer component#1191

Merged
yifancong merged 4 commits intoweb-infra-dev:mainfrom
QuentinHsu:fix/asset-card-container-render-optimization
Jul 23, 2025
Merged

fix: resolve flickering issue in AssetCardContainer component#1191
yifancong merged 4 commits intoweb-infra-dev:mainfrom
QuentinHsu:fix/asset-card-container-render-optimization

Conversation

@QuentinHsu
Copy link
Copy Markdown
Contributor

Summary

  • Replace array mapping with direct component rendering
  • Use selectedTitle state instead of index to prevent render inconsistency
  • Optimize onChange event handling for smoother user experience

Related Links

ref #1190

- Replace array mapping with direct component rendering
- Use selectedTitle state instead of index to prevent render inconsistency
- Optimize onChange event handling for smoother user experience
Copilot AI review requested due to automatic review settings July 22, 2025 15:17
@netlify
Copy link
Copy Markdown

netlify Bot commented Jul 22, 2025

Deploy Preview for rsdoctor ready!

Name Link
🔨 Latest commit 3977c71
🔍 Latest deploy log https://app.netlify.com/projects/rsdoctor/deploys/6880906cd12f13000898dcd4
😎 Deploy Preview https://deploy-preview-1191--rsdoctor.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jul 22, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a flickering issue in the AssetCardContainer component by refactoring the state management and rendering approach. The changes improve user experience by ensuring smoother transitions and preventing render inconsistencies.

  • Replace index-based state with title-based state management to prevent flickering
  • Optimize component rendering by eliminating unnecessary array mapping
  • Improve onChange event handling for the Segmented component

Comment thread packages/components/src/pages/BundleSize/components/cards.tsx Outdated
Comment thread packages/components/src/pages/BundleSize/components/cards.tsx Outdated
@yifancong
Copy link
Copy Markdown
Contributor

@QuentinHsu Thanks for your contribution! Please sign the license/CLA above.

@QuentinHsu
Copy link
Copy Markdown
Contributor Author

@QuentinHsu Thanks for your contribution! Please sign the license/CLA above.

I have signed.

@yifancong yifancong enabled auto-merge (squash) July 23, 2025 14:03
@yifancong yifancong merged commit 034fd0c into web-infra-dev:main Jul 23, 2025
7 checks passed
@yifancong yifancong mentioned this pull request Aug 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants