UI: doc count in DB dropdown and overview only updates on full page refresh #18
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_indexer#18
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug
In the hero_indexer dashboard, the document count shown in:
mydb (3 docs)), andDocuments,Size,Segments)only updates after a full page refresh. Adding documents via the UI updates the SERVER STATS widget (
Total Docs) on its 5-second interval, but the dropdown label and the overview pane stay stale until the page is reloaded.Expected
Both the dropdown labels and the overview pane should reflect the current state on the same auto-refresh cadence as
SERVER STATS.Root cause
In
crates/hero_indexer_ui/static/index.html, onlyupdateServerStatusandrefreshStatsare on the 5ssetInterval.loadDatabases()(which renders the(N docs)labels) and the inline overview-render block (inside thedb-selectorchange handler) are never re-invoked after the initial load.Affected file
crates/hero_indexer_ui/static/index.htmlFix
Applied to
crates/hero_indexer_ui/static/index.html:Extracted the DB overview render out of the anonymous
db-selectorchangehandler into a named functionloadDatabaseOverview(db)so it can be reused by the auto-refresh interval. The change handler now just callsawait loadDatabaseOverview(db).Added a third 5s interval in the
DOMContentLoadedinitializer that:loadDatabases()— the existing implementation already preserves the user's current selection (prev = selector.value) while re-rendering each option's(N docs)label, so the dropdown updates without dropping the selection;loadDatabaseOverview(currentDb)to refresh the right-paneDocuments/Size/Segmentsnumbers and the schema table.Why this approach
updateServerStatusandrefreshStats, so all dashboard widgets stay consistent.loadDatabases()was already selection-safe; no extra state needed.loadDatabaseOverviewremoves the duplication that previously made it impossible to refresh the overview without simulating a selector change event.Verification
cargo check -p hero_indexer_uipasses.(N docs)and the overview'sDocumentscount both update within 5s without a page reload.