fix: resolve sidebar top-action icons synchronously to eliminate blank-icon frame#146
Merged
Merged
Conversation
…k-icon frame
Two changes:
1. icons.js — refreshIcons(el) is now synchronous. Previously it deferred
via requestAnimationFrame, leaving a frame window where <i data-lucide>
placeholders were in the DOM unpainted. Also fixes the lucide API: the
old code passed { nodes: [scope] } which lucide 0.468.0 silently ignores
(unrecognised option); the correct scoped API is { root: scope }.
2. sidebar-sessions.js — renderSessionList() now calls lucide.createIcons()
synchronously on the stickyTop node right after building it (before
appending to the main list). This ensures New Session / Agent Chat icons
are resolved before any paint, matching the stability of session-item
icons which never visibly flicker.
Session items don't exhibit the blank-icon flash because they are rebuilt
in a large batch where the rAF fires before a visible paint. The top-action
buttons are a smaller targeted swap (via refreshSessionTopActions on vendor
change) where the single-frame gap is perceptible.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
This issue has been resolved in version 1.1.1-beta.1 (beta). To update, run: |
|
This issue has been resolved in version 1.2.0 (stable). To update, run: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Diagnosis
New Session and Agent Chat icons occasionally rendered as blank (invisible) because icon resolution was deferred via
requestAnimationFrame. BetweenreplaceChild(or the initialrenderSessionListbuild) and the rAF firing, the browser could paint a frame with raw<i data-lucide>placeholders — no dimensions, no visible content.Session-item icons don't exhibit this because they are rebuilt in a large batch; the rAF fires before a distinct paint of the top area is visible. The top-action buttons are a small targeted swap (via
refreshSessionTopActionson vendor change) where the single-frame gap is perceptible.Additionally,
refreshIcons(el)was passing{ nodes: [scope] }to lucide — an unrecognised option that lucide 0.468.0 silently ignores (falls back to full-document scan). The correct scoped API is{ root: scope }.Changes
icons.js:refreshIcons(el)is now synchronous — callslucide.createIcons({ root: scope })immediately, cancels any pending deferred scans (the sync pass covers them). The no-scope path (deferred full-doc rAF) is unchanged.sidebar-sessions.js:renderSessionList()callslucide.createIcons({ root: stickyTop })synchronously after building the sticky-top node, before appending to the DOM. The deferredrefreshIcons()at the end still covers the rest of the list.