earlSt1 / vtt-compendium-folders

Collapsable folders in the compendium directory and folder structures inside compendiums for FoundryVTT
21 stars 18 forks source link

Add compatibility with PF2e deep search #149

Closed TiloBuechsenschuss closed 1 year ago

TiloBuechsenschuss commented 2 years ago

The new PF2 system has added a "deep search" button to the compendium tab. With Compendium Folders active, however, the button is not visible, instead the "collapse all" button overlays it.

Maybe make the search bar a bit smaller or place the button somewhere else as a fix

001 Without module, button's there. 002 With module, button's not visible anymore.

earlSt1 commented 2 years ago

Thanks for informing me, i'll include this change in the next version of CF

JamzTheMan commented 1 year ago

Maybe next release? :)

earlSt1 commented 1 year ago

Hi, sorry for the lack of updates. I remember diving into this issue and found it a right pain to implement. Now v10 is sorted i can have another look at this.

LotsOfLore commented 1 year ago

Thank you for the update. Looking forward to it :)

earlSt1 commented 1 year ago

I just had another look into it and I think it would be easier if the PF2e team adds a workaround on their side. I'll reach out to them and see if we can figure something out

TiloBuechsenschuss commented 1 year ago

A heads up: the latest PF2 release added a new feature: (stwlam) Consolidate shallow/deep search in compendium sidebar (link: https://github.com/foundryvtt/pf2e/releases/tag/4.0.1) I'm in the process of updating, so can't say yet whether it affected this bug. I'll let you know nce I know either way. :-)

earlSt1 commented 1 year ago

Ahhh I wondered why i couldn't see the button. I tested it with just the search bar and could see what it was doing anyway and i still think i need to reach out to the pf2e team to implement a fix on their end

TiloBuechsenschuss commented 1 year ago

Alright, so the update changed the functionality a little. The button does not exist anymore, you just automatically search the compendiums' contents. But: with Compendium Folders activated that "deep search" does not work any more. So contacting the Pathfinder 2E people might still be useful.

esheyw commented 1 year ago

Any chance of this happening at some point? Love me some folders, don't want to squash a cool feature of the system I'm using.

earlSt1 commented 1 year ago

Any chance of this happening at some point? Love me some folders, don't want to squash a cool feature of the system I'm using.

Hi, i've finished work for the next few weeks so can have another look into it. Sorry for the wait

earlSt1 commented 1 year ago

Hi folks, a quick update on my end.

After looking into the code for the pf2e deep search I think the easiest course of action would be to replicate the deep search in Compendium Folders. The main problem is that the pf2e compendium code is baked into the system and has a lot of internal dependencies.

I'll let you all know once i have a test branch setup for you to try out. Thanks for your patience!

earlSt1 commented 1 year ago

Good news everyone! I've got a test version ready for you guys to play around with.

I've given it a run through locally and it seems to work fine. if any of you are able to give it a more throrough test (especially if you have a lot of compendiums) that would be awesome.

There are some small limitations - mainly that I'm not using the clever minisearch that the pf2e system uses. Because of this, i'm limiting the search term for deep search to activate when 3 character terms are searched for (so 2 character terms will default back to the old CF search method).

If you'd like to give it a test run, uninstall your current CF version and install this one using the manifest here: https://raw.githubusercontent.com/earlSt1/vtt-compendium-folders/10x-update/test/module.json

Although this should not affect your compendiums, i still recommend backing up your worlds/compendiums just in case.

Let me know if you run into any issues :smile:

TiloBuechsenschuss commented 1 year ago

Seems to work nicely after a (very) quick test-run. Three characters is more than fine, searching in all compendia with just two characters will likely turn up way to much anyway. Thanks so much for your efforts! If I notice anything, I'll be sure to let you know. :-)

earlSt1 commented 1 year ago

Seems to work nicely after a (very) quick test-run. Three characters is more than fine, searching in all compendia with just two characters will likely turn up way to much anyway. Thanks so much for your efforts! If I notice anything, I'll be sure to let you know. :-)

Sounds good. I'll leave this open for a day or 2 then will look to include it in the next release. You should be able to update from that test version when I do so.

One thing i noticed so far is that if you make changes to a compendium then the indexes dont refresh. To get around this you can click the refresh button to the left of the search bar in the compendium tab and it will reload the indexes

esheyw commented 1 year ago

I've been using this for a few days now, no problems.

earlSt1 commented 1 year ago

Implemented in v2.5.7