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

Implement the extensions searchbar #409

Closed
2 tasks done
Tracked by #334
tomlin7 opened this issue Oct 10, 2024 · 8 comments
Closed
2 tasks done
Tracked by #334

Implement the extensions searchbar #409

tomlin7 opened this issue Oct 10, 2024 · 8 comments
Labels
enhancement New feature or request extensions Related to the biscuit extensions API help wanted Extra attention is needed

Comments

@tomlin7
Copy link
Owner

tomlin7 commented Oct 10, 2024

Following #334
The extension center search bar is not functional yet, simply implement this.

  • When search bar is not empty, filter the extensions (from extensions.toml) and show the results
  • When search bar is empty, show the recommend extensions (recommended.toml Show extension recommendations #334 )
@tomlin7 tomlin7 added extensions Related to the biscuit extensions API help wanted Extra attention is needed enhancement New feature or request labels Oct 10, 2024
@Kabiirk
Copy link
Contributor

Kabiirk commented Oct 18, 2024

Hi @tomlin7,

I also messaged you on discord regd. this issue,

Needed some clarity w.r.t issue #409 , As I understand, I'd have to edit sidebar.py to parse extensions.toml or recommendations.toml to show a frame (via self.show_view(self.extensions)) ? do correct if I'm wrong.

Moreover, From what I understand, extensions.toml or recommendations.toml would be generated upon installation

@tomlin7
Copy link
Owner Author

tomlin7 commented Oct 19, 2024

Hello @Kabiirk

This issue regarding the extensions view search bar is also connected to #334 (showing recommended extensions by default), which is not completed yet. So currently, the view shows all the extensions from extensions.toml

After fetching the data is inserted into a fetch queue, and this is accessed in the extensions GUI

You will just have to filter the data according to the extensions search bar input and show it whenever the search bar is not empty.

@Kabiirk
Copy link
Contributor

Kabiirk commented Oct 19, 2024

Ah, I see, so you are already populating the sidebar 'frame' (which shows the extension names). I just need to write the logic to filter from the given names (basically running a filter query on self.fetch_queue) as per user input and update the GUI.

I'd be happy to assist on this, Thanks for the detailed description & clarity !

@Kabiirk
Copy link
Contributor

Kabiirk commented Oct 22, 2024

Hi @tomlin7, I'm working on Issue#409 in biscuit. I've been facing issues in getting the project up and running

Steps as per contribution guidelines:

  1. I cloned the repo
  2. I ran poetry install from root
  3. when I try to run the application from root using poetry run biscuit, I get the following error :

File "/mnt/c/users/..../Hacktoberfest/2024/biscuit/src/biscuit/common/icons.py", line 1, in
from enum import StrEnum
ImportError: cannot import name 'StrEnum' from 'enum' (/usr/lib/python3.10/enum.py)

I tried reinstalling enum (confirmed to be installed with poetry run python3 then importing enum via import enum) but it still doesnt solve the issue . I also tried reinstalling enum with poetry run pip install enum but I get the following error :

Collecting enum
Using cached enum-0.4.7.tar.gz (20 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [8 lines of output]
Traceback (most recent call last):
File "", line 2, in
File "", line 11, in
File "/usr/lib/python3.10/tokenize.py", line 33, in
import re
File "/usr/lib/python3.10/re.py", line 145, in
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

System info:
Ubuntu 22.0 (WSL2) (I installed pre-requisites)
python version : 3.10.12
poetry version : 1.8.4
biscuit repo branch : main (my fork is synced to the latest commit)

@tomlin7
Copy link
Owner Author

tomlin7 commented Oct 23, 2024

@Kabiirk thanks for bringing this to my attention! StrEnum wasn't added until 3.11, so that makes the editor support only Python 3.11+. Please try again with the mentioned version or try using a version manager like pyenv to handle both versions if you still need 3.10!

@Kabiirk
Copy link
Contributor

Kabiirk commented Oct 25, 2024

hi @tomlin7,

Thanks for the support ! I was able to get the project up and running with Python 3.11.9

I have implemented the search functionality. It looks like this :
screen-capture9-ezgif com-speed

This has been achieved by adding search functions (filter logic) to the ExtensionManager in src\biscuit\extensions\extensions.py

Let me know if this looks good. I'll make the PR


P.S.
I found out the hard way that Biscuit doesn't build with latest version of Python (v3.13). Since the cgi subpackage in the tarts dependency (in your requirements.txt) is deprecated & removed in Python 3.13 (source 1) (source 2) (Source 3). Alternatives for cgi methods are mentioned in the docs itself.

This is more of a problem for devs @ tarts to solve. Only impact I see on this project is that it throws a ModuleNotFoundError: No module named 'cgi' when you run the project (biscuit or poetry run biscuit) after building with Python 3.13 & above.

@tomlin7
Copy link
Owner Author

tomlin7 commented Oct 26, 2024

@Kabiirk that looks excellent to me! please open a pr and I will merge it.

  • It would be nice to trigger the search via the enter key press too

Btw thanks for pointing out the dependency error! I will mark Biscuit as unsupported for 3.13 until this issue is resolved. Tarts is maintained by me currently. I'll make some quick changes to fix this for now.

@Kabiirk
Copy link
Contributor

Kabiirk commented Oct 26, 2024

@tomlin7 Done ! I've added the enter key-press functionality.

Making PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request extensions Related to the biscuit extensions API help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants