Skip to content

Conversation

@waaake
Copy link
Contributor

@waaake waaake commented Oct 24, 2024

Description

Search bar Updates

  • Search bar can now be toggled with the Search Button.
  • The GraphEditor had an obstructive search before and now it is clubbed with the bottom panel options.
  • The Search Bar now supports "Return Key Press" to move on the next filtered item in the Graph Editor.
  • Search Bar also gets a clear text action when text is entered in the field.
  • Updated SearchBar in ImageGallery, Node Editor, 3D Inspector to now be toggled.

@waaake waaake self-assigned this Oct 24, 2024
@cbentejac cbentejac added this to the Meshroom 2024.1.0 milestone Oct 28, 2024
Layout.rightMargin: 10
Layout.leftMargin: 10

toggle: true // enable toggling the actual text field by the search button
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
toggle: true // enable toggling the actual text field by the search button
toggle: true // enable toggling the actual text field by the search button
isVisible: true

I think the search bar should already be expanded in the case of the 3D inspector. Otherwise, you just have the magnifier icon on the top-left that blocks the entire row while the loaded elements are displayed on the entire row below, and it creates a major imbalance visually speaking.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also think it'd be better to have some left- and right-margins in this case: the search bar takes up 100% of the horizontal space, which is not the case of the loaded 3D elements, and it also creates an imbalance.

Screenshot_2024-11-12_10-33-26

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have reverted the search bar UI on the Inspector 3d to be the default as how it used to be.
Keeping in mind that a toggle feature here does not do us any good, even hidden the search bar takes an entire row.
That should make it better.

Comment on lines 83 to 85
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think some minor right-padding should be added: when the "clear" button appears, the search bar generally has the focus (so is "highlighted") and when hovering over the button, it goes over the highlighting, which is not very pleasing.
Screenshot_2024-11-12_10-28-03

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is now fixed with the change here,

anchors.rightMargin: 2 // Leave a tiny bit of space so that its highlight does not overlap with the boundary of the parent

This change ensures we're leaving sufficient space on the right side as to not overlap with the parent's bounds.
Hoping this makes it better 🙂

@cbentejac cbentejac changed the title Dev/search bar [ui] Improve Search Bar component Nov 12, 2024
Comment on lines 303 to 304
Layout.minimumWidth: searchBar.width
maxWidth: parent.width
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something around here triggers the following binding loop:

meshroom/ui/qml/Viewer3D/Inspector3D.qml:280:9: QML Group: Binding loop detected for property "implicitWidth"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inspector 3d gets the default search bar, so this warning doesn't appear anymore.

@waaake waaake marked this pull request as draft November 26, 2024 11:28
@waaake waaake marked this pull request as ready for review November 26, 2024 13:35
Copy link
Member

@yann-lty yann-lty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well overall (only minor changes required)!
Side note, the handling of bound iteration is acting weird when we don't have a match in the Graph Editor (but outside the scope of you changes).
image

}

// Handle enter Key press and forward it to the parent
Keys.onPressed: (event)=> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be using the more semantic onAccepted slot to have both Return and Enter key considered
(to work with Enter key on numpad).
The root signal for the search bar could be accepted to match that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The core signal from the class is updated to be called accepted but using onAccepted instead of Keys.onPressed currently is emitting the signal twice so keeping it same at the moment,
Have updated the event to consider both Return and Number Pad Enter key though.

}
function modelData(item, roleName_) {
return item.model.object[roleName_]
Item {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, could you elaborate on why this extra Item is needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I started facing the issue with Qt6 rebase where the width of the panel reacts to the model contents in the repeater, as the filteredNodes repeater has root.graph.nodes as the model, a new node getting add to the graph was increasing the width of the panel and same when the node gets removed, the width would get decreased. Prior to Qt6 this was working as expected without need for the additional Item which is hidden.

meshrec.mp4

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have taken the easy road here, just the previous code with the delegate Item { visible: false } avoids this issue as of now, so we don't have to add an extra item. I see other search mechanisms in Meshroom also user a SortFilterDelegate so keeping it same at the moment.

textField.onTextChanged: navigation.currentIndex = -1

onReturnPressed: {
nextArrow.clicked()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be great to have a dedicated function to change the navigation current index, instead of triggering the event of another button here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is updated to now invoke navigation.navigateForward() instead

…the search button.

SearchBar gets the clear text feature allowing text to be cleared with a single click.

Added accepted signal for the Searchbar with Return and Enter key Press
Search bar is now placed in the bottom pane of the Graph Editor making it non-obstructing for navigating nodes across Graph Editor
Fixed the issue where navigation arrows on the Filtering was allowing to set an index even when the search had null as the result.

Accepted signal on the Seach invokes the function rather than invoking the sigal for the button
Node Editor search can now be toggled making it take lesser space by default.
@waaake waaake reopened this Dec 1, 2024
@waaake
Copy link
Contributor Author

waaake commented Dec 2, 2024

Works well overall (only minor changes required)! Side note, the handling of bound iteration is acting weird when we don't have a match in the Graph Editor (but outside the scope of you changes). image

Thanks for this feedback, I had noticed it earlier, but left it as is.
Now with the changes to have a separate function navigateForward and navigateBackward, have added a condition to ensure we have something filtered to be able to change the index of the search. That resolves this issue 🙂

@yann-lty yann-lty merged commit 409c7ec into develop Dec 2, 2024
5 checks passed
@yann-lty yann-lty deleted the dev/SearchBar branch December 2, 2024 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants