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

fix: AI history view crashing on first use #14443

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

sdirix
Copy link
Member

@sdirix sdirix commented Nov 13, 2024

What it does

The AI history view sometimes crashed on first use when the user tried to select an agent. This was caused by an empty agent list bound in the initial UI.

Refactors the history view by making sure that the history view is only instantiated once it is shown instead of early in application start. This avoids binding a still empty list of agent contributions to the UI.

Also adds fallback content in case there are no registered agents as the used 'SelectComponent' crashes with empty options.

Also moves the history sort change tracking outside of the widget. Previously this was broken as only the initial widget was tracked.

How to test

Crash fix
  1. Start the example application
  2. Open the chat history view (should not have been open before)
  3. Try to select an agent

Observe that there is no longer a crash of the view

Sorting fix
  1. Start the example application
  2. Open the chat history view
  3. Close the chat history view
  4. Open the chat history view
  5. Click chat history sorting button a view times

Observe that the sorting button is updated on every click and keeps working

Review checklist

Reminder for reviewers

The AI history view sometimes crashed on first use when the user tried
to select an agent. This was caused by an empty agent list bound in the
initial UI.

Refactors the history view by making sure that the history view is only
instantiated once it is shown instead of early in application start.
This avoids binding a still empty list of agent contributions to the
UI.

Also adds fallback content in case there are no registered agents as
the used 'SelectComponent' crashes with empty options.

Also moves the history sort change tracking outside of the widget.
Previously this was broken as only the initial widget was tracked.
@planger planger self-requested a review November 13, 2024 10:28
Copy link
Contributor

@planger planger left a comment

Choose a reason for hiding this comment

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

Tested it and could not reproduce the original issues, thank you!

@sdirix sdirix merged commit 7c05b6f into eclipse-theia:master Nov 13, 2024
10 of 11 checks passed
@sdirix sdirix added this to the 1.56.0 milestone Nov 13, 2024
@sdirix sdirix deleted the polish-ai-history-view branch November 13, 2024 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants