+
@foreach (var group in this.groups)
{
@* A level-two heading was shown as h5 while this list was Markdown, because that is what
diff --git a/app/MindWork AI Studio/Components/SourcesList.razor.cs b/app/MindWork AI Studio/Components/SourcesList.razor.cs
index 531a13da..b7d24d5f 100644
--- a/app/MindWork AI Studio/Components/SourcesList.razor.cs
+++ b/app/MindWork AI Studio/Components/SourcesList.razor.cs
@@ -17,6 +17,12 @@ namespace AIStudio.Components;
///
public partial class SourcesList : MSGComponentBase
{
+ //
+ // The name is about the alignment the function uses, not about the page: it brings the element
+ // into view with its end at the bottom, which for a list at the end of an answer shows all of it.
+ //
+ private const string SCROLL_INTO_VIEW_FUNCTION = "scrollToBottom";
+
///
/// The sources to show.
///
@@ -26,11 +32,26 @@ public partial class SourcesList : MSGComponentBase
[Inject]
private RustService RustService { get; init; } = null!;
+ [Inject]
+ private IJSRuntime JsRuntime { get; init; } = null!;
+
[Inject]
private ILogger Logger { get; init; } = null!;
private readonly List groups = [];
+ private ElementReference listElement;
+
+ ///
+ /// Brings this list into view.
+ ///
+ ///
+ /// The counter above an answer says how many sources it rests on; this is how it takes the
+ /// reader to them. The element stays here, where it is rendered, rather than being handed to
+ /// whoever wants to scroll to it.
+ ///
+ public async Task ScrollIntoViewAsync() => await this.JsRuntime.TryInvokeVoidAsync(this.CircuitState, SCROLL_INTO_VIEW_FUNCTION, this.listElement);
+
#region Overrides of ComponentBase
protected override async Task OnParametersSetAsync()