perf(mail): cut unnecessary render/listener work in mobile nav#1073
Open
real-venus wants to merge 1 commit into
Open
perf(mail): cut unnecessary render/listener work in mobile nav#1073real-venus wants to merge 1 commit into
real-venus wants to merge 1 commit into
Conversation
Scoped performance pass on the existing navigation surface (issue Stellar-Mail#978), no behavior or visual change. Topbar: only subscribe to global scroll/resize while a dropdown is open. The scroll listener uses capture, so previously it fired on every scroll anywhere in the app (email list, reader) even with no panel to reposition. Now the listener is detached in the common all-closed state. Sidebar: extract the add-folder input into its own component that owns its text state. Typing a folder name previously re-rendered the entire sidebar nav (all section items and FolderButtons) on every keystroke; that work is now isolated to the input. tsc --noEmit clean, lint clean on touched files, unit suite passes (439).
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.
Summary
Scoped performance pass on the existing Mobile Navigation surface (issue #978). Reduces unnecessary global listeners and per-keystroke re-renders. No behavior, copy, or visual change — strictly fewer wasted renders/listeners.
Closes #978
Hotspots identified (before changing code)
scrolllistener in capture phase that stayed mounted at all times, so it fired on every scroll anywhere in the app (email list, reader panes) even when no dropdown was open and there was nothing to reposition.FolderButton(each amotion.button) — on every keystroke.Changes
scroll/resizenow subscribe only while a dropdown is open (if (!anyOpen) return). In the common all-closed state, no global listener runs. Reposition-on-open and reposition-on-scroll-while-open behavior is unchanged.AddFolderInput, which owns its own text state. Typing is now scoped to the input; the folder list no longer re-renders per keystroke. Markup, animation, Enter/Escape/cancel behavior all preserved.Performance note (reasoned)
Scope
2 files, both within the issue's listed paths. No new tool/feature, no real data, no broad refactor.