Commit 13728b7
authored
ENG-1694: Memoize getAllPageNames in Share Query Results dialog (#1096)
* ENG-1694: Memoize getAllPageNames in Share Query Results dialog
getAllPageNames() was called inline in JSX, walking every page in the
graph on each render of ExportDialog. On big graphs the 'Send to Page'
autocomplete took seconds to populate. Hoist into useMemo so it runs
once per dialog mount.
Also cap AutocompleteInput's rendered dropdown at 50 items (default
Infinity) to avoid rendering thousands of MenuItems per keystroke.
* ENG-1694: Refresh page-name list when Share dialog opens
Empty-dependency memo captured page names once when ResultsView mounted,
not when the dialog opened. Pages created or renamed in between never
appeared in the autocomplete. Gate the memo on isOpen so the list is
recomputed each time the dialog is shown.1 parent e527149 commit 13728b7
1 file changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
196 | 200 | | |
197 | 201 | | |
198 | 202 | | |
| |||
1011 | 1015 | | |
1012 | 1016 | | |
1013 | 1017 | | |
1014 | | - | |
| 1018 | + | |
| 1019 | + | |
1015 | 1020 | | |
1016 | 1021 | | |
1017 | 1022 | | |
| |||
0 commit comments