Skip to content
This repository has been archived by the owner on Jan 22, 2022. It is now read-only.

Add search tabs functionality and grid layout #429

Open
wants to merge 7 commits into
base: xenial
Choose a base branch
from

Conversation

kugiigi
Copy link
Contributor

@kugiigi kugiigi commented Dec 23, 2020

This adds a search functionality for tabs.
It can be access with Ctrl+Space, search button in the tab bar or swiping down from the tabs list in mobile layout.
Incidentally, this also fixed #411

screenshot20201224_002440528
screenshot20201224_004609478

@UniversalSuperBox
Copy link
Member

Unfortunately, this seems to conflict on TabsList.qml. I've made what I think is the proper fix for this here: https://github.com/UniversalSuperBox/morph-browser/tree/xenial_-_tabsearch... Could you check out the edited commits and edit your branch accordingly?

@cibersheep
Copy link
Contributor

Oooooh! I like!

Copy link
Member

@UniversalSuperBox UniversalSuperBox left a comment

Choose a reason for hiding this comment

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

Wow. What a treat to use.

But there are some concerns I have...

Sometimes when I open the tab listing, no tabs are displayed. This is easiest to reproduce when opening the browser with only one tab open. When this occurs, the following is logged:

file:///usr/share/morph-browser/webbrowser/TabsList.qml:256:21: Unable to assign QUrl to QQuickIcon
Ignoring sourceSize request for image url that came from grabToImage. Use the targetSize parameter of the grabToImage() function instead.
Ignoring sourceSize request for image url that came from grabToImage. Use the targetSize parameter of the grabToImage() function instead.

Empty mobile tab listing

It appears that the search only occurs when the Enter key is pressed. For whatever reason, I expected it to be continuous. Can the search be continuous (as the user types) without adding a lot of complexity or slowing down the model? If not, could the tab list be grayed out while typing so the user doesn't expect it to update until they press Enter? Tapping on the grayed out list should cancel the search and return to it.

@kugiigi
Copy link
Contributor Author

kugiigi commented Feb 4, 2021

I haven't encountered this but I'll check
also, search should work while typing. No need to press enter

UPDATE: I immediately encountered it with 50+ tabs 😅
Probably an issue introduced with Qt5,12. Got to investigate further..

@kugiigi
Copy link
Contributor Author

kugiigi commented Feb 6, 2021

  • Disabled predictive text in the search field so that search is done as you type even with predictive text is enabled in the keyboard.

  • Fixed error you mentioned about the icon which sadly isn't the cause of the blank tab list issue

  • After a long battle with the issue with Repeater, I came up with a workaround to fix the blank tab list issue. Actually, I already have a workaround which worked fine in Qt5.9 but apparently Qt5.12 introduced another issue with that workaround wherein the tab list is blank in narrow layout until you change model data (i.e. perform search). The workaround I end up using isn't perfect but hopefully it's enough for now 😅

@UniversalSuperBox
Copy link
Member

The workaround I end up using isn't perfect but hopefully it's enough for now

What does this mean? What issues still remain?

@kugiigi
Copy link
Contributor Author

kugiigi commented May 18, 2021

I can't remember anymore if there were still issues 😅
But I think what I meant there is that my workaround doesn't look good and a bit hackish. But at least it works 😄

// WORKAROUND: Repeater items in listNarrowComponent stay hidden when switching from wide to narrow layout
// if the model is direcly assigned in its definition. This solves that issue.
target: browser
onWideChanged: if (!target.wide) searchText = " "
Copy link
Member

Choose a reason for hiding this comment

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

Is setting the search text to " " different than setting it to ""?

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, "" won't fix the issue 😅
It's not a good workaround, I admit but that's what I came up after hours of debugging :)
Maybe I can go back in the future and see if I can find an actual fix.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Slide to close tab is too sensitive
3 participants