Fix: Ensure history pane refreshes on subsequent visits

This change ensures that the profile history pane refreshes its content when the user navigates back to it, addressing a bug where stale data could be displayed.

It implements an optimized strategy:
- On the first load, `ensureInitialLoad` is called, which handles the initial fetch internally.
- On subsequent visits (when the renderer is already initialized), `refresh({ force: true })` is called explicitly to update the list.

The unit test `history pane lazily initializes the watch history renderer` was updated to reflect this behavior, verifying that `ensureInitialLoad` is called once and `refresh` is called on subsequent opens.
This commit is contained in:
google-labs-jules[bot] committed 2026-01-14 04:05:23 +00:00
1 parent 040a5d0976
commit 4bf3605fd2
2 files changed
+46 -11

No files matched your search

+6 -1
View File
@@ -5850,7 +5850,12 @@ export class ProfileModalController {
}
try {
await renderer.ensureInitialLoad({ actor: primaryActor });
const state = typeof renderer.getState === "function" ? renderer.getState() : {};
if (state.initialized) {
await renderer.refresh({ actor: primaryActor, force: true });
} else {
await renderer.ensureInitialLoad({ actor: primaryActor });
}
if (!this.boundProfileHistoryVisibility) {
this.boundProfileHistoryVisibility = () => {