Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only display 15 nodes in the Recent section of the Create New Node dialog #78309

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Jun 16, 2023

This prevents the history size from becoming too large, which made it less useful.

This also fixes an off-by-one error in the completion scoring algorithm.

@akien-mga
Copy link
Member

Maybe we should instead limit how many entries get saved in the file? The file will still grow to encompass all nodes in the engine over time, which doesn't seem too useful.

10 might be a bit too restrictive, though I don't use the recent nodes list much myself so I'm not sure how often I would scroll down to pick an 11th or 15th node.

@Calinou Calinou force-pushed the editor-create-new-node-recent-limit-history-size branch from 92271cd to b763f22 Compare June 23, 2023 21:51
…alog

This prevents the history size from becoming too large, which made it less
useful.

This also fixes an off-by-one error in the completion scoring algorithm.
@Calinou Calinou force-pushed the editor-create-new-node-recent-limit-history-size branch from b763f22 to 08118b1 Compare June 23, 2023 21:52
@Calinou
Copy link
Member Author

Calinou commented Jun 23, 2023

Maybe we should instead limit how many entries get saved in the file? The file will still grow to encompass all nodes in the engine over time, which doesn't seem too useful.

10 might be a bit too restrictive, though I don't use the recent nodes list much myself so I'm not sure how often I would scroll down to pick an 11th or 15th node.

It turns out there was already a built-in limiting system, but it was set to a very large value (32 items) and had a off-by-one error (which made it limit to 33 items). I've reduced it to 15 items, and also fixed a off-by-one error in the completion scoring system (which used 6 recent items instead of 5).

Here's an example saved list in .godot/editor/create_recent.Node after creating lots of different nodes. This is the whole file with only 15 lines:

AnimationTree
AudioListener3D
TextEdit
AnimatedSprite2D
ParallaxBackground
NavigationAgent2D
NavigationAgent3D
Node
SubViewport
Window
SkeletonIK3D
Node3D
GraphNode
AudioStreamPlayer
Timer

Old entries are discarded as expected.

@akien-mga akien-mga changed the title Only display 10 nodes in the Recent section of the Create New Node dialog Only display 15 nodes in the Recent section of the Create New Node dialog Jun 26, 2023
@akien-mga akien-mga modified the milestones: 4.x, 4.2 Jun 26, 2023
@YuriSizov YuriSizov merged commit 6b3e877 into godotengine:master Jul 14, 2023
@YuriSizov
Copy link
Contributor

Thanks!

@Calinou Calinou deleted the editor-create-new-node-recent-limit-history-size branch July 14, 2023 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'Recent' panel in 'Create new node' popup is never cleared.
3 participants