[improvement][ui] name filter now compares the typed word with the beginning of the package name

This commit is contained in:
Vinicius Moreira
2020-06-09 18:43:08 -03:00
parent f4999b680c
commit dcd77ac7f3
2 changed files with 4 additions and 1 deletions

View File

@@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [0.9.6] 2020
### Improvements
- UI
- name filter now compares the typed word with the beginning of the package name
### Fixes
- Web
- handling unexpected connection errors

View File

@@ -51,7 +51,7 @@ def apply_filters(pkgv: PackageView, filters: dict, info: dict):
hidden = not pkgv.model.categories or not [c for c in pkgv.model.categories if c.lower() == filters['category']]
if not hidden and filters['name']:
hidden = filters['name'] not in pkgv.model.name.lower()
hidden = not pkgv.model.name.lower().startswith(filters['name'])
if not hidden and (not filters['display_limit'] or len(info['pkgs_displayed']) < filters['display_limit']):
info['pkgs_displayed'].append(pkgv)