Repository navigation
fix(tui): share dialog width instead of one resize listener per row - #56234
Merged
Merged
Conversation
Contributor
|
The following comment was made by an LLM, it may be inaccurate: |
Contributor
There was a problem hiding this comment.
Looks good. The per-row useTerminalDimensions() call is removed, and the width is now computed once in DialogSelect with the same dialog/dimensions values, so details still re-truncate on resize. I checked it by running the new test against the base, where the resize listener count goes from 5 to 32 and the test fails. With this PR the full dialog-select suite passes (34/34) and tsgo -b is clean in packages/tui. DialogSelect is the only place that renders DialogSelectDetails, so nothing else is missing the new width prop.
Public API: unchanged; only internal component props are touched.
No concerns.
This was referenced Oct 20, 2026
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.
Issue for this PR
Follow-up to #44055 (closed as fixed in v2.0.21, same symptom, different site).
Type of change
What does this PR do?
DialogSelectDetailscalleduseTerminalDimensions()per option row, registering one rendererresizelistener per mounted row. Palettes with 15+ entries trip Nodes MaxListeners warning routinely:Possible EventEmitter memory leak detected. 16 resize listeners added.Introduced by #55517 (row components split). The width is now computed once at the top of
DialogSelectand passed down as a prop; rows only read it.How did you verify your code works?
New test
dialog rows do not add renderer resize listeners: 30 options mounted, renderer listener count stays flat. Without the fix: 5 -> 32 (fails); with it: stays at 5. Fulldialog-selectsuite: 34 pass.tsgo -b: clean.oxlint: clean. Also verified in a local build: the warning no longer appears when opening palettes with many entries.Screenshots / recordings
n/a (no visual change)
Checklist