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

Commit

Permalink
Release 0.2.3 (#220)
Browse files Browse the repository at this point in the history
* improve search analytics

* prevent select all override if target is input

* bump version
  • Loading branch information
anastasiya1155 authored Mar 1, 2023
1 parent fa3edc1 commit 6a107c7
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apps/desktop/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bloop"
version = "0.2.2"
version = "0.2.3"
description = "Search code. Fast."
authors = ["Bloop AI Developers"]
license = ""
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"package": {
"productName": "bloop",
"version": "0.2.2"
"version": "0.2.3"
},
"tauri": {
"allowlist": {
Expand Down
2 changes: 1 addition & 1 deletion client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ pnpm install
npm run start-web
```

Open `localhost:5173` in a browser and, hey presto, you've got bloop in the browser.
Open `localhost:5173` in a browser and, hey presto, you've got bloop in the browser.
6 changes: 5 additions & 1 deletion client/src/components/CodeBlock/CodeFull/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,11 @@ const CodeFull = ({

useEffect(() => {
const handler = (event: KeyboardEvent) => {
if ((event.ctrlKey || event.metaKey) && event.key === 'a') {
if (
(event.ctrlKey || event.metaKey) &&
event.key === 'a' &&
(event.target as HTMLElement)?.tagName !== 'INPUT'
) {
// Prevent the default action (i.e. selecting all text in the browser)
event.preventDefault();
setCurrentSelection([
Expand Down
4 changes: 3 additions & 1 deletion client/src/hooks/useAnalytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ import * as analytics from 'rudder-sdk-js';

const useAnalytics = () => {
const trackSearch = useCallback(
(queryTime: number) => {
(queryTime: number, query: string, searchId?: string) => {
analytics?.track('Search', {
queryTime,
query,
searchId,
});
},
[analytics],
Expand Down
4 changes: 2 additions & 2 deletions client/src/hooks/useSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const useSearch = <T,>(
if (i === 0) {
const queryTime = Date.now() - startTime;
setLastQueryTime(queryTime);
trackSearch(queryTime);
trackSearch(queryTime, query, newData.query_id);
if (newData.Err) {
setStatus((prev) => ({
...prev,
Expand Down Expand Up @@ -104,7 +104,7 @@ export const useSearch = <T,>(
.then((res: any) => {
const queryTime = Date.now() - startTime;
setLastQueryTime(queryTime);
trackSearch(queryTime);
trackSearch(queryTime, query);
setStatus({ loading: false, data: res });
})
.catch((error: Error) => {
Expand Down

0 comments on commit 6a107c7

Please sign in to comment.