Skip to content

Command Palette: update details pane live without resetting selection #47745

@Fefedu973

Description

@Fefedu973

Description

In a C# Command Palette extension, I need to update the Markdown details pane asynchronously for the currently selected result. This is needed for non-blocking details such as loaded images, rich web details, or streamed AI answers.

IDetails can implement INotifyPropChanged and raise PropChanged for Body, but the visible details pane does not update live. The user has to move selection to another item and come back to see the new Markdown.

A workaround is to rebuild the list and call RaiseItemsChanged() when the details content changes. That does refresh the details pane, but it resets the selected result / scroll position back to the first item, which is disruptive while the user is navigating results.

Expected behavior

There should be a supported way for an extension to refresh the details pane for the currently focused item without rebuilding the full list and without resetting selection/scroll.

Possible fixes could be:

  • make IDetails.Body observable when IDetails implements INotifyPropChanged, or
  • expose an API to invalidate/refresh the currently focused details pane, or
  • preserve selection and scroll when a list refresh replaces equivalent items.

Actual behavior

  • Updating IDetails.Body and raising PropChanged(nameof(Body)) does not update the visible Markdown pane live.
  • Replacing details through a list rebuild updates the pane, but Command Palette jumps back to the first item.

Repro outline

  1. Create a DynamicListPage with results that have a custom IDetails implementation.
  2. Return an initial Body, then update it later from an async operation.
  3. Raise PropChanged for Body.
  4. Observe that the visible details pane does not update until selection changes.
  5. Add a workaround that rebuilds list items and calls RaiseItemsChanged().
  6. Observe that the details pane updates, but the selected item / scroll position is reset.

Related issue

This is related to #39216, but the remaining problem is the practical workaround: rebuilding the list forces the live update but breaks navigation state.

Impact

Async/lazy details are important for Command Palette extensions because search results should stay fast. Extensions should be able to show immediate results first, then update the details pane later without causing list navigation resets.

Metadata

Metadata

Assignees

Labels

Product-Command PaletteRefers to the Command Palette utilityResolution-Fix CommittedFix is checked in, but it might be 3-4 weeks until a release.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions