Skip to content
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

Use {{#each}} key to provide component stability for AiAssistantPastSessionsList #1795

Conversation

habdelra
Copy link
Contributor

The issue here is that in the host/app/components/ai-assistant/panel.gts module, the AiAssistantPanel.aiSessionsRooms getter. Specifically this getter returns a different array instance each time it's recomputed so that there is no component stability for the AIPastSessionsList component that consumes this as an argument. each time there is a matrix event that is received (which happens via the /sync calls), a wholly new array is created, and hence the AIPastSessionsList component's {{#each}} is re-rendered for all the items in the array. The solution is to use the key property of the {{#each}} helper to guide ember on how to stabilize the rerenders, so that it knows what is new and what is the same in the array.

Before:
screencast 2024-10-30 09-22-56

After:
thinking

@habdelra habdelra requested a review from a team November 13, 2024 16:26
Copy link

Host Test Results

    1 files  ±0      1 suites  ±0   21m 11s ⏱️ +20s
679 tests ±0  678 ✔️ ±0  1 💤 ±0  0 ±0 
684 runs  ±0  683 ✔️ ±0  1 💤 ±0  0 ±0 

Results for commit 90aea70. ± Comparison against base commit a7d4a87.

@habdelra habdelra merged commit 9c54568 into main Nov 13, 2024
32 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.

2 participants