mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 16:55:59 +03:00
[PR #3727] [MERGED] chore(common): analytics on spotlight #4510
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#4510
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/3727
Author: @jamesgeorge007
Created: 1/7/2024
Status: ✅ Merged
Merged: 2/2/2024
Merged by: @AndrewBastin
Base:
release/2023.12.4← Head:spotlight-analytics📝 Commits (10+)
a8ce0c1chore: analytics on spotlight7eb0445refactor: move analytics log event logic to spotlight service1e35a45chore: compute the session duration and send it along2d4a8cetest: increase coverage759fa9btest: fix incorrect test casec44f6bcrefactor: use Date.now instead of timers for sessionDuration0339d10refactor: move inputLength tracking outside of the for loopcfc315achore: fix mismatch between HoppAction and HoppActionArgsMap9d1c2dbchore: fix type errors63a2537chore: cleanup📊 Changes
10 files changed (+267 additions, -76 deletions)
View changed files
📝
packages/hoppscotch-common/src/components/app/Header.vue(+1 -1)📝
packages/hoppscotch-common/src/components/app/spotlight/index.vue(+30 -16)📝
packages/hoppscotch-common/src/components/history/index.vue(+2 -1)📝
packages/hoppscotch-common/src/components/http/Request.vue(+6 -19)📝
packages/hoppscotch-common/src/helpers/actions.ts(+45 -21)📝
packages/hoppscotch-common/src/helpers/keybindings.ts(+3 -3)📝
packages/hoppscotch-common/src/layouts/default.vue(+18 -4)📝
packages/hoppscotch-common/src/platform/analytics.ts(+12 -0)📝
packages/hoppscotch-common/src/services/spotlight/__tests__/index.spec.ts(+97 -9)📝
packages/hoppscotch-common/src/services/spotlight/index.ts(+53 -2)📄 Description
Description
This PR introduces the changes for sending events about spotlight sessions to Posthog. This comprises of the following:
successwhile pressing escape indicatesclose).request,collection, etc).Closes HFE-383.
Changes
AnalyticsEventtype is introduced with the nameHOPP_SPOTLIGHT_SESSION.invokeActionmethod is updated to optionally take in atriggerargument that conveys the action trigger (keypress/mouseclick). This was required to communicate the spotlight launch method while openingcmd + ksince the keybinding definitions didn't support supplying arguments along withinvokeAction.HoppActionsWithNoArgs. This is now changed to map toHoppActionWithOptionalArgsthat compiles the actions with no arguments in addition to the actions that optionally accept arguments. For instance,request.save-as.SpotlightServiceto persist the session information and associated methodssetAnalyticsDataandgetAnalyticsDatato update and retrieve the information. The test suite is updated accordingly.Checks
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.