Skip to content

Fix expert messages reactivity when switching between agent modes#6894

Merged
cstns merged 1 commit intomainfrom
expert/fix-message-bleedthrough-when-switching-between-agent-modes
Mar 19, 2026
Merged

Fix expert messages reactivity when switching between agent modes#6894
cstns merged 1 commit intomainfrom
expert/fix-message-bleedthrough-when-switching-between-agent-modes

Conversation

@cstns
Copy link
Copy Markdown
Contributor

@cstns cstns commented Mar 19, 2026

Description

The message component was using array indices as key props. When switching between different agent modes, the underlying data changed but the indices remained the same (0,1,2...). This caused the framework to incorrectly reuse DOM elements, leading to rendering artifacts and stale state.

I updated the message rendering logic to use each message's unique uuid as the key. This ensures that the UI correctly disposes of old message components and mounts new ones when the agent context changes.

Related Issue(s)

introduced by #6839

Checklist

  • I have read the contribution guidelines
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
    • Upgrade instructions
    • Configuration details
    • Concepts
  • Changes flowforge.yml?
    • Issue/PR raised on FlowFuse/helm to update ConfigMap Template
    • Issue/PR raised on FlowFuse/CloudProject to update values for Staging/Production
  • Link to Changelog Entry PR, or note why one is not needed.

Labels

  • Includes a DB migration? -> add the area:migration label

@cstns cstns self-assigned this Mar 19, 2026
@cstns cstns requested a review from Steve-Mcl March 19, 2026 09:28
@dimitrieh
Copy link
Copy Markdown
Contributor

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.62%. Comparing base (f4ecf2f) to head (0d76d96).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6894   +/-   ##
=======================================
  Coverage   76.62%   76.62%           
=======================================
  Files         399      399           
  Lines       20165    20165           
  Branches     4856     4856           
=======================================
  Hits        15452    15452           
  Misses       4713     4713           
Flag Coverage Δ
backend 76.62% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@Steve-Mcl Steve-Mcl left a comment

Choose a reason for hiding this comment

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

Makes sense but I cannot test in pre-staging so hanging back on merging.

However, I accept it is a small / somewhat inconsequential PR so please feel free to merge.

@cstns cstns merged commit d2178dc into main Mar 19, 2026
30 checks passed
@cstns cstns deleted the expert/fix-message-bleedthrough-when-switching-between-agent-modes branch March 19, 2026 11:18
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.

3 participants