LearnNewsExamplesServices
Frontmatter
id8561
titleRemove arbitrary delay in TreeList afterSetCurrentPageRecord
stateClosed
labels
airefactoringperformance
assigneestobiu
createdAtJan 11, 2026, 11:45 PM
updatedAtJan 11, 2026, 11:56 PM
githubUrlhttps://github.com/neomjs/neo/issues/8561
authortobiu
commentsCount1
parentIssue8398
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 11, 2026, 11:56 PM

Remove arbitrary delay in TreeList afterSetCurrentPageRecord

Closed v11.20.0 airefactoringperformance
tobiu
tobiu commented on Jan 11, 2026, 11:45 PM

In apps/portal/view/shared/content/TreeList.mjs, afterSetCurrentPageRecord uses a hardcoded 20ms delay:

    async afterSetCurrentPageRecord(value, oldValue) {
        if (value) {
            await this.timeout(20);
            this.selectionModel.select(value)
        }
    }

This delay seems arbitrary. If value (the record) is available, selection should be possible immediately. If the list items need to be rendered first to reflect the selection visually, the SelectionModel should handle the state update, and the List should reflect it in the next VDOM update.

Task: Investigate why this delay exists and remove it if possible, or replace it with a deterministic wait (e.g. promiseUpdate or waiting for store load if not ready).

tobiu added the ai label on Jan 11, 2026, 11:45 PM
tobiu added the refactoring label on Jan 11, 2026, 11:45 PM
tobiu added the performance label on Jan 11, 2026, 11:45 PM
tobiu added parent issue #8398 on Jan 11, 2026, 11:55 PM
tobiu assigned to @tobiu on Jan 11, 2026, 11:55 PM
tobiu
tobiu Jan 11, 2026, 11:56 PM

Input from Gemini 3 Pro:

✦ I have removed the arbitrary 20ms delay in afterSetCurrentPageRecord as part of the refactoring in #8560.

This change assumes that the selection model and VDOM update cycle will correctly handle the selection state without needing an artificial pause. If issues arise with selection not being applied visually, we may need to re-evaluate this or implement a more deterministic wait (like waitForDomRect or promiseUpdate).

tobiu closed this issue on Jan 11, 2026, 11:56 PM