mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 01:06:00 +03:00
[PR #3171] [MERGED] feat: revamped spotlight #4263
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#4263
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hoppscotch/hoppscotch/pull/3171
Author: @AndrewBastin
Created: 7/4/2023
Status: ✅ Merged
Merged: 7/11/2023
Merged by: @AndrewBastin
Base:
release/2023.8.0← Head:refactor/spotlight📝 Commits (10+)
053aafcfeat: add clear history action873801achore: add minisearch and bump @vueuse/core dep07ec133refactor: provide global i18n function through the module4b6e0c5refactor: expose function to get a service instance from dioc through module86a62c2feat: initial reworked spotlight implementation0c15cbcfeat: introduce debug service6b883dbrefactor: ability for defineActionHandler to be able to control bindingc1b73a9feat: add action handler to login and logout components89e981dchore: update vitest config to support loading icons3ada19dfeat: general spotlight improvements and introducing user searcher📊 Changes
36 files changed (+3899 additions, -1001 deletions)
View changed files
📝
packages/hoppscotch-common/locales/en.json(+6 -0)📝
packages/hoppscotch-common/package.json(+2 -1)📝
packages/hoppscotch-common/src/components.d.ts(+4 -3)📝
packages/hoppscotch-common/src/components/app/Footer.vue(+1 -1)➖
packages/hoppscotch-common/src/components/app/Fuse.vue(+0 -69)📝
packages/hoppscotch-common/src/components/app/Header.vue(+13 -2)➖
packages/hoppscotch-common/src/components/app/PowerSearch.vue(+0 -122)➖
packages/hoppscotch-common/src/components/app/PowerSearchEntry.vue(+0 -68)📝
packages/hoppscotch-common/src/components/app/Shortcuts.vue(+35 -44)📝
packages/hoppscotch-common/src/components/app/ShortcutsEntry.vue(+3 -8)➕
packages/hoppscotch-common/src/components/app/spotlight/Entry.vue(+122 -0)➕
packages/hoppscotch-common/src/components/app/spotlight/entry/GQLHistory.vue(+30 -0)➕
packages/hoppscotch-common/src/components/app/spotlight/entry/RESTHistory.vue(+43 -0)➕
packages/hoppscotch-common/src/components/app/spotlight/index.vue(+238 -0)📝
packages/hoppscotch-common/src/components/firebase/Logout.vue(+8 -3)📝
packages/hoppscotch-common/src/components/history/index.vue(+5 -0)📝
packages/hoppscotch-common/src/helpers/actions.ts(+74 -21)📝
packages/hoppscotch-common/src/helpers/keybindings.ts(+2 -2)➖
packages/hoppscotch-common/src/helpers/powerSearchNavigation.ts(+0 -55)📝
packages/hoppscotch-common/src/helpers/shortcuts.ts(+142 -311)...and 16 more files
📄 Description
Closes HFE-91 HFE-92 HFE-123 HFE-125
Description
This PR intends to improve the Spotlight feature of Hoppscotch and make it more dynamic and flexible to search through different type of things into the app and try to score the more relevant stuff up on the list, along with the ability to render custom and dynamic entries with custom UI on search entries.
Stuff that is changed
history.clear), user log in (user.login), user log out (user.logout) along with their handlers in a corresponding component.rest.request.open) and GraphQL request (gql.request.open).defineActionHandlerto be able to specify if the action handle is available, this lets action handlers to opt out of handling actions and unbind as a result and bind back in again when ready. It takes in a boolean ref that will be watched for this to happen, if no ref is passed, it will keep the old behaviour.HoppActiontype to play properly withHoppActionWithArgsimplementation.@vueuse/coreand introducedminisearchas a dependencygetServicefunction onmodules/diocto be able to expose services to non-service code. This function is marked deprecated as its usage is generally discouraged and is only there to help with legacy code.getI18nfunction to let i18n strings be available outside component code (like services).AppFusecomponent as it is not necessary anymore.AppPowerSearchcomponent toAppSpotlightAppPowerSearchEntrycomponent toAppSpotlightEntrypowerSearchNavigationhelperpowerSearchNavigationAppSpotlightto use the Spotlight Service to do the searching.AppSpotlightto show if any of the searchers are loading_getServiceand_getBoundServiceIDs()global functions.SpotlightSearcherinterface that defines how a searcher should workStaticSpotlightSearcherServicethat abstracts searcher service implementations for static documents.UserSpotlightSearcherService(extendingStaticSpotlightSearcherService) andHistorySpotlightSearcherServicethat provide login/logout and history based search entries respectively.vitest.config.tsto let Vitest parse icon imports and Vue components./tocmd+kcmd+ktocmd+/NOTE: This is an initial implementation to get started, once this is merged, we can iteratively add other searchers as required.
Checks
Additional Information
N/A
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.