Skip to content
This repository was archived by the owner on Jan 2, 2025. It is now read-only.

Commit 6a107c7

Browse files
Release 0.2.3 (#220)
* improve search analytics * prevent select all override if target is input * bump version
1 parent fa3edc1 commit 6a107c7

7 files changed

Lines changed: 14 additions & 8 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/desktop/src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bloop"
3-
version = "0.2.2"
3+
version = "0.2.3"
44
description = "Search code. Fast."
55
authors = ["Bloop AI Developers"]
66
license = ""

apps/desktop/src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"package": {
1010
"productName": "bloop",
11-
"version": "0.2.2"
11+
"version": "0.2.3"
1212
},
1313
"tauri": {
1414
"allowlist": {

client/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ pnpm install
99
npm run start-web
1010
```
1111

12-
Open `localhost:5173` in a browser and, hey presto, you've got bloop in the browser.
12+
Open `localhost:5173` in a browser and, hey presto, you've got bloop in the browser.

client/src/components/CodeBlock/CodeFull/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,11 @@ const CodeFull = ({
283283

284284
useEffect(() => {
285285
const handler = (event: KeyboardEvent) => {
286-
if ((event.ctrlKey || event.metaKey) && event.key === 'a') {
286+
if (
287+
(event.ctrlKey || event.metaKey) &&
288+
event.key === 'a' &&
289+
(event.target as HTMLElement)?.tagName !== 'INPUT'
290+
) {
287291
// Prevent the default action (i.e. selecting all text in the browser)
288292
event.preventDefault();
289293
setCurrentSelection([

client/src/hooks/useAnalytics.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ import * as analytics from 'rudder-sdk-js';
33

44
const useAnalytics = () => {
55
const trackSearch = useCallback(
6-
(queryTime: number) => {
6+
(queryTime: number, query: string, searchId?: string) => {
77
analytics?.track('Search', {
88
queryTime,
9+
query,
10+
searchId,
911
});
1012
},
1113
[analytics],

client/src/hooks/useSearch.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export const useSearch = <T,>(
6969
if (i === 0) {
7070
const queryTime = Date.now() - startTime;
7171
setLastQueryTime(queryTime);
72-
trackSearch(queryTime);
72+
trackSearch(queryTime, query, newData.query_id);
7373
if (newData.Err) {
7474
setStatus((prev) => ({
7575
...prev,
@@ -104,7 +104,7 @@ export const useSearch = <T,>(
104104
.then((res: any) => {
105105
const queryTime = Date.now() - startTime;
106106
setLastQueryTime(queryTime);
107-
trackSearch(queryTime);
107+
trackSearch(queryTime, query);
108108
setStatus({ loading: false, data: res });
109109
})
110110
.catch((error: Error) => {

0 commit comments

Comments
 (0)